/* XSol Diagnostic System Styles */

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

    body {
        font-family: Arial, sans-serif;
        line-height: 1.6;
        color: #333;
        background-color: #f4f4f4;
    }

    .container {
        width: 1200px;
        margin: 0 auto;
        padding: 20px;
        background-color: white;
        min-height: 100vh;
        box-shadow: 0 0 10px rgba(0,0,0,0.1);
    }

    header {
        background-color: #2c3e50;
        color: white;
        padding: 20px;
        margin-bottom: 30px;
        border-radius: 5px;
    }

    header h1 {
        font-size: 2.5em;
        margin-bottom: 10px;
    }

    header nav {
        display: flex;
        align-items: center;
        gap: 20px;
    }

    header nav a {
        color: #ecf0f1;
        text-decoration: none;
        padding: 8px 16px;
        border-radius: 3px;
        transition: background-color 0.3s;
    }

    header nav a:hover {
        background-color: #34495e;
    }

    .header-back-button {
        margin-left: auto;
    }

    .back-nav-button {
        background-color: #6c757d;
        color: white;
        border: none;
        padding: 8px 16px;
        border-radius: 3px;
        cursor: pointer;
        font-size: 14px;
        transition: background-color 0.3s;
    }

    .back-nav-button:hover {
        background-color: #545b62;
    }

    .current-test {
        background-color: #e74c3c;
        padding: 8px 16px;
        border-radius: 3px;
        font-weight: bold;
    }

    .test-header {
        margin-bottom: 30px;
        padding-bottom: 15px;
        border-bottom: 2px solid #3498db;
    }

    .test-header h2 {
        color: #2c3e50;
        font-size: 2em;
    }

    .test-header h3 {
        color: #7f8c8d;
        font-weight: normal;
        margin-top: 5px;
    }

    .test-content {
        display: grid;
        gap: 30px;
    }

    /* Information section styling to match screenshot */
    .information-header {
        background-color: #2c3e50;
        color: white;
        padding: 8px 16px;
        border-radius: 5px 5px 0 0;
        margin-bottom: 0;
    }

    .information-header h3 {
        margin: 0;
        font-size: 1.2em;
        font-weight: bold;
    }

    .main-content {
        background-color: #e8e8e8;
        padding: 20px;
        border: 1px solid #ccc;
        border-radius: 0 0 5px 5px;
        margin-top: 0;
    }

    .safety-instruction {
        background-color: white;
        border: 2px solid #e74c3c;
        padding: 8px 12px;
        margin-bottom: 15px;
        font-weight: bold;
        border-radius: 3px;
    }

    .safety-instruction.power-off {
        background-color: #ffebee;
        border-color: #c62828;
    }

    .safety-instruction.gas-off {
        background-color: #fff3e0;
        border-color: #f57400;
    }

    .safety-instruction.additional {
        background-color: #f3e5f5;
        border-color: #7b1fa2;
    }

    .power-on-instruction {
        background-color: #fff9c4;
        border: 2px solid #fbc02d;
        padding: 8px 12px;
        margin-bottom: 10px;
        font-weight: bold;
        border-radius: 3px;
    }

    .power-on-instruction.mains-on {
        background-color: #fff8e1;
        border-color: #ff8f00;
        color: #e65100;
    }

    .power-on-instruction.gas-on {
        background-color: #e8f5e8;
        border-color: #4caf50;
        color: #2e7d32;
    }

    .dvm-instruction {
        background-color: #e3f2fd;
        border: 1px solid #2196f3;
        padding: 8px 12px;
        margin-bottom: 10px;
        border-radius: 3px;
        font-weight: 500;
    }

    .demand-instruction {
        background-color: #f9fbe7;
        border: 1px solid #8bc34a;
        padding: 6px 10px;
        margin-bottom: 8px;
        border-radius: 3px;
    }

    .demand-instruction.ch-demand {
        border-left: 4px solid #ff5722;
    }

    .demand-instruction.hw-demand {
        border-left: 4px solid #00bcd4;
    }

    .component-setup {
        background-color: #f5f5f5;
        border-left: 4px solid #9c27b0;
        padding: 12px 15px;
        margin-bottom: 15px;
    }

    .auto-test-indicator {
        background-color: #e8eaf6;
        border: 1px solid #3f51b5;
        padding: 8px 12px;
        margin-bottom: 10px;
        border-radius: 3px;
        font-style: italic;
    }

    .warning-text {
        background-color: #fff3cd;
        border: 1px solid #ffeaa7;
        color: #856404;
        padding: 8px 12px;
        margin: 10px 0;
        font-weight: bold;
        border-radius: 3px;
        text-align: center;
    }

    .gc-number {
        font-size: 1.1em;
        font-weight: bold;
        margin-bottom: 20px;
        color: #2c3e50;
    }

    .section-header {
        font-size: 1.2em;
        font-weight: bold;
        margin: 20px 0 10px 0;
        color: #2c3e50;
    }

    .instruction {
        margin-bottom: 15px;
        line-height: 1.8;
        text-align: justify;
    }

    .appliance-state-header {
        background-color: #455a64;
        color: white;
        padding: 8px 15px;
        font-weight: bold;
        margin: 15px 0 5px 0;
        border-radius: 3px;
    }

    .appliance-state {
        background-color: #ecf0f1;
        padding: 8px 15px;
        margin: 2px 0;
        border-left: 3px solid #455a64;
    }

    .observation-header {
        background-color: #455a64;
        color: white;
        padding: 8px 15px;
        font-weight: bold;
        margin: 15px 0 10px 0;
        border-radius: 3px;
    }

    .measurement-header {
        background-color: #455a64;
        color: white;
        padding: 8px 15px;
        font-weight: bold;
        margin: 15px 0 10px 0;
        border-radius: 3px;
    }

    .information-header {
        background-color: #1976d2;
        color: white;
        padding: 8px 15px;
        font-weight: bold;
        margin: 15px 0 10px 0;
        border-radius: 3px;
    }

    .description, .question {
        background-color: #ecf0f1;
        padding: 20px;
        border-radius: 5px;
        border-left: 4px solid #3498db;
    }

    .multimedia-container {
        position: relative;
        background-color: #f8f9fa;
        border: 1px solid #dee2e6;
        border-radius: 5px;
        overflow: hidden;
        /* Responsive scaling setup */
        width: 100%;
        max-width: 1920px;
        margin: 0 auto;
        /* aspect-ratio will be set dynamically by JavaScript */
        min-height: 300px; /* Minimum height for very small screens */
    }

    .multimedia-display {
        position: relative;
        /* width and height will be set dynamically by JavaScript */
        /* Transform will be applied by JavaScript */
    }

    .main-image {
        max-width: none; /* Allow images to scale beyond container */
        height: auto;
        object-fit: contain; /* Maintain aspect ratio */
    }

    .overlay-image {
        height: auto;
        object-fit: contain; /* Maintain aspect ratio */
    }

    .text-box {
        font-size: 14px;
        padding: 8px;
        border-radius: 3px;
        line-height: 1.4;
        font-weight: normal;
        box-sizing: border-box; /* Include padding in width calculations */
        word-wrap: break-word; /* Handle long text properly */
    }

    .test-controls {
        background-color: #f8f9fa;
        padding: 25px;
        border-radius: 5px;
        text-align: center;
    }

    .result-buttons {
        display: flex;
        gap: 20px;
        justify-content: center;
        margin-top: 15px;
    }

    .pass-btn, .fail-btn {
        padding: 15px 30px;
        font-size: 1.2em;
        border: none;
        border-radius: 5px;
        cursor: pointer;
        transition: all 0.3s;
        min-width: 120px;
    }

    .pass-btn {
        background-color: #27ae60;
        color: white;
    }

    .pass-btn:hover {
        background-color: #219a52;
        transform: translateY(-2px);
    }

    .fail-btn {
        background-color: #e74c3c;
        color: white;
    }

    .fail-btn:hover {
        background-color: #c0392b;
        transform: translateY(-2px);
    }

    .navigation-buttons {
        display: flex;
        justify-content: center;
        gap: 20px;
        margin-top: 30px;
        padding: 20px;
    }

    .nav-button {
        padding: 12px 30px;
        font-size: 16px;
        font-weight: bold;
        border: none;
        border-radius: 8px;
        cursor: pointer;
        transition: all 0.3s ease;
        min-width: 120px;
    }

    .continue-button {
        background-color: #007bff;
        color: white;
    }

    .continue-button:hover {
        background-color: #0056b3;
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
    }

    .pass-button {
        background-color: #28a745;
        color: white;
    }

    .pass-button:hover {
        background-color: #218838;
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
    }

    .fail-button {
        background-color: #dc3545;
        color: white;
    }

    .fail-button:hover {
        background-color: #c82333;
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
    }

    .question-button {
        background-color: #ffc107;
        color: #212529;
    }

    .question-button:hover {
        background-color: #e0a800;
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(255, 193, 7, 0.3);
    }

    .multiple-options {
        display: flex;
        flex-direction: column;
        gap: 15px;
        align-items: center;
        max-width: 600px;
        margin: 0 auto;
    }

    .multiple-options .nav-button {
        width: 100%;
        max-width: 500px;
        text-align: center;
        white-space: normal;
        word-wrap: break-word;
        line-height: 1.4;
        min-height: 50px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 15px 20px;
    }

    .completion-message {
        padding: 15px 30px;
        background-color: #f8f9fa;
        border: 2px solid #dee2e6;
        border-radius: 8px;
        font-weight: bold;
        color: #495057;
        text-align: center;
    }

    .navigation {
        background-color: #e8f4f8;
        padding: 20px;
        border-radius: 5px;
        border: 1px solid #bee5eb;
    }

    .nav-links {
        display: flex;
        gap: 15px;
        margin-top: 10px;
        flex-wrap: wrap;
    }

    .nav-pass, .nav-fail {
        padding: 10px 20px;
        text-decoration: none;
        border-radius: 5px;
        font-weight: bold;
        transition: all 0.3s;
    }

    .nav-pass {
        background-color: #d4edda;
        color: #155724;
        border: 1px solid #c3e6cb;
    }

    .nav-pass:hover {
        background-color: #c3e6cb;
    }

    .nav-fail {
        background-color: #f8d7da;
        color: #721c24;
        border: 1px solid #f5c6cb;
    }

    .nav-fail:hover {
        background-color: #f5c6cb;
    }

    /* Index page specific styles */
    .intro {
        text-align: center;
        margin-bottom: 40px;
        padding: 30px;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        border-radius: 10px;
    }

    .start-btn {
        display: inline-block;
        background-color: #e74c3c;
        color: white;
        padding: 15px 30px;
        text-decoration: none;
        border-radius: 5px;
        font-size: 1.2em;
        font-weight: bold;
        margin: 20px 0;
        transition: all 0.3s;
    }

    .start-btn:hover {
        background-color: #c0392b;
        transform: translateY(-2px);
    }

    .test-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 20px;
        margin-bottom: 40px;
    }

    .test-card {
        background-color: white;
        padding: 20px;
        border-radius: 8px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        border-left: 4px solid #3498db;
        transition: all 0.3s;
    }

    .test-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    }

    .test-card h3 a {
        color: #2c3e50;
        text-decoration: none;
    }

    .test-card h3 a:hover {
        color: #3498db;
    }

    .test-meta {
        margin-top: 10px;
        font-size: 0.9em;
        color: #7f8c8d;
    }

    .system-info {
        background-color: #f8f9fa;
        padding: 25px;
        border-radius: 5px;
        border-left: 4px solid #17a2b8;
    }

    .system-info ul {
        list-style-position: inside;
        margin-top: 15px;
    }

    .system-info li {
        margin-bottom: 8px;
    }

    footer {
        text-align: center;
        margin-top: 50px;
        padding: 20px;
        background-color: #2c3e50;
        color: white;
        border-radius: 5px;
    }

    /* Responsive design for smaller screens */
    @media (max-width: 1920px) {
        .container {
            width: 100%;
            padding: 10px;
        }
        
        .multimedia-container {
            max-width: 100%;
        }
    }

    @media (max-width: 1200px) {
        .multimedia-container {
            min-height: 200px; /* Adjust minimum height for smaller screens */
        }
    }

    @media (max-width: 800px) {
        .navigation-buttons {
            flex-direction: column;
            align-items: center;
        }
        
        .nav-button {
            width: 100%;
            max-width: 300px;
            margin-bottom: 10px;
        }
        
        .test-content {
            gap: 20px;
        }
        
        .main-content {
            padding: 15px;
        }
        
        .multimedia-container {
            min-height: 150px;
        }
    }

    @media (max-width: 600px) {
        header h1 {
            font-size: 1.8em;
        }
        
        .test-header h2 {
            font-size: 1.5em;
        }
        
        .nav-button {
            font-size: 14px;
            padding: 10px 20px;
        }
    }

