@import url('https://luyenthivstep.vn/assets/css/style.css');

/* =============================================================================
   APP CUSTOM STYLES - Luyenthivstep.vn (App)
   Style đặc thù cho giao diện App (Sidebar, Practice Workspace, Dashboard)
   ============================================================================= */

/* ---------------------------------------------------
   1. APP UTILITIES & LAYOUT DIMENSIONS
----------------------------------------------------- */
:root {
    /* Layout Dimensions */
    --sidebar-width: 230px;
    --sidebar-collapsed-width: 70px;
}

/* Base Body Override */
body {
    background-color: #f8f9fa;
    overflow-x: hidden;
}

/* ---------------------------------------------------
   2. LAYOUT CSS (Sidebar, Main Content, Nav) 
----------------------------------------------------- */

/* Material Easing Curve Token */
:root {
    --sidebar-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Custom slim scrollbar for sidebar-body */
.sidebar-body::-webkit-scrollbar {
    width: 5px;
}

.sidebar-body::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-body::-webkit-scrollbar-thumb {
    background: #ced4da;
    border-radius: 10px;
}

.sidebar-body::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

.sidebar-body {
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #ced4da transparent;
}

/* Sidebar styling */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background-color: #fff;
    border-right: 1px solid #edf2f9;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    transition: width var(--sidebar-transition), padding var(--sidebar-transition);
    white-space: nowrap;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    will-change: width;
}

.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    width: calc(100% - var(--sidebar-width));
    transition: margin-left var(--sidebar-transition), width var(--sidebar-transition);
    will-change: margin-left, width;
}

/* Sidebar Brand Text & Styling */
.sidebar .brand-text {
    color: var(--brand) !important;
    font-weight: 700 !important;
    letter-spacing: -0.01em;
}

