* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #ffffff;
    color: #1e293b;
    line-height: 1.6;
}

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.header {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 28px;
}

.header h1 {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
}

.header-actions {
    display: flex;
    gap: 12px;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
}

.converter-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    flex: 1;
}

/* Section Styles */
.input-section, .controls-section, .output-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 25px;
    display: flex;
    flex-direction: column;
}

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

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

.section-actions {
    display: flex;
    gap: 10px;
}

/* Editor Container */
.editor-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.editor-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.json-editor, .csv-output {
    flex: 1;
    background: #edf5ff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    color: #1e293b;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
}

.json-editor:focus, .csv-output:focus {
    border-color: #0f4ba5;
}

.csv-output {
    background: #ffffff;
}

.editor-info {
    background: #edf5ff;
    padding: 12px 20px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: center;
    gap: 30px;
    font-size: 12px;
}

.info-item {
    color: #64748b;
}

/* Validation Status */
.validation-status, #outputStatus {
    background: #edf5ff;
    padding: 12px 20px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    background: #f93e3e;
    color: #fff;
}

.status-indicator.success {
    background: #49cc90;
}

.status-indicator.error {
    background: #f93e3e;
}

.status-indicator.warning {
    background: #ff9f1a;
}

.status-message {
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
}

/* Controls Section */
.controls-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.control-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #1e293b;
    cursor: pointer;
}

.control-label input[type="radio"] {
    display: none;
}

.control-label input[type="checkbox"] {
    display: none;
}

.radio-custom {
    width: 16px;
    height: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 50%;
    position: relative;
    transition: all 0.2s;
}

.control-label input[type="radio"]:checked + .radio-custom {
    background: #0f4ba5;
    border-color: #0f4ba5;
}

.control-label input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    background: #fff;
    border-radius: 50%;
}

.checkmark {
    width: 16px;
    height: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 3px;
    background: #3c3c3c;
    position: relative;
    transition: all 0.2s;
}

.control-label input[type="checkbox"]:checked + .checkmark {
    background: #0f4ba5;
    border-color: #0f4ba5;
}

.control-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 10px;
    font-weight: bold;
}

.control-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.control-field label {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 6px;
}

.control-input {
    padding: 8px 12px;
    background: #3c3c3c;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    color: #fff;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.control-input:focus {
    border-color: #0f4ba5;
}

/* Actions Row */
.actions-row {
    display: flex;
    gap: 15px;
    padding-top: 20px;
}

/* Info Badge */
.info-badge {
    background: #3c3c3c;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: #0f4ba5;
    color: #fff;
}

.btn-primary:hover {
    background: #005a9e;
}

.btn-secondary {
    background: #3c3c3c;
    border: 1px solid #e2e8f0;
    color: #1e293b;
}

.btn-secondary:hover {
    background: #4c4c4c;
    border-color: #0f4ba5;
    color: #fff;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .converter-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .controls-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .input-section, .controls-section, .output-section {
        padding: 20px;
    }
    
    .actions-row {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .section-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .section-actions {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #ffffff;
}

::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4e4e52;
}
