/* -------------------------------------------------------------------
 * SAR Data Validator Core Styles - WCAG 2.1 AA Compliant Colors
 * ------------------------------------------------------------------- */

/* Color Palette:
 * -- White/Background: #FFFFFF
 * -- Text/Dark: #212529 (Charcoal)
 * -- Accent/Primary Blue: #007bff (Blue) - Excellent contrast on white (4.5:1 minimum required)
 * -- Success/Valid: #008000 (Dark Green)
 * -- Error/Invalid: #CC0000 (Dark Red)
 * -- Warning/Pending: #FFD700 (Gold/Yellow)
 * -- Neutral/Disabled: #adb5bd (Light Gray)
 */

body { 
    font-family: 'Inter', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; 
    margin: 0; 
    padding: 20px;
    background-color: #f8f9fa; /* Very light gray background */
    color: #212529; /* Dark charcoal text */
}

.container { 
    max-width: 900px; 
    margin: auto; 
    background: #fff; 
    padding: 30px; 
    border-radius: 12px; 
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

h1 { 
    text-align: center; 
    color: #007bff; /* Primary Accent Blue */
    margin-bottom: 5px; 
    font-weight: 600; 
}

h2 {
    color: #343a40;
    text-align: center;
    margin-top: 0;
    font-weight: 500;
}

.description {
    text-align: center;
    color: #6c757d;
    margin-bottom: 25px;
}

/* --- Navigation Styling --- */

.main-nav {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-bottom: 20px;
}

.nav-link {
    padding: 10px 0;
    text-decoration: none;
    color: #495057;
    border-bottom: 3px solid transparent;
    transition: color 0.2s, border-bottom-color 0.2s;
    font-weight: 500;
}

.nav-link:hover {
    color: #007bff;
}

.nav-link.active {
    color: #007bff;
    border-bottom-color: #007bff;
    font-weight: 600;
}

/* --- Validation Button Styles --- */

.validate-btn-container { 
    text-align: center; 
    margin: 25px 0 35px 0; 
}

.validate-all-btn, .validate-single-btn { 
    padding: 12px 25px; 
    background-color: #007bff;
    color: white; 
    border: none; 
    border-radius: 6px; 
    cursor: pointer; 
    font-size: 15px; 
    font-weight: 600; 
    transition: background-color 0.2s, transform 0.1s, box-shadow 0.2s; 
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-left: 10px;
}

.validate-all-btn:hover:not(:disabled), .validate-single-btn:hover:not(:disabled) { 
    background-color: #0056b3; 
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.validate-all-btn:disabled, .validate-single-btn:disabled { 
    background-color: #adb5bd; 
    color: #777;
    cursor: not-allowed; 
    box-shadow: none;
}

/* --- Layout and File Input Styles --- */

.separator {
    border: 0;
    height: 1px;
    background-color: #dee2e6;
    margin: 30px 0;
}

.schema-group { 
    margin-bottom: 15px; 
    padding: 15px; 
    border: 1px solid #e9ecef; 
    border-left: 5px solid #007bff; 
    border-radius: 6px; 
    background-color: #ffffff; 
    transition: box-shadow 0.2s;
}

.schema-group:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.schema-group label { 
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px; 
    font-weight: 600; 
    color: #212529; 
    padding-bottom: 5px;
    border-bottom: 1px dashed #f1f1f1;
}

.file-input-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

.schema-group input[type="file"] { 
    padding: 10px; 
    border: 1px solid #ccc; 
    border-radius: 4px; 
    flex-grow: 1; 
    font-size: 14px;
}

/* --- Status Badges (High-Contrast) --- */

.status-badge { 
    display: inline-block; 
    padding: 6px 12px; 
    margin-left: 15px; 
    border-radius: 15px; 
    font-size: 0.8em; 
    font-weight: 700; 
    text-transform: uppercase;
    min-width: 120px;
    text-align: center;
    letter-spacing: 0.5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.status-valid { 
    background-color: #e8f5e9; 
    color: #008000; /* Dark Green Text (Excellent contrast) */
    border: 1px solid #008000;
}
.status-invalid { 
    background-color: #ffebee; 
    color: #CC0000; /* Dark Red Text (Passes contrast) */
    border: 1px solid #CC0000;
}
.status-pending { 
    background-color: #e0f2f1; 
    color: #007bff; 
    border: 1px solid #007bff;
}
.status-warnings { 
    background-color: #fffde7; 
    color: #b8860b; /* Dark Goldenrod text (high contrast on light yellow) */
    border: 1px solid #FFD700;
}
.status-error { 
    background-color: #212529; 
    color: #FFFFFF; 
}

.download-link { 
    margin-left: 15px; 
    font-size: 0.85em;
    color: #007bff;
    text-decoration: underline;
    transition: color 0.2s;
}

.download-link:hover {
    color: #0056b3;
}

/* Loading State */
#loading {
    padding: 15px;
    border-radius: 8px;
    background-color: #e0f2f1;
    color: #007bff;
    font-weight: 600;
    margin-top: 30px !important;
    border: 1px solid #007bff;
}

/* --- Schema Viewer Specific Styles --- */

.schema-list-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 25px;
    padding: 10px 0;
}

.schema-link-btn {
    padding: 8px 15px;
    background-color: #f1f1f1;
    color: #212529;
    border: 1px solid #ccc;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: background-color 0.2s, border-color 0.2s;
}

.schema-link-btn:hover {
    background-color: #e9ecef;
    border-color: #007bff;
}

.schema-link-btn.active {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

#schema-display-container {
    background-color: #212529; /* Dark background for code */
    color: #f8f9fa; /* Light text for max contrast */
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Consolas', 'Courier New', monospace;
    max-height: 60vh;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.4);
}

.schema-content-pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 0.9em;
    line-height: 1.4;
}

/* --- Responsive Adjustments --- */
@media (max-width: 600px) {
    .container {
        padding: 20px 15px;
    }
    h1 {
        font-size: 1.6em;
    }
    /* Stack navigation items */
    .main-nav {
        flex-direction: column;
        gap: 0;
    }
    .nav-link {
        text-align: center;
        border-bottom: none;
        padding: 8px 0;
    }
    .nav-link.active {
        border-bottom: 3px solid #007bff;
    }
    /* Stack validation groups elements */
    .schema-group label {
        flex-direction: column;
        align-items: flex-start;
    }
    .status-badge, .download-link {
        margin-left: 0;
        margin-top: 8px;
        display: block;
    }
    .file-input-container {
        flex-direction: column;
        align-items: stretch;
    }
    .validate-single-btn {
        margin-left: 0;
    }
    .validate-all-btn {
        width: 100%;
        margin-left: 0;
    }
    /* Full width schema viewer buttons */
    .schema-list-container {
        flex-direction: column;
    }
    .schema-link-btn {
        width: 100%;
    }
}