/* Smooth Accordion Submenu Layout (Eliminates layout shift on expand/collapse) */
.sidebar .collapse,
.sidebar .collapsing,
.offcanvas .collapse,
.offcanvas .collapsing {
    transition: height 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.sidebar .submenu-list,
.offcanvas .submenu-list {
    margin: 0 !important;
}

/* Flex Alignment & Sleek Padding for Sidebar Nav Links */
.sidebar .nav-link {
    display: flex !important;
    align-items: center !important;
    padding: 0.6rem 0.75rem !important;
    font-size: 0.925rem;
    font-weight: 500;
    border-radius: 0.5rem;
    color: #4b5563;
    gap: 0.65rem;
    transition: all 0.2s ease-in-out;
}

.sidebar .nav-link i {
    font-size: 1.1rem;
}

.sidebar .nav-link.active {
    background-color: var(--brand-light, #e0f2fe) !important;
    color: var(--brand, #0284c7) !important;
    font-weight: 600;
}

.sidebar .nav-link:hover:not(.active) {
    background-color: #f3f4f6;
    color: #111827;
}

.sidebar .submenu-link,
.offcanvas .submenu-link {
    font-size: 0.9rem;
    padding: 0.4rem 0.75rem;
    border-radius: 0.5rem;
    margin-top: 0.125rem;
    margin-bottom: 0.125rem;
}

/* Sub-chevron Smooth 180deg Rotation when Menu Group is Expanded */
.sidebar .sub-chevron,
.offcanvas .sub-chevron {
    transition: transform 0.25s ease-in-out !important;
    display: inline-block;
}

.sidebar .nav-link:not(.collapsed) .sub-chevron,
.sidebar .nav-link[aria-expanded="true"] .sub-chevron,
.offcanvas .nav-link:not(.collapsed) .sub-chevron,
.offcanvas .nav-link[aria-expanded="true"] .sub-chevron {
    transform: rotate(180deg) !important;
}

/* User Profile Link Styling (Neutral Dark) */
.sidebar .user-profile-link {
    color: #374151 !important;
    transition: color 0.15s ease-in-out;
}

.sidebar .user-profile-link:hover {
    color: #111827 !important;
}

.sidebar .user-profile-link .user-info {
    color: inherit !important;
}

/* Smooth Fade & Transition for Text Elements */
.sidebar .nav-text,
.sidebar .action-btn-text,
.sidebar .user-info,
.sidebar .brand-text {
    display: inline-block;
    vertical-align: middle;
    opacity: 1;
    max-width: 200px;
    overflow: hidden;
    white-space: nowrap;
}

@media (max-width: 767.98px) {
    .sidebar {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }
}

/* Nav links */
.nav-link {
    color: #6e84a3;
    font-weight: 500;
    padding: 0.6rem 0.85rem;
    border-radius: 0.5rem;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    transition: background-color 0.2s ease, color 0.2s ease, padding var(--sidebar-transition);
    width: 100%;
}

.nav-link i {
    font-size: 1.1rem;
    margin-right: 0.75rem;
    color: #95aac9;
    transition: color 0.2s ease, margin var(--sidebar-transition);
}

body.sidebar-collapsed .sidebar .nav-link {
    justify-content: center !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    width: 44px !important;
    height: 44px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    border-radius: 50% !important;
}

body.sidebar-collapsed .sidebar .nav-link i {
    margin-right: 0 !important;
}

.nav-link:hover,
.nav-link:focus {
    color: var(--brand) !important;
    background-color: var(--brand-light) !important;
}

.nav-link:hover i,
.nav-link:focus i {
    color: var(--brand) !important;
}

.nav-link.active {
    color: var(--brand) !important;
    background-color: var(--brand-light) !important;
    font-weight: 600;
}

.nav-link.active i {
    color: var(--brand) !important;
}

/* Sub menu */
.collapse .nav-item .nav-link {
    padding-left: 2rem;
    font-size: 0.95rem;
    font-weight: 400;
}

body.sidebar-collapsed .sidebar .collapse {
    display: none !important;
}

/* Sidebar Soft Active Style */
.sidebar .nav-pills .nav-link.active,
.offcanvas-body .nav-pills .nav-link.active {
    background-color: var(--brand-light) !important;
    border: none !important;
    color: var(--brand) !important;
    font-weight: 600;
}

.sidebar .nav-pills .nav-link.active i,
.offcanvas-body .nav-pills .nav-link.active i {
    color: var(--brand) !important;
}

.sidebar .nav-pills .nav-link.active:hover,
.offcanvas-body .nav-pills .nav-link.active:hover {
    background-color: var(--brand-light) !important;
    color: var(--brand) !important;
}

.sidebar .nav-pills .nav-link.active:hover i,
.offcanvas-body .nav-pills .nav-link.active:hover i {
    color: var(--brand) !important;
}

/* ---------------------------------------------------
    3. PRACTICE WORKSPACE CSS
----------------------------------------------------- */

/* Glassmorphism Header */
.glassmorphism-top {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

/* Audio Player Card */
.audio-player-wrapper {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    padding: 1.25rem;
    margin-bottom: 2rem;
}

/* Choice Cards (Radio alternative) */
.choice-card-input:checked+.choice-card-label {
    background-color: hsla(var(--brand-hsl), 0.08) !important;
    border-color: var(--brand) !important;
}

.choice-card-label {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    border: 1px solid #dee2e6;
    border-radius: 0.75rem;
    cursor: pointer;
    background-color: #fff;
    transition: all 0.2s ease-in-out;
}

.choice-card-label:hover {
    border-color: var(--brand-light);
    transform: translateX(4px);
    background-color: #f8f9fa;
}

.choice-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #f1f3f5;
    font-weight: 600;
    margin-right: 1rem;
    color: #495057;
    transition: all 0.2s;
}

.choice-card-input:checked+.choice-card-label .choice-letter {
    background-color: #ffffff;
    color: var(--brand);
}

/* Mindmap CSS Grid layout */
.mindmap-grid {
    display: grid;
    grid-template-columns: minmax(0, auto) minmax(0, auto) minmax(0, auto);
    grid-template-rows: minmax(0, auto) minmax(0, auto) minmax(0, auto);
    gap: 2rem;
    max-width: 100%;
    margin: 0 auto;
    justify-content: center;
    align-content: center;
}

.mindmap-line-v {
    grid-column: 2;
    grid-row: 1 / 4;
    width: 4px;
    background-color: var(--brand);
    justify-self: center;
    z-index: 0;
    border-radius: 10px;
}

.mindmap-line-h {
    grid-column: 1 / 4;
    grid-row: 2;
    height: 4px;
    background-color: var(--brand);
    align-self: center;
    z-index: 0;
    border-radius: 10px;
}

@media (max-width: 768px) {
    .mindmap-grid {
        gap: 0.75rem;
        font-size: 0.85rem;
    }

    .mindmap-grid .p-3,
    .mindmap-grid .p-4 {
        padding: 0.75rem !important;
    }

    .mindmap-grid .fs-5 {
        font-size: 1rem !important;
    }
}

/* Animations */
@keyframes pulse-recording {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }

    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 15px rgba(220, 53, 69, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

.pulse-recording {
    animation: pulse-recording 1.5s infinite;
}

/* Floating Progress Dock */
.floating-dock {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 100px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 1040;
    max-width: 95vw;
}

.progress-dot {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 600;
    font-size: 0.85rem;
    color: #6c757d;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    text-decoration: none;
    transition: all 0.2s;
}

.progress-dot:hover {
    background: #e9ecef;
    color: #212529;
}

.progress-dot.completed {
    background: #198754;
    color: #fff;
    border-color: #198754;
}

.progress-dot.active-focus {
    box-shadow: 0 0 0 3px hsla(var(--brand-hsl), 0.25);
    border-color: var(--brand);
}

.glow-btn {
    box-shadow: 0 0 15px hsla(var(--brand-hsl), 0.4);
    animation: glow-pulse 2s infinite;
}

@keyframes glow-pulse {
    0% {
        box-shadow: 0 0 10px hsla(var(--brand-hsl), 0.4);
    }

    50% {
        box-shadow: 0 0 20px hsla(var(--brand-hsl), 0.7);
    }

    100% {
        box-shadow: 0 0 10px hsla(var(--brand-hsl), 0.4);
    }
}

@media (max-width: 768px) {
    .floating-dock {
        border-radius: 1rem;
        bottom: 0;
        width: 100%;
        max-width: 100%;
        padding: 0.75rem;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        justify-content: space-between;
    }

    .dock-scrollable {
        display: flex;
        overflow-x: auto;
        gap: 0.5rem;
        padding-bottom: 0.25rem;
        scrollbar-width: none;
    }

    .dock-scrollable::-webkit-scrollbar {
        display: none;
    }
}

/* Custom Audio Player */
.mc-audio-player {
    display: flex;
    align-items: center;
    background-color: #a855f7;
    border: 1px solid #9333ea;
    border-radius: 50rem;
    padding: 0.5rem 1rem;
    gap: 1rem;
    width: 100%;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.15);
}

.mc-audio-player .mc-play {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    transition: all 0.2s;
}

.mc-audio-player .mc-play:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.mc-audio-player .mc-play.disabled {
    background-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    cursor: not-allowed;
    transform: none;
}

.mc-audio-player .mc-currenttime,
.mc-audio-player .mc-duration {
    font-family: var(--bs-font-monospace);
    font-size: 0.9rem;
    color: white;
    min-width: 50px;
    text-align: center;
}

.mc-audio-player .mc-progress-bar {
    flex-grow: 1;
    height: 8px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.mc-audio-player .mc-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background-color: white;
    width: 0%;
    border-radius: 4px;
    transition: width 0.1s linear;
}

/* Writing Letter Style */
.letter {
    border: 2px solid var(--brand) !important;
    background-color: var(--brand-light);
    border-radius: 0.75rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.05);
    font-size: 1.05rem;
}

/* Exam Progress Part Style */
.progress-part {
    transition: all 0.3s ease;
}

.progress-part.active {
    background-color: #ffc107 !important;
    color: #212529 !important;
    border-color: #ffc107 !important;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* ---------------------------------------------------
   3. APP TOPBAR & SEARCH BAR STYLES
----------------------------------------------------- */
.app-topbar {
    background-color: #ffffff;
    border-bottom: 1px solid #edf2f9;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.search-input-group {
    max-width: 380px;
    width: 100%;
}

.search-input-group .input-group {
    background-color: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 50rem;
    padding: 0.1rem 0.5rem 0.1rem 0.75rem;
    transition: all 0.2s ease-in-out;
}

.search-input-group .input-group:focus-within {
    background-color: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
}

.search-input-group .input-group-text {
    background: transparent !important;
    border: none !important;
    color: #6b7280;
    padding-right: 0.35rem;
    padding-left: 0.25rem;
}

.search-input-group:focus-within .input-group-text {
    color: #2563eb;
}

.search-input-group .form-control {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    font-size: 0.875rem;
    padding-left: 0.25rem;
}

.user-profile-pill {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 50rem;
    padding: 0.35rem 0.85rem 0.35rem 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.user-profile-pill::after {
    display: none !important;
}

.user-profile-pill:hover {
    border-color: #cbd5e1;
    background-color: #f8fafc;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

.user-avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #e0f2fe;
    color: #0284c7;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Live Search Dropdown Styling */
.search-dropdown-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 380px;
    max-height: 420px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    z-index: 1060;
    padding: 0.5rem 0;
}

.search-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    color: #1e293b;
    text-decoration: none;
    transition: background 0.15s ease;
}

.search-result-item:hover {
    background-color: var(--brand-light);
    color: var(--brand);
}

/* =============================================================================
   PRACTICE FOOTER TOOLBAR & QUESTION DOTS STYLING
   ============================================================================= */
.footer-question-dots {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 4px 2px !important;
    scroll-behavior: smooth !important;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 767.98px) {
    .footer-question-dots {
        overflow-x: auto !important;
        flex-wrap: nowrap !important;
        max-width: 190px !important;
    }
}

@media (min-width: 768px) {
    .footer-question-dots {
        overflow: visible !important;
        flex-wrap: wrap !important;
        max-width: 100% !important;
    }
}

.footer-question-dots::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

.footer-progress-dot {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    flex: 0 0 32px !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: 700 !important;
    font-size: 0.85rem !important;
    color: #4b5563 !important;
    background-color: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
    box-sizing: border-box !important;
    line-height: 1 !important;
}

.footer-progress-dot:hover,
.footer-progress-dot:focus {
    background-color: var(--brand-light) !important;
    color: var(--brand) !important;
    border-color: var(--brand) !important;
    text-decoration: none !important;
}

.footer-progress-dot.completed {
    background-color: var(--brand) !important;
    color: #ffffff !important;
    border-color: var(--brand) !important;
}

.footer-progress-dot.correct {
    background-color: #198754 !important;
    color: #ffffff !important;
    border-color: #198754 !important;
}

.footer-progress-dot.wrong {
    background-color: #dc3545 !important;
    color: #ffffff !important;
    border-color: #dc3545 !important;
}

.footer-progress-dot.unanswered {
    background-color: #6c757d !important;
    color: #ffffff !important;
    border-color: #6c757d !important;
}

.footer-progress-dot.active-focus {
    outline: 2px solid var(--brand) !important;
    outline-offset: 1px !important;
}

/* ---------------------------------------------------
   3. PRACTICE MODULE STYLES (Cards, Workspace, Mindmaps)
----------------------------------------------------- */

/* Skill Hub & Skill List Cards */
.skill-hub-card {
    border-radius: 1.25rem !important;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.skill-hub-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.08) !important;
    border-color: var(--brand) !important;
}

.practice-card {
    border-radius: 1rem !important;
    border: 1px solid #e2e8f0;
    transition: all 0.25s ease;
    background: #ffffff;
}

.practice-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08) !important;
    border-color: var(--brand) !important;
}