/* ============================================
   Fault Code Table Styles
   ============================================ */

/* Fault Code Table Container */
.fault-code-table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 20px;
    margin: 20px 0;
}

.fault-code-table-container h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.4em;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

/* Search Box Styling */
.search-box {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
}

.search-box input {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    border: 2px solid #bdc3c7;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: #3498db;
}

.search-box button {
    padding: 8px 16px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.search-box button:hover {
    background-color: #2980b9;
}

.search-box button:active {
    transform: translateY(1px);
}

/* Table Wrapper for Scrolling */
.table-wrapper {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: auto;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    position: relative;
}

/* Fault Code Table */
.fault-code-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: white;
    min-width: 600px; /* Ensures horizontal scroll on small screens */
}

.fault-code-table thead {
    position: sticky;
    top: 0;
    background: #34495e;
    z-index: 10;
}

.fault-code-table thead th {
    background: #34495e;
    color: white;
    padding: 12px 8px;
    text-align: left;
    font-weight: bold;
    border: 1px solid #2c3e50;
    white-space: nowrap;
}

.fault-code-table tbody tr {
    transition: background-color 0.2s;
}

.fault-code-table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.fault-code-table tbody tr:hover {
    background-color: #e3f2fd !important;
}

.fault-code-table td {
    padding: 10px 8px;
    border: 1px solid #dee2e6;
    vertical-align: top;
    line-height: 1.4;
}

