/* ==========================================================================
   VigyanLok Exam Engine - Clean & Stable CBT Layout (Compact Refinement)
   ========================================================================== */

/* Outer Exam Container Box (Compact Max-Width to prevent stretching) */
.vl-exam-wrapper {
    width: 100%;
    max-width: 1020px;
    margin: 20px auto 30px auto;
    padding: 20px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
}

/* Header Bar & Timer */
.vl-exam-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #1e293b;
    color: #ffffff;
    padding: 12px 18px;
    border-radius: 6px;
    margin-bottom: 18px;
}

.vl-exam-header-bar h2 {
    margin: 0;
    color: #ffffff !important;
    font-size: 19px;
    font-weight: 600;
}

.vl-lang-switcher {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
}

.vl-lang-btn {
    border: 0;
    background: transparent;
    color: #e2e8f0;
    padding: 7px 12px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: all 0.2s ease;
}

.vl-lang-btn.active {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
}

#vl-timer {
    background: #0f172a;
    color: #ef4444;
    border: 2px solid #ef4444;
    border-radius: 6px;
    font-size: 17px;
    font-weight: 700;
    padding: 5px 12px;
}

/* Section Navigation Tabs */
.vl-section-tabs {
    display: flex !important;
    gap: 8px;
    margin-bottom: 18px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 8px;
    overflow-x: auto;
}

.vl-section-btn {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
    padding: 7px 14px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.vl-section-btn.active,
.vl-section-btn:hover {
    background: #2563eb !important;
    color: #ffffff !important;
    border-color: #2563eb !important;
}

/* Two-Column Exam Grid */
.vl-exam-layout {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

/* Left Area: Current Question */
.vl-main {
    flex: 1;
    background: #f8fafc;
    padding: 18px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    min-height: 380px;
}

.vl-question h3 {
    margin-top: 5px;
    margin-bottom: 14px;
    font-size: 17px;
    color: #0f172a;
    line-height: 1.4;
}

/* Option Cards */
.vl-question label {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    padding: 8px 14px;
    border-radius: 6px;
    margin-bottom: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #334155;
    transition: all 0.2s;
}

.vl-question label:hover {
    border-color: #2563eb;
    background: #f0f9ff;
}

.vl-question input[type="radio"] {
    margin-right: 12px;
    transform: scale(1.05);
    accent-color: #2563eb;
}

/* Right Area: Question Palette Sidebar */
.vl-sidebar {
    width: 260px;
    background: #f8fafc;
    padding: 15px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    box-sizing: border-box;
}

.vl-sidebar h3 {
    margin-top: 0;
    font-size: 15px;
    color: #0f172a;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 8px;
}

.vl-palette {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    margin-top: 12px;
}

.vl-nav-btn {
    width: 100%;
    height: 35px;
    background: #ffffff;
    color: #1e293b;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
}

/* Palette Status Colors */
.vl-nav-btn.answered,
.vl-nav-btn[data-status="answered"] {
    background-color: #22c55e !important;
    color: #ffffff !important;
    border-color: #16a34a !important;
}

.vl-nav-btn.not-answered,
.vl-nav-btn[data-status="not-answered"] {
    background-color: #ef4444 !important;
    color: #ffffff !important;
    border-color: #dc2626 !important;
}

.vl-nav-btn.marked,
.vl-nav-btn[data-status="marked"] {
    background-color: #8e44ad !important;
    color: #ffffff !important;
    border-color: #732d91 !important;
}

.vl-nav-btn.answered-marked,
.vl-nav-btn[data-status="answered-marked"] {
    background-color: #8e44ad !important;
    color: #ffffff !important;
    border: 2px solid #22c55e !important;
}

/* Bottom Action Buttons */
.vl-navigation {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid #e2e8f0;
}

.vl-navigation .button {
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    border: none;
}

.button-mark { background: #8e44ad; color: #fff; }
.button-clear { background: #64748b; color: #fff; }
.button-primary { background: #2563eb; color: #fff; }

/* Responsive Adjustments */
@media (max-width: 850px) {
    .vl-exam-layout {
        flex-direction: column;
    }
    .vl-sidebar {
        width: 100%;
    }
}

@media (max-width: 680px) {
    #vl-exam-main-wrapper.vl-exam-wrapper {
        margin: 0 !important;
        padding: 8px !important;
        border-left: 0;
        border-right: 0;
        border-radius: 0;
    }

    #vl-exam-active-screen .vl-exam-header-bar {
        padding: 10px !important;
        gap: 10px;
        align-items: flex-start !important;
    }

    #vl-exam-active-screen .vl-exam-header-bar > div:first-child {
        min-width: 0;
    }

    #vl-exam-active-screen .vl-exam-header-bar h2 {
        font-size: 15px !important;
        overflow-wrap: anywhere;
    }

    #vl-exam-active-screen .vl-exam-header-bar > div:last-child {
        flex-direction: column;
        gap: 6px !important;
        flex-shrink: 0;
    }

    #vl-exam-active-screen .vl-exam-header-bar button {
        width: 100%;
        padding: 7px 8px !important;
        font-size: 11px !important;
        white-space: nowrap;
    }

    #vl-exam-active-screen .vl-section-tabs {
        padding: 6px !important;
        margin-bottom: 10px !important;
    }

    #vl-exam-active-screen form > div:first-child {
        gap: 10px !important;
    }

    #vl-exam-active-screen form > div:first-child > div:first-child,
    #vl-exam-active-screen form > div:first-child > div:last-child {
        width: 100% !important;
        min-width: 0 !important;
        padding: 12px !important;
    }

    #vl-exam-active-screen .vl-question > div:first-child {
        align-items: flex-start !important;
        flex-direction: column;
    }

    #vl-exam-active-screen .vl-question-panel,
    #vl-exam-active-screen .vl-passage-panel {
        min-width: 0 !important;
        width: 100% !important;
    }

    #vl-exam-active-screen .vl-question-panel > div:first-child,
    #vl-exam-active-screen .vl-question > div[style*="font-size: 16px"] {
        font-size: 16px !important;
        line-height: 1.6 !important;
        overflow-wrap: anywhere;
    }

    #vl-exam-active-screen .vl-options-list label {
        align-items: flex-start !important;
        padding: 12px 10px !important;
        line-height: 1.45;
        overflow-wrap: anywhere;
    }

    #vl-exam-active-screen .vl-options-list label input {
        flex: 0 0 auto;
        margin-top: 3px;
    }

    #vl-exam-active-screen form > div:first-child > div:first-child > div:last-child {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    #vl-exam-active-screen form > div:first-child > div:first-child > div:last-child > div {
        width: 100%;
    }

    #vl-exam-active-screen .vl-nav-btn {
        width: 100% !important;
    }
}