.practice-card.is-vip-card {
    background: linear-gradient(180deg, #fffdf5 0%, #ffffff 100%);
    border-color: #fde047;
}

.icon-shape {
    width: 56px;
    height: 56px;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
}

.status-box {
    background-color: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
}

/* Practice Workspace Split & Single Containers (Reading, Listening, Writing, Speaking) */
@media (min-width: 768px) {

    body.has-workspace,
    body:has(.reading-split-container),
    body:has(.writing-single-container),
    body:has(.speaking-single-container),
    body:has(.listening-single-container) {
        overflow: hidden !important;
        height: 100vh !important;
        margin: 0 !important;
        padding: 0 !important;
        background-color: #f8fafc !important;
    }

    .reading-split-container,
    .writing-single-container,
    .speaking-single-container,
    .listening-single-container {
        height: calc(100vh - 105px) !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        padding-top: 0.75rem !important;
        padding-bottom: 0.5rem !important;
        overflow: hidden !important;
    }

    .writing-single-container,
    .speaking-single-container,
    .listening-single-container {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    body.focus-mode .reading-split-container,
    body.focus-mode .writing-single-container,
    body.focus-mode .speaking-single-container,
    body.focus-mode .listening-single-container {
        height: 100vh !important;
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }

    body.focus-mode .writing-single-container,
    body.focus-mode .speaking-single-container,
    body.focus-mode .listening-single-container {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    .reading-panel-scroll,
    .writing-panel-scroll,
    .speaking-panel-scroll,
    .listening-panel-scroll {
        height: 100% !important;
        overflow-y: auto !important;
        scrollbar-gutter: stable;
    }

    .writing-panel-scroll,
    .speaking-panel-scroll,
    .listening-panel-scroll {
        padding-top: 0.75rem !important;
        padding-bottom: 2rem !important;
        padding-right: 0.5rem !important;
    }
}

@media (max-width: 767.98px) {
    body {
        background-color: #f8fafc !important;
    }

    .sticky-top {
        position: sticky !important;
        top: 0 !important;
        z-index: 1040 !important;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05) !important;
    }

    .reading-split-container {
        height: calc(100vh - 120px) !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
        margin-top: 0.5rem !important;
        margin-bottom: 3.5rem !important;
        padding-top: 0.25rem !important;
        padding-bottom: 0.25rem !important;
    }

    .writing-single-container,
    .speaking-single-container,
    .listening-single-container {
        padding-top: 1.25rem !important;
        padding-bottom: 6.5rem !important;
        margin-top: 0.75rem !important;
    }

    .writing-panel-scroll,
    .speaking-panel-scroll,
    .listening-panel-scroll {
        padding-top: 0.75rem !important;
        padding-bottom: 3.5rem !important;
    }

    .reading-split-container.review-mode {
        height: calc(100vh - 105px) !important;
        margin-bottom: 0 !important;
    }

    .mobile-passage-col {
        height: 42vh !important;
        overflow-y: auto !important;
        padding-bottom: 0.5rem !important;
    }

    .mobile-questions-col {
        flex: 1 !important;
        height: 58vh !important;
        overflow-y: auto !important;
        padding-top: 0.5rem !important;
    }
}

/* Hide header and footer completely in focus mode so sticky-top takes zero height */
body.focus-mode .sticky-top,
body.focus-mode .fixed-bottom {
    display: none !important;
}

/* Offcanvas Transcript & Translation modals */
#offcanvasTranscript,
#offcanvasTranslation {
    width: 850px !important;
    max-width: 92vw !important;
}

/* Scrollbar styling for practice panels */
.reading-panel-scroll::-webkit-scrollbar,
.writing-panel-scroll::-webkit-scrollbar,
.speaking-panel-scroll::-webkit-scrollbar,
.listening-panel-scroll::-webkit-scrollbar,
.mobile-passage-col::-webkit-scrollbar,
.mobile-questions-col::-webkit-scrollbar {
    width: 6px;
}

.reading-panel-scroll::-webkit-scrollbar-track,
.writing-panel-scroll::-webkit-scrollbar-track,
.speaking-panel-scroll::-webkit-scrollbar-track,
.listening-panel-scroll::-webkit-scrollbar-track,
.mobile-passage-col::-webkit-scrollbar-track,
.mobile-questions-col::-webkit-scrollbar-track {
    background: transparent;
}

.reading-panel-scroll::-webkit-scrollbar-thumb,
.writing-panel-scroll::-webkit-scrollbar-thumb,
.speaking-panel-scroll::-webkit-scrollbar-thumb,
.listening-panel-scroll::-webkit-scrollbar-thumb,
.mobile-passage-col::-webkit-scrollbar-thumb,
.mobile-questions-col::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.reading-panel-scroll::-webkit-scrollbar-thumb:hover,
.writing-panel-scroll::-webkit-scrollbar-thumb:hover,
.speaking-panel-scroll::-webkit-scrollbar-thumb:hover,
.listening-panel-scroll::-webkit-scrollbar-thumb:hover,
.mobile-passage-col::-webkit-scrollbar-thumb:hover,
.mobile-questions-col::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Floating Exit Focus Button */
#btnFloatingExitFocus {
    opacity: 0.75;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

#btnFloatingExitFocus:hover {
    opacity: 1;
    transform: scale(1.03);
}