.fault-code-table td:first-child {
    font-weight: bold;
    text-align: center;
    background-color: #ecf0f1;
    min-width: 80px;
}

/* Search Highlighting */
.fault-row.highlight {
    background-color: #fff3cd !important;
    border-left: 4px solid #ffc107;
}

.fault-row.highlight td {
    background-color: transparent;
}

/* DVM Icon Styles */
.dvm-icon-link {
    text-decoration: none;
    display: inline-block;
    transition: transform 0.2s ease;
}

.dvm-icon-link:hover {
    transform: scale(1.1);
}

.dvm-icon {
    width: 32px;
    height: 32px;
    margin: 0 5px;
    vertical-align: middle;
    border: none;
    transition: opacity 0.2s ease;
}

.dvm-icon:hover {
    opacity: 0.8;
}

/* Responsive Design for Fault Tables */
@media (max-width: 1200px) {
    .fault-code-table-container {
        padding: 15px;
        margin: 15px 0;
    }
    
    .fault-code-table {
        font-size: 13px;
    }
    
    .fault-code-table th,
    .fault-code-table td {
        padding: 8px 6px;
    }
}

@media (max-width: 768px) {
    .fault-code-table-container {
        padding: 10px;
        margin: 10px 0;
    }
    
    .fault-code-table-container h3 {
        font-size: 1.2em;
    }
    
    .search-box {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box input {
        min-width: auto;
    }
    
    .search-box button {
        width: 100%;
    }
    
    .table-wrapper {
        max-height: 300px;
    }
    
    .fault-code-table {
        font-size: 12px;
        min-width: 500px;
    }
    
    .fault-code-table th,
    .fault-code-table td {
        padding: 6px 4px;
    }
}

@media (max-width: 480px) {
    .fault-code-table-container {
        padding: 8px;
    }
    
    .fault-code-table-container h3 {
        font-size: 1.1em;
    }
    
    .table-wrapper {
        max-height: 250px;
    }
    
    .fault-code-table {
        font-size: 11px;
        min-width: 400px;
    }
    
    .fault-code-table th,
    .fault-code-table td {
        padding: 4px 3px;
    }
}

/* Print Styles for Fault Tables */
@media print {
    .fault-code-table-container {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .search-box {
        display: none;
    }
    
    .table-wrapper {
        max-height: none;
        overflow: visible;
        border: none;
    }
    
    .fault-code-table {
        font-size: 10px;
    }
    
    .fault-code-table thead th {
        background: #f0f0f0 !important;
        color: #000 !important;
    }
}

    .back-button {
        background-color: #6c757d;
        color: white;
        margin-right: 15px;
        font-size: 14px;
        min-width: 80px;
    }

    .back-button:hover {
        background-color: #545b62;
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(108, 117, 125, 0.3);
    }

    /* Navigation Section Styles */
    .navigation-section {
        position: relative;
        width: 100%;
    }

    /* Options Comment Styles */

    .options-comment table {
        margin: 0;
        border-collapse: collapse;
        width: 20%;
    }

    .options-comment td {
        background-color: yellow !important;
        color: black !important;
        text-align: center;
        font-weight: bold;
        font-size: 14px;
        border: 1px solid #000;
    }

    /* Responsive adjustments for options comment */
    @media (max-width: 768px) {
        .navigation-options-comment {
            max-width: 100%;
        }
        
        .options-comment {
            font-size: 12px;
        }
        
        .options-comment td {
            padding: 6px;
            font-size: 12px;
        }
    }

        