/* ==========================================================================
   CLASSROOM CSS — Fully Responsive, Modern Design
   Normalized font sizes, fluid layouts, consistent across all screens
   ========================================================================== */

/* ==========================================================================
   1. ROOT VARIABLES & BASE
   ========================================================================== */
:root {
    /* Fluid typography — tight, sensible ranges */
    --fs-h1:   clamp(1.25rem, 2.5vw, 1.95rem);
    --fs-h2:   clamp(1.1rem,  2vw,   1.75rem);
    --fs-body: clamp(0.875rem, 1.1vw, 1.35rem);

    /* Layout */
    --sidebar-width: 320px;
    --header-height: 70px;
    --content-max:   1440px;
    --radius-card:   16px;
    --gap-layout:    20px;
}

/* ==========================================================================
   2. CLASSROOM WRAPPER
   ========================================================================== */
.classroom-wrapper {
    background: var(--color-light, #f7f8fa);
    min-height: 100vh;
    font-family: var(--font-primary, 'Segoe UI', sans-serif);
    font-size: var(--fs-body);
    color: var(--color-bodyest, #2d3748);
    margin: 0;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   3. HEADER
   ========================================================================== */
.classroom-header {
    background: var(--color-white, #fff);
    height: var(--header-height);
    border-bottom: 2px solid var(--color-border-2, #edf0f5);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 6px rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
}

/* Course meta / branding row */
.course-meta-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0; /* Prevent overflow */
}

.back-link {
    background: var(--color-gray-light, #f3f4f6);
    border: 1px solid var(--color-border, #dde1e8);
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 10px;
    color: var(--color-primary, #761c22);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 15px;
    transition: background 0.2s ease, color 0.2s ease;
}

.back-link:hover {
    background: var(--color-primary, #761c22);
    color: #fff;
    border-color: var(--color-primary, #761c22);
}

.course-title {
    font-weight: 800;
    font-size: var(--fs-h2);
    color: var(--color-heading, #1a202c);
    margin: 0;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
	width: 80%;
}

/* ==========================================================================
   4. CLASSROOM TABS
   ========================================================================== */
.classroom-tabs {
    display: flex;
    background: var(--color-gray-light, #f3f4f6);
    padding: 5px;
    border-radius: 12px;
    gap: 3px;
    border: 1px solid var(--color-border-2, #edf0f5);
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    flex-shrink: 0;
}

.classroom-tabs::-webkit-scrollbar { display: none; }

.tab-btn {
    border: none;
    background: transparent;
    padding: 8px 18px;
    font-weight: 600;
    font-size: 13px;
    color: var(--color-body, #4a5568);
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    line-height: 1.4;
}

.tab-btn.active {
    background: var(--color-white, #fff);
    color: var(--color-primary, #761c22);
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.tab-btn:hover:not(.active) {
    color: var(--color-primary, #761c22);
    background: rgba(255,255,255,0.6);
}

/* ==========================================================================
   5. MAIN BODY LAYOUT
   ========================================================================== */
.classroom-body {
    padding: clamp(14px, 2.5vw, 28px);
    max-width: var(--content-max);
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    flex: 1;
}

/* Flexbox layout — stage auto-expands when sidebar is hidden */
.layout-container {
    display: flex;
    flex-direction: column;
    gap: var(--gap-layout);
    align-items: stretch;
}

/* ==========================================================================
   6. SIDEBAR
   ========================================================================== */
.class-sidebar {
    display: none;          /* Hidden by default (mobile + no JS toggle) */
    width: var(--sidebar-width);
    flex-shrink: 0;
}

.class-sidebar.active {
    display: block;
}

.sidebar-inner-content {
    background: var(--color-white, #fff);
    border-radius: var(--radius-card);
    padding: 20px;
    border: 1px solid var(--color-border-2, #edf0f5);
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

/* Sidebar section headings */
.sidebar-inner-content h6,
.sidebar-inner-content .sidebar-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #9e9e9e;
    margin-bottom: 12px;
}

/* Sidebar list items */
.sidebar-inner-content .sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-bodyest, #2d3748);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    text-decoration: none;
}

.sidebar-inner-content .sidebar-item:hover,
.sidebar-inner-content .sidebar-item.active {
    background: var(--primary-opacity, #fff0f0);
    color: var(--color-primary, #761c22);
}

.sidebar-inner-content .sidebar-item.active {
    font-weight: 700;
}

/* ==========================================================================
   7. MAIN STAGE (CONTENT AREA)
   ========================================================================== */
.class-main-stage {
    background: var(--color-white, #fff);
    border-radius: var(--radius-card);
    
    /* 1. Set a Fixed Height */
    height: 83vh; /* Adjust this to your preferred fixed height */
    
    /* 2. Enable Scrolling */
    overflow-y: scroll;
    
    /* 3. Hide Scrollbar for Chrome, Safari and Opera */
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;     /* Firefox */
    
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
    border: 1px solid var(--color-border-2, #edf0f5);
    flex: 1;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

/* 4. Hide Scrollbar for Chrome, Safari and Opera */
.class-main-stage::-webkit-scrollbar {
    display: none;
}

/* Content Typography */
#tab-content-render h1,
#tab-content-render h2 {
    font-size: var(--fs-h1);
    font-weight: 800;
    margin-bottom: 14px;
    color: var(--color-primary, #761c22);
    line-height: 1.2;
    letter-spacing: -0.3px;
}

#tab-content-render h3 {
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--color-heading, #1a202c);
}

#tab-content-render p {
    font-size: var(--fs-body);
    line-height: 1.7;
    margin-bottom: 14px;
    color: var(--color-body, #4a5568);
}

#tab-content-render ul,
#tab-content-render ol {
    font-size: var(--fs-body);
    line-height: 1.7;
    padding-left: 20px;
    margin-bottom: 14px;
    color: var(--color-body, #4a5568);
}

#tab-content-render li { margin-bottom: 6px; }

/* ==========================================================================
   8. LOADER
   ========================================================================== */
.loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 320px;
    gap: 16px;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.spinner-border.text-red {
    width: 2.5rem;
    height: 2.5rem;
    border-width: 0.3em;
    color: var(--color-primary, #761c22) !important;
}

.loader-container p {
    font-size: 13px;
    color: var(--color-body, #4a5568);
    font-weight: 500;
    margin: 0;
    animation: pulseSync 1.4s ease-in-out infinite;
}

@keyframes pulseSync {
    0%, 100% { opacity: 0.5; }
    50%       { opacity: 1; }
}

/* ==========================================================================
   9. VIDEO / MEDIA EMBED
   ========================================================================== */
.video-embed-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    margin-bottom: 20px;
}

.video-embed-wrap iframe,
.video-embed-wrap video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ==========================================================================
   10. PROGRESS / STATUS INDICATORS
   ========================================================================== */
.progress-bar-wrap {
    background: #f0f0f0;
    border-radius: 20px;
    height: 6px;
    overflow: hidden;
    margin-bottom: 6px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #761c22, #c9a050);
    border-radius: 20px;
    transition: width 0.4s ease;
}

.progress-label {
    font-size: 11.5px;
    color: var(--color-body, #4a5568);
    font-weight: 600;
}

/* ==========================================================================
   11. DESKTOP ADAPTATIONS (≥ 1024px)
   ========================================================================== */
@media (min-width: 1024px) {
    .classroom-header {
        height: var(--header-height);
    }

    .header-container {
        flex-direction: row;
        align-items: center;
    }

    .classroom-tabs {
        white-space: nowrap;
    }


    /* Side-by-side row on desktop — stage fills whatever space the sidebar doesn't use */
    .layout-container {
        flex-direction: row;
        align-items: start;
    }

    /* Sidebar always visible on desktop */
    .class-sidebar {
        display: block;
    }

    /* Sticky sidebar */
    .sidebar-inner-content {
        position: sticky;
        top: calc(var(--header-height) + 16px);
        max-height: calc(100vh - var(--header-height) - 32px);
        overflow-y: auto;
        scrollbar-width: thin;
        scrollbar-color: var(--color-border, #dde1e8) transparent;
    }

    .sidebar-inner-content::-webkit-scrollbar { width: 3px; }
    .sidebar-inner-content::-webkit-scrollbar-thumb {
        background: var(--color-border, #dde1e8);
        border-radius: 10px;
    }
}

/* ==========================================================================
   12. TABLET (768px – 1023px)
   ========================================================================== */
@media (min-width: 768px) and (max-width: 1023px) {
    .classroom-header {
        height: auto;
        padding: 12px clamp(16px, 4vw, 32px);
    }

    .header-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .classroom-tabs {
        width: 100%;
    }

    .tab-btn {
        flex: 1;
        text-align: center;
    }

    /* Sidebar toggled via JS on tablet */
    .class-sidebar.active { display: block; }
}

/* ==========================================================================
   13. MOBILE (≤ 767px)
   ========================================================================== */
@media (max-width: 767px) {
    :root {
        --gap-layout: 14px;
        --radius-card: 12px;
    }

    .classroom-header {
        height: auto;
    }

    .header-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .course-title { font-size: 1.05rem; }

    .classroom-tabs { width: 100%; }
    .tab-btn { flex: 1; text-align: center; padding: 7px 10px; font-size: 12px; }

    .classroom-body { padding: 0; }

    .class-main-stage {
        padding: 0;
        border-radius: 12px;
    }

    .sidebar-inner-content { padding: 16px; }

    #tab-content-render p { max-width: 100%; }

    .video-embed-wrap { border-radius: 8px; }
}

/* ==========================================================================
   14. SMALL MOBILE (≤ 400px)
   ========================================================================== */
@media (max-width: 400px) {
    .tab-btn { padding: 6px 8px; font-size: 11px; }
    .back-link { width: 34px; height: 34px; font-size: 13px; }
    .course-title { font-size: 0.95rem; width: 80%; }
}
:root {
    --brand-red: #761c22;
    --brand-gold: #c9a050;
    --brand-gold-faint: #fffbf2;
    --bg-gray: #f8fafc;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --white: #ffffff;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.1);
    --radius: 12px;
}

.ov-container {
    background-color: var(--bg-gray);
    color: var(--text-dark);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    padding: 40px 20px;
}

.ov-max-width {
    max-width: 1200px;
    margin: 0 auto;
}

/* ── Hero Section ── */
.ov-hero {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 40px;
    margin-bottom: 60px;
    align-items: center;
}

.video-box {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    aspect-ratio: 16 / 9;
    background: #000;
}

.video-box iframe { width: 100%; height: 100%; border: none; }

.hero-content h1 {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 20px;
    color: var(--brand-red);
}

.short-desc {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 25px;
}

/* ── Main Layout Grid ── */
.ov-main-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 50px;
}

/* ── Sidebar Specs ── */
.sidebar-card {
    background: var(--white);
    padding: 30px;
    border-radius: var(--radius);
    border: 1px solid #e2e8f0;
    position: sticky;
    top: 30px;
}

.spec-item {
    display: flex;
    justify-content: space-between;
    padding: 15px 0;
    border-bottom: 1px solid #f1f5f9;
}

.spec-label { font-weight: 600; color: var(--text-muted); font-size: 0.9rem; }
.spec-value { font-weight: 700; color: var(--text-dark); }

/* ── Learning Outcomes (Chips) ── */
.outcomes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 25px 0;
}

.outcome-card {
    background: var(--white);
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid var(--brand-gold);
    box-shadow: var(--shadow-sm);
    font-size: 0.95rem;
}

/* ── Staff Gallery ── */
.staff-section { margin-top: 60px; }
.staff-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.staff-card {
    background: var(--white);
    padding: 25px;
    text-align: center;
    border-radius: var(--radius);
    transition: transform 0.2s;
}

.staff-card:hover { transform: translateY(-5px); }

.staff-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    margin-bottom: 15px;
    border: 3px solid var(--brand-gold);
    object-fit: cover;
}

.staff-name { font-weight: 800; margin-bottom: 5px; }
.staff-role { font-size: 0.85rem; color: var(--brand-red); text-transform: uppercase; font-weight: 700; }

@media (max-width: 900px) {
    .ov-hero, .ov-main-grid { grid-template-columns: 1fr; }
    .ov-hero { order: 2; }
}

/* --- LMS STAGE WRAPPER --- */
.lms-stage-wrapper {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* --- HEADER DESIGN --- */
.lms-header-container {
    padding: 1em 1.5rem;
    background: #ffffff;
    border: 1.5px solid #ececec;
    border-radius: 10px;
    margin-bottom: 2rem;
    position: relative;
}

.lms-top-tag {
    font-size: 10px;
    font-weight: 900;
    color: #c9a050; /* Brand Gold */
    letter-spacing: 2px;
}

.lms-main-title {
    font-weight: 900;
    font-size: 2.5rem;
    letter-spacing: -1.5px;
    color: #1a1a1a;
    text-transform: uppercase;
    margin: 5px 0;
}

.lms-sub-info {
    font-size: 11px;
    font-weight: 800;
    color: #888;
    letter-spacing: 1px;
}

/* --- SEARCH BAR --- */
.lms-search-wrapper {
    position: relative;
    background: #f8f9fa;
    border: 1.5px solid #eee;
    border-radius: 16px;
    transition: all 0.3s ease;
	padding: 1px 10px !important;
}

.lms-search-wrapper:focus-within {
    background: #fff;
    border-color: #c9a050;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05) !important;
}

.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
}

#lms-module-search {
    border: none;
    background: transparent;
    width: 100%;
    font-size: 14px;
    font-weight: 600;
    outline: none;
}

/* --- CARD ARCHITECTURE --- */
.lms-card {
    background: #ffffff;
    border: 1.5px solid #ececec; /* Visible Border */
    border-radius: 22px;
    padding: 25px;
    height: 100%;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
}

.lms-card:hover {
    border-color: #c9a050;
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.06);
}

.lms-icon-box {
    width: 55px;
    height: 55px;
    background: #fdfdfd;
    border: 1px solid #f1f1f1;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #761c22; /* Brand Deep Red */
    font-size: 1.85rem;
}

.lms-status-badge {
    font-size: 9px;
    font-weight: 900;
    padding: 6px 12px;
    background: #f1f1f1;
    border-radius: 8px;
    color: #666;
}

.lms-type-label {
    font-size: 9px;
    font-weight: 900;
    color: #c9a050;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.lms-card-title {
    font-weight: 900;
    color: #1a1a1a;
    margin: 5px 0 12px 0;
    font-size: 1.3rem;
    line-height: 1.2;
}

.lms-card-text {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 25px;
}

/* --- ACTION BUTTON --- */
.sym-launch-btn {
    background: #1a1a1a;
    color: #fff !important;
    border: none;
    border-radius: 14px;
    padding: 15px 25px;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 1.5px;
    display: flex;
    justify-content: space-between; /* Spaced text and arrow */
    align-items: center;
    margin-top: auto;
    transition: all 0.3s ease;
}

.sym-launch-btn:hover {
    background: #761c22;
}

.sym-launch-btn i {
    transition: transform 0.3s ease;
}

.sym-launch-btn:hover i {
    transform: translateX(8px);
}
/* --- EXAM ENVIRONMENT NUCLEAR RESET (PRO VERSION) --- */

#exam-env { 
    /* This MUST be fixed and 100vw/vh to create a true lockdown layer */
    position: fixed !important; 
    top: 0;
    left: 0;
    width: 100vw !important; 
    height: 100vh !important; 
    z-index: 9999 !important; /* Ensures it stays ABOVE everything else */
    background: #f0f2f5; 
    display: flex; 
    flex-direction: column; 
    color: #1a202c; 
    overflow: hidden; /* Prevents the 'double scrollbar' glitch */
}

/* Ensure the main area fills the height so the result card is centered */
#exam-env main {
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    display: flex !important;
    flex-direction: column !important;
    background: #f4f7f6 !important; 
    -webkit-overflow-scrolling: touch;
}

/* Fix for the internal flex containers during the exam */
#exam-env .flex-grow-1 {
    display: flex !important;
    height: 100% !important;
    width: 100% !important;
}

/* The 'Killer' Rule: This locks the background website entirely */
body:has(#exam-env) {
    overflow: hidden !important;
    height: 100vh !important;
}

/* Ensure the Result UI inside renderAftermath is centered */
#exam-env main > .d-flex {
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
}

.mwr-library-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: #f8f9fa;
    position: relative;
}

.library-header {
    padding: 15px 25px;
    background: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
}

.course-tag { font-weight: 700; color: #2d3436; }
.module-tag { color: #636e72; }

.library-info-card {
    background: #fff;
    margin: 20px;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.file-viewer-frame {
    flex-grow: 1;
    margin: 0 20px 20px 20px;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #ddd;
}

.file-viewer-frame iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.floating-dl {
    position: absolute;
    bottom: 40px;
    right: 40px;
    background: #ff7675; /* MathwithRazz Red/Pink */
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(255, 118, 117, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.3s ease;
}

.floating-dl:hover { transform: scale(1.1); }

/* Animation for clicking */
.dl-animating {
    animation: bounce 0.5s infinite;
    background: #55efc4;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
@media (max-width: 991px) {
    /* 1. Hide the Sidebar when the Stage is active */
    body.stage-active .class-sidebar {
        display: none !important;
    }
    
    /* 2. Make the Stage full width when active */
    body.stage-active .class-main-stage {
        display: block !important;
        width: 100vw !important;
        max-width: 100vw !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* 3. Hide the Stage when the Sidebar (Navigator) is active */
    body.sidebar-active .class-main-stage {
        display: none !important;
    }

    /* 4. Make Sidebar full width when active */
    body.sidebar-active .class-sidebar {
        display: block !important;
        width: 100vw !important;
        max-width: 100vw !important;
    }
}