/* Footer Question Dots Responsive Scroll */
.footer-question-dots {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 4px;
    scroll-behavior: smooth;
}

@media (max-width: 767.98px) {
    .footer-question-dots {
        overflow-x: auto;
        flex-wrap: nowrap !important;
        max-width: 220px;
    }
}

/* Listening Choice Card */
.choice-card-label:hover {
    border-color: var(--brand) !important;
    background-color: var(--brand-light) !important;
    box-shadow: none !important;
    transform: none !important;
}

/* Speaking Mindmap Grid Nodes */
.mindmap-node-top {
    grid-column: 2;
    grid-row: 1;
    z-index: 1;
    place-self: center;
    border-color: var(--brand) !important;
}

.mindmap-node-left {
    grid-column: 1;
    grid-row: 2;
    z-index: 1;
    place-self: center;
    border-color: var(--brand) !important;
}

.mindmap-node-center {
    grid-column: 2;
    grid-row: 2;
    z-index: 1;
    place-self: center;
    background-color: var(--brand) !important;
    border-color: var(--brand) !important;
}

.mindmap-node-right {
    grid-column: 3;
    grid-row: 2;
    z-index: 1;
    place-self: center;
    border-color: var(--brand) !important;
}

.mindmap-node-bottom {
    grid-column: 2;
    grid-row: 3;
    z-index: 1;
    place-self: center;
    border-color: var(--brand) !important;
}

