/* YAML JSON Converter Styles */

.yaml-json-converter {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Conversion Direction Tabs */
.conversion-direction {
    margin-bottom: 30px;
}

.direction-tabs {
    display: flex;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 4px;
    gap: 4px;
}

.direction-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    color: #666;
}

.direction-tab:hover {
    background: #e9ecef;
    color: #333;
}

.direction-tab.active {
    background: #007bff;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

.tab-icon {
    font-size: 18px;
}

.tab-text {
    font-size: 14px;
}

/* Converter Interface */
.converter-interface {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    margin-bottom: 30px;
    align-items: start;
}

/* Input and Output Sections */
.input-section,
.output-section {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.section-header h3 {
    margin: 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.input-actions,
.output-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 12px;
    color: #666;
}

.action-btn:hover {
    background: #f8f9fa;
    border-color: #007bff;
    color: #007bff;
}

.btn-icon {
    font-size: 14px;
}

.btn-text {
    font-weight: 500;
}

/* Input and Output Containers */
.input-container,
.output-container {
    position: relative;
}

.input-textarea,
.output-textarea {
    width: 100%;
    height: 400px;
    padding: 20px;
    border: none;
    outline: none;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    background: white;
}

.input-textarea {
    border-bottom: 1px solid #e9ecef;
}

.output-textarea {
    background: #f8f9fa;
    color: #333;
}

.input-textarea:focus {
    background: #fff;
}

.input-info,
.output-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: #f8f9fa;
    font-size: 12px;
    color: #666;
    border-top: 1px solid #e9ecef;
}

.char-count,
.line-count {
    font-family: monospace;
}

.conversion-status {
    font-weight: 500;
}

.conversion-status.success {
    color: #28a745;
}

.conversion-status.error {
    color: #dc3545;
}

/* Conversion Controls */
.conversion-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 20px 0;
}

.convert-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

.convert-btn:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.4);
}

.convert-btn:active {
    transform: translateY(0);
}

.conversion-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.option-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #555;
    user-select: none;
}

.option-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #007bff;
}

.checkmark {
    position: relative;
}

.indent-select {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    font-size: 12px;
    color: #555;
}

.option-text {
    font-weight: 500;
    margin-right: 4px;
}

/* Error Section */
.error-section {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.error-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.error-icon {
    font-size: 18px;
}

.error-title {
    font-weight: 600;
    color: #721c24;
}

.error-message {
    color: #721c24;
    margin-bottom: 10px;
    font-weight: 500;
}

.error-details {
    color: #856404;
    font-family: monospace;
    font-size: 13px;
    background: #fff3cd;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #ffeaa7;
}

/* File Upload Section */
.file-upload-section {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 25px;
    margin-bottom: 30px;
}

.file-upload-section h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 18px;
}

.upload-area {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    background: #f9f9f9;
    transition: all 0.3s ease;
    cursor: pointer;
    margin-bottom: 15px;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: #007bff;
    background: #f0f8ff;
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.upload-icon {
    font-size: 48px;
    color: #666;
}

.upload-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.upload-text strong {
    color: #333;
    font-size: 16px;
}

.upload-text span {
    color: #666;
    font-size: 14px;
}

.supported-formats {
    text-align: center;
    font-size: 12px;
    color: #888;
}

/* Samples Section */
.samples-section {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 25px;
}

.samples-section h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 18px;
}

.samples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.sample-card {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

.sample-card:hover {
    border-color: #007bff;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
    transform: translateY(-2px);
}

.sample-card h4 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 16px;
}

.sample-card p {
    margin: 0 0 15px 0;
    color: #666;
    font-size: 14px;
}

.sample-preview {
    background: #f8f9fa;
    border-radius: 4px;
    padding: 12px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
    line-height: 1.4;
    color: #555;
    border: 1px solid #e9ecef;
}

.sample-preview code {
    background: none;
    padding: 0;
    color: inherit;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .converter-interface {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .conversion-controls {
        order: 2;
        flex-direction: row;
        justify-content: center;
        padding: 20px;
        background: white;
        border-radius: 8px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }
    
    .conversion-options {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .yaml-json-converter {
        padding: 15px;
    }
    
    .direction-tabs {
        flex-direction: column;
    }
    
    .section-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .input-actions,
    .output-actions {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .input-textarea,
    .output-textarea {
        height: 300px;
        font-size: 13px;
    }
    
    .conversion-controls {
        flex-direction: column;
    }
    
    .conversion-options {
        flex-direction: column;
    }
    
    .samples-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .file-upload-section,
    .samples-section {
        padding: 20px;
    }
    
    .upload-area {
        padding: 30px 15px;
    }
    
    .upload-icon {
        font-size: 36px;
    }
    
    .sample-card {
        padding: 15px;
    }
    
    .input-info,
    .output-info {
        flex-direction: column;
        gap: 5px;
        align-items: flex-start;
    }
}