/* ---------------------------------------------------
   4. EXAM MODULE & CERTIFICATE STYLES
----------------------------------------------------- */

/* Exam Review Floating Dock & Active Part Buttons */
.floating-dock {
    z-index: 1020;
}

.part-btn.active {
    background-color: var(--bs-primary);
    color: #fff;
    border-color: var(--bs-primary);
}

.btn-outline-success.part-btn.active {
    background-color: var(--bs-success);
    border-color: var(--bs-success);
}

.btn-outline-warning.part-btn.active {
    background-color: var(--bs-warning);
    border-color: var(--bs-warning);
    color: #000;
}

.btn-outline-info.part-btn.active {
    background-color: var(--bs-info);
    border-color: var(--bs-info);
    color: #000;
}

/* Certificate Card Styles (Shared Result) */
.cert-card {
    background: #fff;
    border: none;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    position: relative;
}

.cert-header {
    background: var(--brand);
    padding: 2rem 2.25rem;
    color: #ffffff;
    position: relative;
}

.cert-logo {
    width: 48px;
    height: 48px;
    background: #ffffff;
    border-radius: 14px;
    padding: 6px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 1;
    object-fit: contain;
}

.cert-title {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: 2px;
    margin-bottom: 0.35rem;
    position: relative;
    z-index: 1;
}

.cert-subtitle {
    font-size: 0.95rem;
    opacity: 0.92;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    position: relative;
    z-index: 1;
}

.score-card {
    background: #f8f9fa;
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid #edf2f6;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.score-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

.score-icon {
    width: 44px;
    height: 44px;
    border-radius: 50% !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.final-score-box {
    background: #fff;
    color: #212529;
    border: 2px solid var(--brand);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 15px 35px rgba(249, 115, 22, 0.12);
}

@media print {
    body {
        background: #fff !important;
    }

    .d-print-none {
        display: none !important;
    }

    .cert-card {
        box-shadow: none !important;
        border: 1px solid #dee2e6;
    }

    .cert-header {
        background: #f8f9fa !important;
        color: #212529 !important;
        padding: 2rem !important;
        border-bottom: 2px solid var(--bs-primary);
    }

    .cert-header::after {
        display: none;
    }

    .cert-title {
        color: var(--bs-primary) !important;
    }

    .cert-subtitle {
        color: #6c757d !important;
    }

    .final-score-box {
        background: #fff !important;
        color: #212529 !important;
        border: 2px solid var(--bs-primary) !important;
        box-shadow: none !important;
    }

    .final-score-box .text-muted {
        color: #6c757d !important;
    }

    .score-card {
        border-color: #dee2e6 !important;
    }

    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}

/* ---------------------------------------------------
   5. PAGINATION & UTILITIES
----------------------------------------------------- */
.pagination-brand .page-item .page-link {
    color: #4b5563;
    background-color: #ffffff;
    border-color: #edf2f9;
}

.pagination-brand .page-item:not(.active) .page-link:hover {
    background-color: var(--brand-light) !important;
    color: var(--brand) !important;
    border-color: var(--brand-light) !important;
}

.pagination-brand .page-item.active .page-link {
    background-color: var(--brand) !important;
    border-color: var(--brand) !important;
    color: #ffffff !important;
    font-weight: 700;
}

/* Toast container positioning & typography */
.app-toast-container {
    z-index: 1090;
}

.toast-body-custom {
    font-size: 15px;
}

/* Exam workspace fixed top toolbar */
.subnavbar-main {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 1030 !important;
    background-color: #f8f9fa !important;
}

body:has(.subnavbar-main) .exam-content {
    padding-top: 64px !important;
}

/* Compact Avatar inside Exam Subnavbar */
.subnavbar-main .avatar {
    width: 35px !important;
    height: 35px !important;
    min-width: 35px !important;
    min-height: 35px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.subnavbar-main .avatar-img {
    width: 35px !important;
    height: 35px !important;
    max-width: 35px !important;
    max-height: 35px !important;
    object-fit: cover !important;
}