/* ==========================================================================
   EXAM RUNNERS - MASTER STYLESHEET (PSYCHOLOGICAL NAVIGATION SYSTEM)
   Theme: Duality Contrast (Warm Paper Workspace & Charcoal Cocoa Sidebar)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. DESIGN TOKENS & SYSTEM VARIABLES
   -------------------------------------------------------------------------- */
:root {
    /* Fonts */
    --font-heading: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-body: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    /* Duality Contrast Brand Colors */
    --bg-main: #F5F4F1;          /* Warm Paper for main workspace */
    --bg-sidebar: #161412;       /* Charcoal Cocoa for sidebar (softened from #13110f) */
    --bg-sidebar-gradient: linear-gradient(180deg, #181614 0%, #110f0d 100%);
    --bg-card: #ffffff;          /* Solid white card body */
    --border-color: rgba(143, 130, 117, 0.14); /* Refined warm border instead of pure black */
    --border-hover: rgba(230, 92, 0, 0.4);  /* Amber Highlight border */
    
    /* Semantic Logic Tokens (Ref: UI Design System) */
    --color-commitment: #e65c00;   /* Primary Action/Submit - Flame Amber */
    --color-commitment-hover: #cc5200;
    --color-commitment-light: #ff8f00;
    --color-interactive: #0284c7;  /* Interactive sliders/widgets - Scholarly Blue */
    --color-interactive-hover: #0271ab;
    --color-validation: #15803d;   /* Success/Correct - Forest Green */
    --color-validation-light: #15803d; /* Unified success color */
    --color-discovery: #b45309;    /* Discovery/Explainers/Tips - Warm Earth Yellow */
    --color-danger: #d32f2f;       /* Error/Incorrect - Crisp Red */
    --color-danger-light: rgba(211, 47, 47, 0.1);

    /* Typography Color Contrast (Checked for WCAG AA compliance) */
    --text-primary: #1c1917;       /* Dark charcoal for high readability on light bg */
    --text-secondary: #44403c;     /* Muted secondary text */
    --text-tertiary: #5c5752;      /* Increased contrast from #78716c to achieve 4.5:1+ */
    --text-sidebar: #faf8f6;       /* Off-white for sidebar text */
    --text-sidebar-secondary: #c9bfb5;
    --text-sidebar-tertiary: #a1958a; /* Increased contrast from #8f8275 for better readability */

    /* Typography Scale */
    --text-xs: 11px;
    --text-sm: 13px;
    --text-base: 15px;
    --text-md: 18px;
    --text-lg: 20px;
    --text-xl: 24px;
    --text-xxl: 28px;
    --text-3xl: 36px;

    /* Decisive Border Radii */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-round: 50%;

    /* Premium Effects (Solid shadows instead of glowing glass) */
    --shadow-soft: 0 4px 20px rgba(28, 25, 23, 0.04), 0 2px 6px rgba(28, 25, 23, 0.03);
    --shadow-card: 0 6px 16px rgba(28, 25, 23, 0.03), 0 1px 3px rgba(28, 25, 23, 0.02);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
    --shadow-glow-amber: 0 4px 14px rgba(230, 92, 0, 0.2);
    --shadow-glow-cyan: 0 4px 14px rgba(2, 132, 199, 0.2);
    --shadow-glow-green: 0 4px 14px rgba(21, 128, 61, 0.2);
    --glass-blur: blur(0px); /* Disabled */
    --glass-backdrop: none;
    
    /* Flow Transition Speeds */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --------------------------------------------------------------------------
   2. SYSTEM BASELINE RESETS
   -------------------------------------------------------------------------- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    overflow-x: hidden;
    height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    letter-spacing: -0.02em;
    color: var(--text-primary);
    line-height: 1.25;
}

h1 {
    font-size: var(--text-3xl);
    font-weight: 800;
    letter-spacing: -0.03em;
}

h2 {
    font-size: var(--text-xxl);
    font-weight: 800;
}

h3 {
    font-size: var(--text-lg);
    font-weight: 700;
}

h4 {
    font-size: var(--text-md);
    font-weight: 700;
}

h5 {
    font-size: var(--text-base);
    font-weight: 600;
}

h6 {
    font-size: var(--text-sm);
    font-weight: 600;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    background: none;
    border: none;
    outline: none;
}

button {
    cursor: pointer;
    user-select: none;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Scrollbar customizations */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: rgba(143, 130, 117, 0.2);
    border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 111, 0, 0.4);
}

/* --------------------------------------------------------------------------
   3. APP MASTER LAYOUT (SIDEBAR & VIEWPORT)
   -------------------------------------------------------------------------- */
.app-container {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar Layout */
.sidebar {
    width: 280px;
    background: var(--bg-sidebar-gradient);
    border-right: 1px solid rgba(230, 92, 0, 0.15); /* Warm flame amber accent divider */
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 100;
    transition: width var(--transition-normal);
    overflow: hidden;
    
    /* Duality Contrast overrides */
    --text-primary: var(--text-sidebar);
    --text-secondary: var(--text-sidebar-secondary);
    --text-tertiary: var(--text-sidebar-tertiary);
    --border-color: rgba(255, 255, 255, 0.06);
}

/* ---- Sidebar Collapsed State ---- */
.sidebar.collapsed {
    width: 72px;
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed .logo-sub,
.sidebar.collapsed .role-selector-container,
.sidebar.collapsed .nav-group-title,
.sidebar.collapsed .nav-link-label,
.sidebar.collapsed .user-meta {
    opacity: 0;
    width: 0;
    overflow: hidden;
    pointer-events: none;
    transition: opacity var(--transition-normal), width var(--transition-normal);
}

.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 0;
    width: 44px;
    height: 44px;
    margin: 0 auto 8px auto;
    gap: 0;
}

.sidebar.collapsed .nav-link.active {
    background: rgba(230, 92, 0, 0.2);
    border-radius: var(--radius-round);
}

.sidebar.collapsed .nav-link.active svg {
    color: var(--color-commitment);
}

.sidebar.collapsed .nav-link svg {
    margin: 0;
}

.sidebar.collapsed .sidebar-footer {
    padding: 12px;
    justify-content: center;
}

.sidebar.collapsed .user-avatar-area {
    justify-content: center;
}

.sidebar.collapsed .logo-area {
    justify-content: center;
}

.sidebar.collapsed .logo-icon {
    margin: 0;
}

/* Sidebar Toggle Button (High-contrast circular style) */
.sidebar-toggle-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-round);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-sidebar);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.sidebar-toggle-btn:hover {
    background: var(--color-commitment);
    border-color: var(--color-commitment-hover);
    color: #ffffff;
    transform: scale(1.1);
    box-shadow: var(--shadow-glow-amber);
}

.sidebar-toggle-btn svg {
    width: 16px;
    height: 16px;
    transition: transform var(--transition-normal);
}

.sidebar.collapsed .sidebar-toggle-btn svg {
    transform: rotate(180deg);
}

.sidebar-header {
    padding: 20px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 26px;
    filter: drop-shadow(0 2px 10px rgba(255, 111, 0, 0.5));
}

.logo-text {
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 20px;
    line-height: 0.9;
    letter-spacing: 0.05em;
    background: linear-gradient(135deg, #ff8f00, #ff5722);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-sub {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.45em;
    color: var(--text-secondary);
}

/* Psychological Role Selector */
.role-selector-container {
    padding: 0 16px 20px 16px;
    border-bottom: 1px solid var(--border-color);
}

.role-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
    padding-left: 8px;
}

.custom-dropdown {
    position: relative;
    width: 100%;
}

.dropdown-trigger {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all var(--transition-fast);
}

.dropdown-trigger:hover, .custom-dropdown.open .dropdown-trigger {
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.05);
}

.dropdown-trigger .role-icon {
    font-size: 18px;
    margin-right: 10px;
}

.dropdown-trigger .role-name {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--text-primary);
    flex-grow: 1;
    text-align: left;
}

.dropdown-chevron {
    width: 16px;
    height: 16px;
    color: var(--text-tertiary);
    transition: transform var(--transition-normal);
}

.custom-dropdown.open .dropdown-chevron {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    background: #191715;
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    display: none;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
    backdrop-filter: var(--glass-blur);
}

.custom-dropdown.open .dropdown-menu {
    display: flex;
}

.dropdown-item {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background var(--transition-fast);
    cursor: pointer;
}

.dropdown-item:hover {
    background: rgba(255, 111, 0, 0.08);
}

.dropdown-item.active {
    background: rgba(255, 111, 0, 0.12);
}

.dropdown-item .role-icon {
    font-size: 20px;
}

.role-info {
    display: flex;
    flex-direction: column;
}

.role-info .role-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}

.role-info .role-desc {
    font-size: 10px;
    color: var(--text-tertiary);
}

/* Sidebar Navigation Links */
.sidebar-nav {
    flex-grow: 1;
    padding: 20px 12px;
    overflow-y: auto;
}

.nav-group-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-tertiary);
    margin: 16px 0 8px 12px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 4px;
    transition: all var(--transition-fast);
    opacity: 0.85;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    transform: translateX(4px);
    opacity: 1;
}

.nav-link.active {
    background: linear-gradient(90deg, rgba(230, 92, 0, 0.18) 0%, rgba(230, 92, 0, 0.04) 100%);
    color: #ffffff;
    font-weight: 600;
    border-left: 4px solid var(--color-commitment);
    box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.05);
    opacity: 1;
}

.nav-link-subtitle {
    font-size: 10px;
    color: var(--text-sidebar-tertiary);
    transition: color var(--transition-fast);
}

.nav-link:hover .nav-link-subtitle,
.nav-link.active .nav-link-subtitle {
    color: var(--text-sidebar-secondary);
}

.nav-link svg {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.nav-link:hover svg, .nav-link.active svg {
    color: var(--color-commitment);
}

/* User Profile Sidebar Footer */
.sidebar-footer {
    padding: 16px;
    background: rgba(0, 0, 0, 0.15);
    border-top: 1px solid var(--border-color);
}

.user-avatar-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-round);
    background: linear-gradient(135deg, var(--color-commitment), #ffc107);
    color: var(--bg-main);
    font-family: var(--font-heading);
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    box-shadow: 0 4px 10px rgba(255, 111, 0, 0.25);
}

.user-meta {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}

.user-role-badge {
    font-size: 10px;
    color: var(--color-discovery);
    font-weight: 500;
}

/* --------------------------------------------------------------------------
   4. MAIN WORKSPACE HEADER & CONTAINER
   -------------------------------------------------------------------------- */
.main-content {
    flex-grow: 1;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Top App Header */
/* Top App Header */
.app-header {
    /* Removed fixed height to allow padding to dictate vertical space */
    padding: 32px 32px 24px 32px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: flex-start; /* Dóng theo đỉnh Title nếu Widget cao, hoặc center nếu thấp. Để flex-start cho thoáng */
    justify-content: space-between;
    background: rgba(245, 244, 241, 0.95);
    backdrop-filter: var(--glass-blur);
    z-index: 90;
}

.header-left {
    display: flex;
    flex-direction: column;
}

.page-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 8px; /* Khoảng cách chuẩn giữa Title và Subtitle */
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-secondary); /* Đủ tương phản, không quá mờ như tertiary */
    font-weight: 400;
    line-height: 1.5;
    margin: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 2px; /* Cân bằng quang học với font Title */
}

.header-stat-badge {
    background: #F2F2F7; /* Secondary-Fill theo chuẩn */
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05); /* Bóng tĩnh nhẹ thay vì inset shadow mờ */
}

.badge-icon {
    font-size: 16px;
}

.badge-value {
    font-family: var(--font-heading);
    font-weight: 600; /* Medium/Semi-bold */
    font-size: 14px;
    color: var(--text-primary);
}

/* Animated streak flame */
.animated-flame {
    animation: flicker 1.5s infinite alternate;
    display: inline-block;
    transform-origin: center bottom;
}

@keyframes flicker {
    0% { transform: scale(1) rotate(-2deg); opacity: 0.9; }
    50% { transform: scale(1.1) rotate(2deg); opacity: 1; filter: drop-shadow(0 0 4px #ff5722); }
    100% { transform: scale(0.95) rotate(-1deg); opacity: 0.85; }
}

/* XP progress bar */
.xp-progress-bar-container {
    width: 80px;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.xp-progress-fill {
    height: 100%;
    background: linear-gradient(to right, #ffc107, #ff9800);
    border-radius: var(--radius-sm);
    box-shadow: 0 0 8px rgba(255, 193, 7, 0.5);
    transition: width var(--transition-slow);
}

/* Workspace main view frame */
.workspace-viewport {
    flex-grow: 1;
    overflow-y: auto;
    padding: 32px;
    position: relative;
    background: radial-gradient(circle at 80% 20%, rgba(255, 111, 0, 0.03) 0%, transparent 50%),
                radial-gradient(circle at 10% 90%, rgba(0, 176, 255, 0.03) 0%, transparent 50%);
}

/* --------------------------------------------------------------------------
   5. COMPONENT DESIGNS & STYLES (GLASS CARDS, BUTTONS)
   -------------------------------------------------------------------------- */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 28px;
    transition: border-color var(--transition-normal), box-shadow var(--transition-normal), transform var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.glass-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-soft);
    transform: translateY(-2px);
}

/* Card Accent Borders to offset dark sidebar weight */
.glass-card.primary-accent { border-top: 4px solid var(--color-commitment); }
.glass-card.interactive-accent { border-top: 4px solid var(--color-interactive); }
.glass-card.validation-accent { border-top: 4px solid var(--color-validation-light); }
.glass-card.discovery-accent { border-top: 4px solid var(--color-discovery); }
.glass-card.danger-accent { border-top: 4px solid var(--color-danger); }

/* Universal Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 14px;
    transition: all var(--transition-fast);
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-commitment), #ff8f00);
    color: var(--bg-main);
    box-shadow: var(--shadow-glow-amber);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 111, 0, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.btn-secondary:active {
    transform: translateY(0);
}

.btn-interactive {
    background: linear-gradient(135deg, var(--color-interactive), #00e5ff);
    color: var(--bg-main);
    box-shadow: var(--shadow-glow-cyan);
}

.btn-interactive:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 176, 255, 0.4);
}

.btn-danger {
    background: var(--color-danger);
    color: #fff;
}

.btn-danger:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

.btn:disabled, .btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Tooltip standard */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -32px;
    left: 50%;
    transform: translateX(-50%) scale(0.85);
    background: #25221f;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 11px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition-fast);
    z-index: 100;
}

.tooltip:hover::after {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

/* Global Segmented Tabs (B4 Standard) */
.segmented-tabs-container {
    display: inline-flex;
    background: rgba(0, 0, 0, 0.04);
    padding: 4px;
    border-radius: 30px;
    border: 1px solid var(--border-color);
    margin-bottom: 28px; /* Khoảng cách với nội dung bên dưới */
}

.segmented-tab-btn {
    background: transparent;
    border: none;
    padding: 10px 24px;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    border-radius: 26px;
    cursor: pointer;
    transition: all var(--transition-fast) ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.segmented-tab-btn:hover {
    color: var(--text-primary);
}

.segmented-tab-btn.active {
    background: #FFFFFF;
    color: var(--color-interactive);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* --------------------------------------------------------------------------
   6. FRONTEND PAGES - STUDENT SPACE
   -------------------------------------------------------------------------- */

/* A. Student Dashboard Page */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.dashboard-left, .dashboard-right {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Big Hero Banner */
.hero-banner-card {
    background: linear-gradient(135deg, rgba(255, 111, 0, 0.15) 0%, rgba(255, 193, 7, 0.02) 100%);
    border: 1px solid rgba(255, 111, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.hero-banner-card::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    border-radius: var(--radius-round);
    background: var(--color-commitment);
    filter: blur(80px);
    opacity: 0.15;
}

.banner-content {
    max-width: 80%;
}

.banner-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
}

.banner-desc {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
}

/* Mini Cards Row */
.stats-cards-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.stat-mini-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(255, 255, 255, 0.02);
}

.stat-icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon-wrapper.orange { background: rgba(255, 111, 0, 0.1); color: var(--color-commitment); }
.stat-icon-wrapper.cyan { background: rgba(0, 176, 255, 0.1); color: var(--color-interactive); }
.stat-icon-wrapper.green { background: rgba(46, 125, 50, 0.1); color: var(--color-validation-light); }

.stat-label {
    font-size: 11px;
    color: var(--text-tertiary);
    font-weight: 600;
}

.stat-number {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
}

/* Task checklist board */
.checklist-card {
    flex-grow: 1;
}

.card-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.task-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-radius: var(--radius-md);
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.task-item:hover {
    background: var(--bg-card);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-sm);
}

.task-meta-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.checkbox-custom {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 2px solid var(--text-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.checkbox-custom svg {
    width: 14px;
    height: 14px;
    color: transparent;
}

.task-item.completed .checkbox-custom {
    background: var(--color-validation);
    border-color: var(--color-validation);
}

.task-item.completed .checkbox-custom svg {
    color: #ffffff;
}

.task-info-block {
    display: flex;
    flex-direction: column;
}

.task-title {
    font-weight: 600;
    font-size: 14px;
}

.task-item.completed .task-title {
    text-decoration: line-through;
    color: var(--text-tertiary);
}

.task-details {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 4px;
}

.task-tag {
    background: rgba(0, 0, 0, 0.04);
    border-radius: 4px;
    padding: 1px 6px;
}



/* Countdown widgets right side */
.countdown-box {
    text-align: center;
}

.countdown-digits {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 20px 0;
}

.time-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 12px 8px;
    min-width: 60px;
    border: 1px solid var(--border-color);
}

.time-number {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 900;
    color: var(--color-interactive);
}

.time-label {
    font-size: 9px;
    color: var(--text-tertiary);
    text-transform: uppercase;
}

/* Streak calendar right side */
.streak-board {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.streak-row {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}

.streak-day-dot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.streak-circle {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-round);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all var(--transition-fast);
}

.streak-day-dot.active .streak-circle {
    background: linear-gradient(135deg, var(--color-commitment), #ff8f00);
    border-color: var(--color-commitment);
    color: var(--bg-main);
    box-shadow: 0 4px 10px rgba(255, 111, 0, 0.3);
}

.day-initial {
    font-size: 10px;
    color: var(--text-tertiary);
    font-weight: 600;
}

/* B. Interactive Skill Map Page */
.skillmap-outer {
    width: 100%;
    height: 580px;
    position: relative;
    border-radius: var(--radius-lg);
    background: radial-gradient(circle at center, #1b1815 0%, #0c0b0a 100%);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.skillmap-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* SVG graph styling */
.skillmap-edge {
    stroke: rgba(255, 143, 0, 0.15);
    stroke-width: 2px;
    stroke-dasharray: 6 4;
    animation: dash-flow 30s linear infinite;
}

.skillmap-edge.active {
    stroke: rgba(0, 176, 255, 0.35);
    stroke-width: 3px;
}

@keyframes dash-flow {
    to { stroke-dashoffset: -100; }
}

.skillmap-node {
    cursor: pointer;
    transition: all var(--transition-normal);
}

.skillmap-node circle {
    fill: #191715;
    stroke: var(--text-tertiary);
    stroke-width: 3px;
    transition: all var(--transition-normal);
}

.skillmap-node:hover circle {
    transform: scale(1.15);
    filter: brightness(1.2);
}

/* Mastery status styling on SVG */
.skillmap-node.mastered circle {
    stroke: var(--color-validation-light);
    filter: drop-shadow(0 0 8px rgba(76, 175, 80, 0.6));
}

.skillmap-node.learning circle {
    stroke: var(--color-interactive);
    filter: drop-shadow(0 0 8px rgba(0, 176, 255, 0.6));
}

.skillmap-node.locked circle {
    stroke: #453c35;
    fill: #0c0b0a;
}

.skillmap-node text {
    font-family: var(--font-heading);
    font-weight: 600;
    fill: var(--text-secondary);
    font-size: 12px;
    pointer-events: none;
    transition: fill var(--transition-fast);
}

.skillmap-node:hover text {
    fill: var(--text-primary);
}

/* Mini Explainer Overlay tooltip on Map */
.node-tooltip-card {
    position: absolute;
    bottom: 24px;
    left: 24px;
    width: 320px;
    display: none;
    z-index: 10;
    animation: slide-up 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
    border: 1px solid var(--border-hover);
}

@keyframes slide-up {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.node-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
    margin-bottom: 12px;
}

.node-title {
    font-weight: 800;
    font-size: 16px;
}

.node-mastery-percentage {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--color-interactive);
}

.node-desc {
    color: var(--text-secondary);
    font-size: 12px;
    margin-bottom: 16px;
}

.node-quick-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 16px;
    font-size: 11px;
    color: var(--text-tertiary);
}

/* C. Phòng thi Online Page (Practice Room) */
.exam-list-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

@media (max-width: 768px) {
    .exam-list-container {
        grid-template-columns: 1fr;
    }
}



.exam-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 260px;
    height: auto;
}

.exam-badge-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.exam-title {
    font-size: 18px;
    font-weight: 800;
    margin: 12px 0 6px 0;
}

.exam-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 16px;
}

.exam-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Distraction-Free Active Exam Portal */
.active-exam-portal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-main);
    z-index: 200;
    display: flex;
    flex-direction: column;
    animation: fadeIn var(--transition-normal);
}

.exam-portal-header {
    height: 70px;
    background: rgba(19, 17, 15, 0.95);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
}

.exam-portal-title {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 18px;
}

.exam-header-center {
    display: flex;
    align-items: center;
    gap: 16px;
}

.exam-countdown-clock {
    background: rgba(211, 47, 47, 0.12);
    border: 1px solid rgba(211, 47, 47, 0.3);
    color: var(--color-danger);
    border-radius: var(--radius-md);
    padding: 8px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 15px;
}

/* Dual Split Screen Panel */
.exam-split-workspace {
    flex-grow: 1;
    display: flex;
    overflow: hidden;
}

/* Left side scrollable questions */
.exam-questions-column {
    flex: 8;
    overflow-y: auto;
    padding: 40px;
    border-right: 1px solid var(--border-color);
}

/* District Free Card Mode */
.distraction-free-question-card {
    background: var(--bg-card);
    border: 1px solid var(--border-hover);
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    border-radius: var(--radius-lg);
    padding: 32px;
    max-width: 720px;
    margin: 40px auto;
}

.question-meta-row {
    display: flex;
    justify-content: space-between;
    color: var(--text-tertiary);
    font-size: 12px;
    margin-bottom: 16px;
    font-weight: 600;
}

.question-stem {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 20px;
    line-height: 1.5;
    margin-bottom: 24px;
}

.option-buttons-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-btn {
    width: 100%;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    text-align: left;
    transition: all var(--transition-fast);
}

.option-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateX(4px);
}

.option-letter {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background: var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-right: 12px;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.option-text {
    color: var(--text-secondary);
    font-weight: 500;
    transition: color var(--transition-fast);
}

/* Selected state HSL apple look */
.option-btn.selected {
    background: rgba(0, 176, 255, 0.08);
    border-color: var(--color-interactive);
    box-shadow: var(--shadow-glow-cyan);
}

.option-btn.selected .option-letter {
    background: var(--color-interactive);
    color: var(--bg-main);
}

.option-btn.selected .option-text {
    color: var(--text-primary);
}

/* Exam navigation buttons row */
.exam-navigation-row {
    display: flex;
    justify-content: space-between;
    margin-top: 32px;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

/* Right side navigation grid & Scratchpad column */
.exam-controls-column {
    flex: 2;
    background: #11100f;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 32px 24px;
}

.exam-controls-block {
    margin-bottom: 24px;
}

.control-block-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-tertiary);
    margin-bottom: 12px;
}

/* Grid of questions */
.question-navigation-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.question-grid-node {
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 13px;
    color: var(--text-tertiary);
    transition: all var(--transition-fast);
}

.question-grid-node:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.question-grid-node.answered {
    background: rgba(0, 176, 255, 0.1);
    border-color: var(--color-interactive);
    color: var(--text-primary);
}

.question-grid-node.current {
    border: 2px solid var(--color-commitment) !important;
    color: var(--color-commitment);
}

.question-grid-node.flagged {
    background: rgba(255, 193, 7, 0.1);
    border-color: var(--color-discovery);
    color: var(--text-primary);
}

/* Interactive Scratchpad */
.scratchpad-textarea {
    width: 100%;
    height: 140px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-size: 12px;
    color: var(--text-secondary);
    resize: none;
    transition: border-color var(--transition-normal);
}

.scratchpad-textarea:focus {
    border-color: var(--color-commitment);
}

/* D. Exam Review / Results Page */
.results-header-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.08) 0%, rgba(12, 11, 10, 0.1) 100%);
    border: 1px solid rgba(76, 175, 80, 0.15);
    margin-bottom: 24px;
}

.results-stats-left {
    flex-grow: 1;
}

/* Doughnut SVG Score Indicator */
.score-circle-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
    flex-shrink: 0;
}

.score-svg {
    width: 120px;
    height: 120px;
    transform: rotate(-90deg);
}

.score-svg-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.04);
    stroke-width: 10px;
}

.score-svg-fill {
    fill: none;
    stroke: var(--color-validation-light);
    stroke-width: 10px;
    stroke-dasharray: 345.5; /* 2 * PI * r */
    stroke-dashoffset: 345.5;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    stroke-linecap: round;
}

.score-center-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.score-number {
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 900;
}

.score-label {
    font-size: 9px;
    color: var(--text-tertiary);
    text-transform: uppercase;
}

/* 5-Step Solution Accordions */
.review-questions-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 24px;
}

.review-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}



.review-item-header {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.01);
    user-select: none;
}

.review-item-header:hover {
    background: rgba(255, 255, 255, 0.02);
}

.review-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.review-status-badge {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
}

.review-item.correct .review-status-badge { background: rgba(46, 125, 50, 0.1); color: var(--color-validation-light); }
.review-item.incorrect .review-status-badge { background: rgba(211, 47, 47, 0.1); color: var(--color-danger); }

.review-item-body {
    display: none;
    border-top: 1px solid var(--border-color);
    padding: 24px;
    background: rgba(0,0,0,0.1);
}

.review-item.expanded .review-item-body {
    display: block;
}

.five-step-solution {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px;
}

.solution-step {
    display: flex;
    gap: 16px;
    padding: 16px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.015);
}

.step-number-pill {
    font-family: var(--font-heading);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 2px 8px;
    border-radius: 4px;
    height: 20px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.step-verdict { background: rgba(46, 125, 50, 0.15); color: var(--color-validation-light); }
.step-rule { background: rgba(0, 176, 255, 0.15); color: var(--color-interactive); }
.step-why { background: rgba(255, 255, 255, 0.05); color: var(--text-secondary); }
.step-trap { background: rgba(211, 47, 47, 0.15); color: var(--color-danger); }
.step-tip { background: rgba(255, 193, 7, 0.15); color: var(--color-discovery); }

.step-content {
    font-size: 13px;
    color: var(--text-secondary);
}

.step-content strong {
    color: var(--text-primary);
}

/* E. Flashcard Desk Page (Spaced Repetition & Match Game) */
.flashcards-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.flashcard-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

/* 3D Card Flipper styling */
.flashcard-3d-container {
    perspective: 1000px;
    width: 100%;
    max-width: 480px;
    height: 280px;
    cursor: pointer;
}

.flashcard-flipper {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform var(--transition-slow);
    transform-style: preserve-3d;
}

.flashcard-3d-container.flipped .flashcard-flipper {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-hover);
    box-shadow: 0 15px 50px rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px;
}

.card-face.front {
    z-index: 2;
    transform: rotateY(0deg);
}

.card-face.back {
    transform: rotateY(180deg);
    background: #FFFFFF;
    overflow-y: auto;
    border: 1px solid var(--border-color);
}

.card-front-word {
    font-family: var(--font-heading);
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 8px;
    text-align: center;
}

.card-ipa {
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--color-interactive);
}

.card-back-translation {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--color-commitment);
}

.card-back-example {
    font-size: 13px;
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    border-top: 1px solid #F0F0F0;
    padding-top: 12px;
    margin-top: 12px;
    width: 100%;
    line-height: 1.6;
}

.card-tip-label {
    position: absolute;
    bottom: 16px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
}

/* Swiping animation triggers */
.flashcard-3d-container.swipe-left {
    animation: swipeLeft 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.flashcard-3d-container.swipe-right {
    animation: swipeRight 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes swipeLeft {
    to { transform: translateX(-150px) rotate(-15deg); opacity: 0; }
}
@keyframes swipeRight {
    to { transform: translateX(150px) rotate(15deg); opacity: 0; }
}

/* Learning desk choice buttons */
.learning-action-row {
    display: flex;
    gap: 16px;
}

/* Quick Match Game board styles */
.match-game-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 16px;
}

.match-tile {
    aspect-ratio: 1.5;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.match-tile:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255,255,255,0.15);
}

.match-tile.selected {
    background: rgba(0, 176, 255, 0.1);
    border-color: var(--color-interactive);
    box-shadow: var(--shadow-glow-cyan);
}

.match-tile.matched {
    background: rgba(46, 125, 50, 0.15);
    border-color: var(--color-validation-light);
    color: var(--color-validation-light);
    pointer-events: none;
    transform: scale(0.95);
    opacity: 0.5;
}

.match-tile.mismatched {
    background: rgba(211, 47, 47, 0.15);
    border-color: var(--color-danger);
    animation: shake 0.3s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* F. Thư Viện Ngữ Pháp (Timeline Layout) */
.timeline-path {
    position: relative;
    padding: 40px 0;
}

.timeline-path::before {
    content: '';
    position: absolute;
    left: 40px;
    top: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, var(--color-commitment) 0%, var(--border-color) 100%);
}

.timeline-node-item {
    position: relative;
    margin-bottom: 32px;
    padding-left: 80px;
}

.timeline-bullet {
    position: absolute;
    left: 28px;
    top: 4px;
    width: 26px;
    height: 26px;
    border-radius: var(--radius-round);
    background: #1e1c18;
    border: 3px solid var(--border-color);
    z-index: 2;
    transition: all var(--transition-fast);
}

.timeline-node-item:hover .timeline-bullet {
    background: var(--color-commitment);
    border-color: var(--color-commitment);
    box-shadow: var(--shadow-glow-amber);
}

.timeline-node-item.completed .timeline-bullet {
    background: var(--color-validation);
    border-color: var(--color-validation-light);
}

.timeline-card {
    cursor: pointer;
}

/* --------------------------------------------------------------------------
   7. FRONTEND PAGES - PARENT & TUTOR REPORT
   -------------------------------------------------------------------------- */
.parent-dashboard-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.chart-card {
    height: 320px;
    display: flex;
    flex-direction: column;
}

/* SVG Line Chart dynamic layout */
.svg-chart-container {
    flex-grow: 1;
    width: 100%;
    position: relative;
    margin-top: 16px;
}

.chart-svg {
    width: 100%;
    height: 100%;
}

.chart-line {
    fill: none;
    stroke: var(--color-commitment);
    stroke-width: 3px;
    stroke-linecap: round;
}

.chart-area {
    fill: url(#chart-gradient);
    opacity: 0.15;
}

.chart-grid-line {
    stroke: rgba(255,255,255,0.03);
    stroke-width: 1px;
}

.chart-axis-line {
    stroke: var(--border-color);
    stroke-width: 1px;
}

.chart-marker {
    fill: var(--color-commitment);
    stroke: var(--bg-main);
    stroke-width: 2px;
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.chart-marker:hover {
    transform: scale(1.5);
}

.chart-axis-text {
    fill: var(--text-tertiary);
    font-size: 10px;
}

/* Radar/Insight List details */
.insights-card {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.04) 0%, rgba(12, 11, 10, 0.1) 100%);
    border: 1px solid rgba(255, 193, 7, 0.1);
}

.insight-item {
    display: flex;
    gap: 16px;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.insight-icon-pill {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: rgba(255, 193, 7, 0.1);
    color: var(--color-discovery);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.insight-headline {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
}

.insight-body {
    font-size: 12px;
    color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   8. FRONTEND PAGES - ADMIN DESK
   -------------------------------------------------------------------------- */
.admin-layout-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 24px;
}

.admin-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.admin-questions-table-card {
    padding: 0;
    overflow: hidden;
}

.admin-table-scroll {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.admin-table th, .admin-table td {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
}

.admin-table th {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
    background: rgba(0,0,0,0.1);
}

.admin-table td {
    font-size: 13px;
}

.admin-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.015);
}

.admin-cell-tag {
    font-size: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    padding: 2px 6px;
    margin-right: 4px;
    white-space: nowrap;
}

.admin-cell-action {
    display: flex;
    gap: 12px;
}

/* Form input elements */
.form-group-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.form-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-size: 13px;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.form-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.form-input:focus {
    border-color: var(--color-interactive);
}

/* --------------------------------------------------------------------------
   9. MODALS & GLOBAL OVERLAYS (ACTIVE RECALL)
   -------------------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-overlay.open {
    display: flex;
}

.glass-modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 600px;
    overflow: hidden;
}

.modal-header {
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}

.modal-badge {
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    padding: 4px 10px;
    border-radius: 4px;
}

.modal-badge.warning { background: rgba(255, 193, 7, 0.15); color: var(--color-discovery); }

.close-modal-btn {
    font-size: 24px;
    color: var(--text-tertiary);
    transition: color var(--transition-fast);
}

.close-modal-btn:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 32px 24px;
}

.puzzle-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    text-align: center;
    line-height: 1.4;
}

.puzzle-box {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 20px;
}

.puzzle-prompt {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
}

.puzzle-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.puzzle-opt-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.opt-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    font-weight: 700;
    font-size: 11px;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.puzzle-opt-btn.selected .opt-letter {
    background: var(--color-interactive);
    color: #fff;
}

.puzzle-opt-btn.correct .opt-letter {
    background: var(--color-validation-light);
    color: #fff;
}

.puzzle-opt-btn.incorrect .opt-letter {
    background: var(--color-danger);
    color: #fff;
}

.puzzle-opt-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.puzzle-opt-btn.selected {
    background: rgba(0, 176, 255, 0.1);
    border-color: var(--color-interactive);
    color: var(--text-primary);
}

.puzzle-opt-btn.correct {
    background: rgba(46, 125, 50, 0.15) !important;
    border-color: var(--color-validation-light) !important;
    color: var(--color-validation-light) !important;
}

.puzzle-opt-btn.incorrect {
    background: rgba(211, 47, 47, 0.15) !important;
    border-color: var(--color-danger) !important;
    color: var(--color-danger) !important;
}

.puzzle-feedback {
    min-height: 24px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
}

.puzzle-feedback.success { color: var(--color-validation-light); }
.puzzle-feedback.error { color: var(--color-danger); }

.modal-footer {
    padding: 20px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid var(--border-color);
    background: rgba(0,0,0,0.1);
}

/* Onboarding Step View System */
.onboarding-step-view {
    display: none;
    animation: fadeIn 0.3s ease;
}

.onboarding-step-view.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Confetti Particles Container */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 2000;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #ffd300;
    top: -20px;
    opacity: 0.8;
    animation: confetti-fall 3.5s linear infinite;
}

@keyframes confetti-fall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(105vh) rotate(360deg); opacity: 0; }
}

/* Animations */
.animate-zoom {
    animation: zoomIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes zoomIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

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

/* ==========================================================================
   NEW UPGRADES ADDED BY ANTIGRAVITY (9-NODE MAP, OMR, DIFFS, ONBOARDING)
   ========================================================================== */

/* Word-by-word visual differences */
.diff-added {
    color: var(--color-validation-light) !important;
    background: rgba(46, 125, 50, 0.15) !important;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(46, 125, 50, 0.3);
    font-weight: 600;
}

.diff-removed {
    color: var(--color-danger) !important;
    text-decoration: line-through !important;
    background: rgba(211, 47, 47, 0.15) !important;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(211, 47, 47, 0.3);
}

/* SVG 9-Node Skills Network */
.skillmap-canvas {
    width: 100%;
    height: auto;
    max-height: 500px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.skillmap-edge {
    stroke: rgba(255, 255, 255, 0.05);
    stroke-width: 3px;
    stroke-dasharray: 6 6;
    transition: all var(--transition-normal);
}

.skillmap-edge.active {
    stroke: var(--color-interactive);
    stroke-width: 4px;
    stroke-dasharray: 0;
    filter: drop-shadow(0 0 4px var(--color-interactive));
}

.skillmap-node circle {
    fill: #191715;
    stroke: #3c352f;
    stroke-width: 3px;
    transition: all var(--transition-normal);
    cursor: pointer;
}

.skillmap-node text {
    fill: var(--text-secondary);
    font-weight: 600;
    font-size: 11px;
    pointer-events: none;
    font-family: var(--font-heading);
}

/* Glow styles for nodes based on state */
.skillmap-node.mastered circle {
    stroke: var(--color-validation-light);
    fill: rgba(46, 125, 50, 0.12);
    filter: drop-shadow(0 0 8px rgba(46, 125, 50, 0.4));
}
.skillmap-node.learning circle {
    stroke: var(--color-interactive);
    fill: rgba(0, 176, 255, 0.12);
    filter: drop-shadow(0 0 8px rgba(0, 176, 255, 0.4));
}
.skillmap-node.locked circle {
    stroke: #2e2823;
    fill: #0c0b0a;
}
.skillmap-node:hover circle {
    transform: scale(1.08);
    stroke-width: 4px;
}
.skillmap-node.mastered:hover circle { stroke: #66bb6a; }
.skillmap-node.learning:hover circle { stroke: #33bfff; }

/* Locked Exam Cards & Glass Overlay */
/* Locked Exam Cards & Clean Neutral Badging (No warning red/dark blur) */
.locked-exam-card {
    position: relative;
    background: var(--bg-card);
    border: 1px dashed rgba(143, 130, 117, 0.3) !important;
    transition: opacity var(--transition-fast);
}

.lock-icon-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(92, 87, 82, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
}

.locked-exam-card .exam-title {
    color: var(--text-secondary);
    opacity: 0.75;
}

.locked-exam-card .exam-meta-grid {
    color: var(--text-tertiary);
    opacity: 0.75;
}

.lock-requirement-banner {
    margin-top: 16px;
    padding: 10px 12px;
    background: rgba(92, 87, 82, 0.05);
    border-left: 3px solid var(--text-tertiary);
    border-radius: 4px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.lock-requirement-text {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
    text-align: left;
}

.lock-button-disabled {
    width: 100%;
    margin-top: 16px;
    background: rgba(92, 87, 82, 0.06) !important;
    border-color: transparent !important;
    color: var(--text-tertiary) !important;
    cursor: not-allowed;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-weight: 600;
}

/* OMR Bubble Grid in Practice room */
.omr-bubble {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.omr-bubble:hover {
    border-color: var(--border-hover);
    transform: scale(1.05);
}

.omr-bubble.answered {
    border-color: var(--color-interactive);
    background: rgba(0, 176, 255, 0.12);
    box-shadow: 0 0 10px rgba(0, 176, 255, 0.25);
}

.omr-bubble.flagged {
    border-color: var(--color-discovery);
    background: rgba(255, 193, 7, 0.12);
}

.bubble-num {
    font-size: 10px;
    color: var(--text-secondary);
    line-height: 1;
}

.bubble-letter {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
}

.omr-bubble.answered .bubble-letter {
    color: var(--color-interactive);
}

.omr-bubble.flagged .bubble-letter {
    color: var(--color-discovery);
}

/* Onboarding indicator styles */
.step-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-tertiary);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all var(--transition-fast);
}

.step-dot.active {
    background: rgba(0, 176, 255, 0.15);
    border-color: var(--color-interactive);
    color: var(--color-interactive);
    box-shadow: 0 0 8px rgba(0, 176, 255, 0.3);
}

.ob-score-btn {
    padding: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-weight: 700;
    transition: all var(--transition-fast);
}

.ob-score-btn:hover {
    border-color: var(--border-hover);
    background: rgba(255,255,255,0.05);
}

.ob-score-btn.active {
    border-color: var(--color-interactive);
    background: rgba(0, 176, 255, 0.1);
    color: var(--color-interactive);
}

.ob-commitment-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.ob-commitment-item:hover {
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.05);
}

.ob-commitment-item.active {
    border-color: var(--color-interactive);
    background: rgba(0, 176, 255, 0.1);
}

/* Sliding Theory & Practice Drawer */
.grammar-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 998;
    display: none;
}

.grammar-drawer-overlay.open {
    display: block;
}

.grammar-drawer {
    position: fixed;
    top: 0;
    right: -450px;
    width: 450px;
    height: 100vh;
    background: #13110f;
    border-left: 1px solid var(--border-hover);
    box-shadow: -10px 0 40px rgba(0,0,0,0.8);
    z-index: 999;
    transition: right var(--transition-normal);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.grammar-drawer.open {
    right: 0;
}

.drawer-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.close-drawer-btn {
    font-size: 28px;
    line-height: 1;
    color: var(--text-tertiary);
    transition: color var(--transition-fast);
}

.close-drawer-btn:hover {
    color: var(--text-primary);
}

.drawer-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 24px;
}

/* Print Overrides for Weekly Progress Report */
@media print {
    body {
        background: #fff !important;
        color: #000 !important;
        font-size: 12px;
        height: auto;
        overflow: visible;
    }

    .app-container, .modal-overlay {
        display: none !important;
    }

    #report-modal {
        display: block !important;
        position: static !important;
        background: none !important;
        backdrop-filter: none !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow: visible !important;
        box-shadow: none !important;
        border: none !important;
    }

    .glass-modal {
        background: none !important;
        border: none !important;
        box-shadow: none !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        overflow: visible !important;
    }

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

    .weekly-report-container {
        color: #000 !important;
        background: #fff !important;
    }

    table {
        page-break-inside: avoid;
    }
}

/* Custom Highlight and Underline styling */
u {
    text-decoration: none;
    border-bottom: 2px solid var(--color-interactive);
    font-weight: 700;
}

.user-highlight {
    background-color: rgba(255,235,59,0.4);
    color: #fff;
    padding: 2px 4px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.user-highlight:hover {
    background-color: rgba(255,235,59,0.7);
}

/* ==========================================================================
   E2. FLASHCARD DESK UPGRADES (TOPICS, BULK IMPORT, & VOCABULARY LIST)
   ========================================================================== */

/* Flashcard Tab Navigation */
.flashcard-tabs-row {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 28px;
    gap: 8px;
}

.flashcard-tab-btn {
    background: none;
    border: none;
    padding: 12px 24px;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-tertiary);
    cursor: pointer;
    position: relative;
    transition: all var(--transition-fast) ease;
}

.flashcard-tab-btn:hover {
    color: var(--text-primary);
}

.flashcard-tab-btn.active {
    color: var(--color-interactive);
}

.flashcard-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--color-interactive);
    box-shadow: 0 0 8px var(--color-interactive);
}

/* Topics Grid */
.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

/* --- Content Card (B4 Standard: Cấp 1) --- */
.topic-card {
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 190px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.topic-card:hover {
    border-color: rgba(255, 111, 0, 0.4);
    box-shadow: 0 6px 20px rgba(255, 111, 0, 0.08);
    transform: translateY(-3px);
}

.topic-card-body h3 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.3;
}

.topic-card-body p {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0;
}

.topic-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #F0F0F0;
    padding-top: 14px;
    margin-top: 20px;
}

.topic-count {
    font-size: 11px;
    color: var(--text-tertiary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.topic-study-btn {
    font-size: 12px;
    padding: 7px 14px;
    border-radius: 8px;
    font-weight: 700;
}

/* --- Featured Card (B4 Standard: Cấp 3 - Pinned) --- */
.topic-card--featured {
    border: 2px solid var(--color-commitment);
    box-shadow: 0 2px 10px rgba(255, 111, 0, 0.10);
}

.topic-card--featured:hover {
    border-color: var(--color-commitment);
    box-shadow: 0 8px 24px rgba(255, 111, 0, 0.14);
    transform: translateY(-3px);
}

.topic-card--featured .topic-card-footer {
    border-top-color: rgba(255, 111, 0, 0.12);
}

/* Pronounce Button */
.btn-pronounce {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: var(--radius-round);
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast) ease;
}

.btn-pronounce:hover {
    background: rgba(0, 176, 255, 0.1);
    border-color: var(--color-interactive);
    color: var(--color-interactive);
    box-shadow: 0 0 6px rgba(0, 176, 255, 0.2);
    transform: scale(1.05);
}

/* Word cards in topic detail view */
.word-cards-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.word-card-item {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all var(--transition-fast) ease;
}

.word-card-item:hover {
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.025);
}

.word-card-left {
    display: flex;
    gap: 16px;
    align-items: center;
}

.word-card-info h4 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.word-card-info .word-meta {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 6px;
}

.word-card-info .word-translation {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-discovery-light);
    margin-bottom: 6px;
}

.word-card-info .word-example {
    font-size: 12px;
    color: var(--text-secondary);
    font-style: italic;
}

.word-card-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Live Bulk Preview Table */
.preview-table-container {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-top: 16px;
    margin-bottom: 20px;
    display: none; /* Injected by parser */
}

.preview-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-tertiary);
    background: rgba(255, 255, 255, 0.02);
    padding: 8px 16px;
    border-bottom: 1px solid var(--border-color);
    letter-spacing: 0.1em;
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
}

.preview-table th, .preview-table td {
    padding: 10px 16px;
    font-size: 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

.preview-table th {
    color: var(--text-tertiary);
    background: rgba(0, 0, 0, 0.1);
}

.preview-table td {
    color: var(--text-secondary);
}

.preview-table tr:last-child td {
    border-bottom: none;
}

.preview-table-container.active {
    display: block;
}

/* Quick Form styling */
.vocab-quick-form-card {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 24px;
}

/* ==========================================================================
   INTERACTIVE GRAMMAR LAB STYLES (UPGRADED BY ANTIGRAVITY)
   ========================================================================== */

/* Locked timeline node */
.timeline-node-item.locked {
    opacity: 0.55;
}
.timeline-node-item.locked .timeline-card {
    cursor: not-allowed !important;
    background: rgba(255, 255, 255, 0.6) !important;
    border-color: var(--border-color) !important;
}
.timeline-node-item.locked .timeline-bullet {
    background: #e5e5e5 !important;
    border-color: #d4d4d4 !important;
    box-shadow: none !important;
}

/* Mastery Indicator Circle */
.mastery-circle-wrapper {
    position: relative;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mastery-circle-svg {
    transform: rotate(-90deg);
    width: 44px;
    height: 44px;
}
.mastery-circle-bg {
    fill: none;
    stroke: rgba(255,255,255,0.04);
    stroke-width: 4;
}
.mastery-circle-progress {
    fill: none;
    stroke: var(--color-interactive);
    stroke-width: 4;
    stroke-dasharray: 126;
    stroke-dashoffset: 126;
    transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.timeline-node-item.completed .mastery-circle-progress {
    stroke: var(--color-validation-light);
}
.mastery-percent-text {
    position: absolute;
    font-size: 10px;
    font-weight: 800;
    font-family: var(--font-heading);
    color: var(--text-primary);
}

/* Drawer Tab Switcher */
.drawer-tabs-container {
    display: flex;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 3px;
    margin-bottom: 24px;
    gap: 4px;
}
.drawer-tab-btn {
    flex: 1;
    padding: 10px;
    text-align: center;
    font-size: 12.5px;
    font-weight: 700;
    font-family: var(--font-heading);
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.drawer-tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.02);
}
.drawer-tab-btn.active {
    background: var(--color-commitment);
    color: var(--text-primary);
    box-shadow: var(--shadow-glow-amber);
}

/* Widget Tenses Slider UI */
.tense-widget {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px;
    margin-bottom: 24px;
}
.tense-slider-container {
    position: relative;
    margin: 28px 0 20px 0;
    padding: 0 10px;
}
.tense-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
}
.tense-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--color-interactive);
    cursor: pointer;
    box-shadow: var(--shadow-glow-cyan);
    transition: transform 0.1s ease;
}
.tense-slider::-webkit-slider-thumb:hover {
    transform: scale(1.25);
}
.tense-timeline-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}
.tense-label-btn {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    cursor: pointer;
    background: none;
    border: none;
    transition: color 0.2s;
}
.tense-label-btn.active {
    color: var(--color-interactive);
    font-weight: 800;
}

/* Voice Transformer Switch */
.voice-transformer {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 24px;
}
.transformer-toggle-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}
.transformer-toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
    transition: all var(--transition-fast);
}
.transformer-toggle-btn.active {
    background: rgba(0, 176, 255, 0.15);
    border-color: var(--color-interactive);
    color: var(--color-interactive);
    box-shadow: var(--shadow-glow-cyan);
}
.word-blocks-anim-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 80px;
    justify-content: center;
    align-items: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255,255,255,0.02);
}
.word-block-capsule {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.word-block-capsule.subject {
    background: rgba(255, 111, 0, 0.1);
    border-color: rgba(255, 111, 0, 0.3);
    color: #ff9100;
}
.word-block-capsule.verb {
    background: rgba(0, 176, 255, 0.1);
    border-color: rgba(0, 176, 255, 0.3);
    color: var(--color-interactive);
}
.word-block-capsule.object {
    background: rgba(76, 175, 80, 0.1);
    border-color: rgba(76, 175, 80, 0.3);
    color: var(--color-validation-light);
}

/* Practice Sandbox Cards & State Machine */
.practice-sandbox {
    display: flex;
    flex-direction: column;
}
.sandbox-card {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 16px;
    transition: transform var(--transition-normal);
}
.sandbox-card.shake {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}
.sandbox-stem {
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.55;
    color: var(--text-primary);
    margin-bottom: 18px;
}
.sandbox-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.sandbox-option {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.sandbox-option:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border-hover);
}
.sandbox-option.selected {
    background: rgba(0, 176, 255, 0.08);
    border-color: var(--color-interactive);
    color: var(--color-interactive);
}
.sandbox-option.correct {
    background: rgba(76, 175, 80, 0.12) !important;
    border-color: var(--color-validation-light) !important;
    color: var(--color-validation-light) !important;
}
.sandbox-option.incorrect {
    background: rgba(211, 47, 47, 0.12) !important;
    border-color: var(--color-danger) !important;
    color: var(--color-danger) !important;
}
.sandbox-option-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.04);
    font-weight: 800;
    font-size: 11px;
    transition: all var(--transition-fast);
}
.sandbox-option.selected .sandbox-option-badge {
    background: var(--color-interactive);
    color: #000;
}
.sandbox-option.correct .sandbox-option-badge {
    background: var(--color-validation-light);
    color: #000;
}
.sandbox-option.incorrect .sandbox-option-badge {
    background: var(--color-danger);
    color: #fff;
}

/* Sandbox word puzzle capsule tiles */
.sandbox-word-tile {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: all var(--transition-fast);
}
.sandbox-word-tile:hover {
    background: rgba(0, 176, 255, 0.08);
    border-color: var(--color-interactive);
    color: var(--color-interactive);
}
.sandbox-word-tile.active {
    background: rgba(0, 176, 255, 0.15);
    border-color: var(--color-interactive);
    color: var(--color-interactive);
    font-weight: 700;
}

/* 5-Step Deep Explainer Card (DAC Content Standards) */
.deep-explainer-card {
    background: rgba(255, 143, 0, 0.015);
    border: 1px solid rgba(255, 143, 0, 0.12);
    border-radius: var(--radius-md);
    padding: 18px;
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.explainer-step {
    padding-left: 12px;
}

.explainer-step-title {
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}
.explainer-step.verdict .explainer-step-title { color: var(--color-validation-light); }
.explainer-step.rule .explainer-step-title { color: var(--color-commitment); }
.explainer-step.why .explainer-step-title { color: var(--color-interactive); }
.explainer-step.trap .explainer-step-title { color: var(--color-danger); }
.explainer-step.tip .explainer-step-title { color: var(--color-discovery); }

.explainer-step-text {
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--text-secondary);
}

/* Mastery Progress Meter in Drawer */
.drawer-mastery-progress {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 24px;
}
.mastery-progress-bar-bg {
    width: 60%;
    height: 6px;
    background: rgba(255,255,255,0.05);
    border-radius: 3px;
    overflow: hidden;
}
.mastery-progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--color-interactive) 0%, var(--color-validation-light) 100%);
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* Theoretical visual generic card */
.theory-visual-card {
    background: rgba(0,0,0,0.15);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 16px;
}
.theory-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--color-interactive);
    margin-bottom: 6px;
}
.theory-desc {
    font-size: 12.5px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}
.theory-formula {
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.03);
    border-radius: var(--radius-sm);
    padding: 10px;
    font-family: monospace;
    font-size: 12px;
    color: var(--color-discovery);
}

/* Shake Animation */
@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* Grammar Shelf - Chapter Accordion Style (B4 Standard: Cấp 2 - List Row) */
.grammar-accordion-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 40px;
}

.grammar-chapter-card {
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: var(--shadow-card);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.grammar-chapter-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.grammar-chapter-card.open {
    border-color: var(--border-hover);
    background: var(--bg-card);
    box-shadow: var(--shadow-md);
}

.chapter-header {
    padding: 22px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    gap: 16px;
}

.chapter-title-area {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.chapter-tag {
    font-size: 10px;
    font-weight: 800;
    color: var(--color-commitment);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.chapter-title {
    font-family: var(--font-heading);
    font-size: 18px;
    color: var(--text-primary);
    margin: 0;
    transition: color 0.2s ease;
}

.grammar-chapter-card:hover .chapter-title {
    color: var(--color-interactive);
}

.grammar-chapter-card.open .chapter-title {
    color: var(--color-commitment);
}

.chapter-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
    margin-top: 2px;
}

.chapter-meta-area {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 16px;
}

.mastery-circle-wrapper.tiny {
    width: 36px;
    height: 36px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mastery-circle-wrapper.tiny .mastery-circle-svg {
    width: 36px;
    height: 36px;
}

.mastery-circle-wrapper.tiny .mastery-percent-text {
    font-size: 9px;
    font-weight: 700;
}

.chapter-toggle-btn {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.grammar-chapter-card:hover .chapter-toggle-btn {
    background: rgba(0, 176, 255, 0.1);
    color: var(--color-interactive);
    border-color: rgba(0, 176, 255, 0.2);
}

.grammar-chapter-card.open .chapter-toggle-btn {
    transform: rotate(180deg);
    background: rgba(255, 111, 0, 0.1);
    color: var(--color-commitment);
    border-color: rgba(255, 111, 0, 0.2);
}

.chapter-body {
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.grammar-chapter-card.open .chapter-body {
    opacity: 1;
    visibility: visible;
}

.chapter-body-inner {
    padding: 0 28px 28px 28px;
    border-top: 1px solid #F0F0F0;
    margin-top: 0;
}

.sub-topics-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.sub-topic-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 20px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sub-topic-row:hover {
    background: rgba(230, 92, 0, 0.05);
    border-color: rgba(230, 92, 0, 0.25);
    box-shadow: 0 4px 12px rgba(230, 92, 0, 0.06);
    transform: translateX(4px);
}

.sub-topic-row-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.sub-topic-row-number {
    font-size: 12px;
    font-weight: 800;
    color: var(--color-interactive);
    background: rgba(0, 176, 255, 0.08);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    min-width: 32px;
    text-align: center;
    border: 1px solid rgba(0, 176, 255, 0.2);
}

.sub-topic-row-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sub-topic-row-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.sub-topic-row-tagline {
    font-size: 11.5px;
    color: var(--text-tertiary);
    font-family: var(--font-body);
}

.sub-topic-row-code {
    font-family: monospace;
    font-size: 11.5px;
    color: var(--color-commitment);
    background: rgba(230, 92, 0, 0.08);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(230, 92, 0, 0.15);
}

.sub-topic-row-right {
    margin-left: 16px;
}

.sub-topic-cta-btn {
    background: rgba(230, 92, 0, 0.06);
    border: 1px solid rgba(230, 92, 0, 0.3);
    color: var(--color-commitment);
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.05em;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.sub-topic-cta-btn:hover {
    background: linear-gradient(135deg, var(--color-commitment) 0%, #ff8f00 100%);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(230, 92, 0, 0.25);
    transform: scale(1.05);
}

.sub-topic-cta-btn:active {
    transform: scale(0.98);
}

.sub-topic-cta-btn.locked {
    background: rgba(0, 0, 0, 0.03) !important;
    color: var(--text-tertiary) !important;
    border: 1px dashed var(--border-color) !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    transform: none !important;
}

/* Full-screen Lesson View (Internal Navigation) */
.grammar-lesson-view {
    display: flex;
    flex-direction: column;
    gap: 20px;
    animation: fadeIn 0.4s ease-out;
}

.lesson-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px 24px;
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
    gap: 16px;
}

.lesson-back-btn {
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: var(--font-heading);
    font-size: 12.5px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s ease;
}

.lesson-back-btn:hover {
    background: rgba(0, 0, 0, 0.07);
    color: var(--text-primary);
    border-color: var(--border-hover);
    transform: translateX(-4px);
}

.lesson-header-title-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 200px;
}

.lesson-header-subtitle {
    font-size: 10px;
    font-weight: 800;
    color: var(--color-interactive);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.lesson-header-title {
    font-family: var(--font-heading);
    font-size: 20px;
    color: var(--text-primary);
    margin: 0;
}

.lesson-header-progress {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-end;
    min-width: 150px;
}

.lesson-mastery-label {
    font-size: 12px;
    font-weight: 800;
    color: var(--color-commitment);
}

.lesson-mastery-bar-bg {
    width: 140px;
    height: 6px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.lesson-mastery-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-commitment) 0%, #ff8f00 100%);
    border-radius: var(--radius-sm);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px rgba(255, 111, 0, 0.4);
}

.lesson-subtopic-selector-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 4px 10px 4px;
    margin-bottom: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.lesson-subtopic-selector-bar::-webkit-scrollbar {
    height: 4px;
}

.lesson-subtopic-selector-bar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
}

.lesson-subtopic-pill {
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 40px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 6px;
}

.lesson-subtopic-pill:hover {
    background: rgba(0, 0, 0, 0.07);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.lesson-subtopic-pill.active {
    background: rgba(2, 132, 199, 0.08);
    border-color: rgba(2, 132, 199, 0.35);
    color: var(--color-interactive);
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.12);
}

.lesson-subtopic-pill.overview-pill.active {
    background: rgba(230, 92, 0, 0.08);
    border-color: rgba(230, 92, 0, 0.35);
    color: var(--color-commitment);
    box-shadow: 0 2px 8px rgba(230, 92, 0, 0.12);
}

.lesson-body-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
    min-height: 450px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.lesson-tabs-container {
    display: flex;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
    margin-bottom: 8px;
}

.lesson-tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 8px 16px;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.lesson-tab-btn:hover {
    color: var(--text-primary);
}

.lesson-tab-btn.active {
    color: var(--color-interactive);
}

.lesson-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -13px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--color-interactive);
    border-radius: 2px 2px 0 0;
    box-shadow: 0 0 6px rgba(2, 132, 199, 0.25);
}

/* Focused subtopic theory cards */
.focused-theory-card {
    animation: zoomIn 0.3s ease-out;
}

.focused-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.focused-title-row h4 {
    font-family: var(--font-heading);
    color: var(--color-interactive);
    font-size: 18px;
    margin: 0;
}

.focused-tag {
    font-size: 11px;
    background: rgba(255, 143, 0, 0.15);
    color: var(--color-commitment);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-weight: 800;
}

.focused-formula-block {
    font-family: monospace;
    font-size: 15px;
    color: var(--color-discovery);
    background: rgba(0, 0, 0, 0.04);
    padding: 16px 20px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
    letter-spacing: 0.02em;
}

/* Formula Cases Tab Switcher */
.formula-cases-tabs {
    display: flex;
    gap: 4px;
    background: rgba(0, 0, 0, 0.04);
    padding: 4px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.formula-case-tab-btn {
    padding: 6px 14px;
    border: none;
    background: transparent;
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 800;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.formula-case-tab-btn:hover {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.02);
}

.formula-case-tab-btn.active {
    background: var(--bg-card) !important;
    color: var(--color-interactive) !important;
    box-shadow: var(--shadow-sm);
}

.formula-case-content {
    animation: fadeIn var(--transition-normal);
}

/* Side-by-side Comparative Split View Layout */
.formula-cases-container.split-view-active {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 20px;
    align-items: start;
}

.formula-cases-container.split-view-active .formula-case-content {
    display: block !important;
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    animation: fadeIn var(--transition-normal);
}

.formula-case-header-split {
    display: none;
}

.formula-cases-container.split-view-active .formula-case-header-split {
    display: block;
    font-size: 14px;
    font-weight: 800;
    color: var(--color-interactive);
    margin-bottom: 16px;
    border-bottom: 2px solid rgba(0, 176, 255, 0.15);
    padding-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.focused-section {
    margin-bottom: 20px;
}

.focused-section-title {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
    margin-bottom: 8px;
}

.focused-example-box {
    background: rgba(2, 132, 199, 0.04);
    border: 1px solid rgba(2, 132, 199, 0.15);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text-primary);
    font-style: italic;
    line-height: 1.5;
}

.focused-signals-box {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: rgba(2, 132, 199, 0.04);
    border: 1px dashed rgba(2, 132, 199, 0.2);
    padding: 12px 16px;
    border-radius: var(--radius-md);
}

.focused-signal-pill {
    background: rgba(2, 132, 199, 0.08);
    border: 1px solid rgba(2, 132, 199, 0.15);
    color: var(--color-interactive);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 11.5px;
    font-weight: 700;
}

.focused-tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.focused-tip-card {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    gap: 12px;
}

.focused-tip-icon {
    font-size: 20px;
}

.focused-tip-title {
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 4px;
}

.focused-tip-card.trap {
    border-color: rgba(244, 67, 54, 0.15);
    background: rgba(244, 67, 54, 0.02);
}

.focused-tip-card.trap .focused-tip-title {
    color: #b91c1c;
}

.focused-tip-card.tip {
    border-color: rgba(76, 175, 80, 0.15);
    background: rgba(76, 175, 80, 0.02);
}

.focused-tip-card.tip .focused-tip-title {
    color: #15803d;
}

/* ==========================================================================
   PIN SECURITY & ROLE AUTHENTICATION CUSTOM STYLES
   ========================================================================== */
.passcode-inputs-container {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 20px 0;
}

.pin-digit {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    border: 2px solid var(--border-color);
    background: #ffffff;
    color: #000000;
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    transition: all var(--transition-fast);
    outline: none;
}

.pin-digit:focus {
    border-color: var(--color-interactive);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
    background: #f0f7ff;
}

@keyframes shake-err {
    0%, 100% { transform: translateX(0); }
    15%, 45%, 75% { transform: translateX(-8px); }
    30%, 60%, 90% { transform: translateX(8px); }
}

.shake-error {
    animation: shake-err 0.45s cubic-bezier(.36,.07,.19,.97) both;
}

.pin-digit.error-state {
    border-color: #D32F2F !important;
    box-shadow: 0 0 12px rgba(211, 47, 47, 0.4) !important;
    color: #D32F2F !important;
}

/* ==========================================================================
   ACADEMIC MODE (PRACTICE ROOM)
   ========================================================================== */
.academic-mode {
    --bg-main: #F8FAFC !important; /* Light gray */
    --bg-card: #ffffff !important;
    --border-color: #E2E8F0 !important;
    --border-hover: #CBD5E1 !important;
    --text-primary: #0F172A !important;
    --text-secondary: #334155 !important;
    --text-tertiary: #64748B !important;
    background: var(--bg-main) !important;
}
.academic-mode .distraction-free-question-card {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
    border-radius: 8px !important;
}
.academic-mode .workspace-viewport {
    background: none !important;
}

/* ==========================================================================
   TEST-TAKING SKILLS UPGRADES & TACTICAL TOOLKITS
   ========================================================================== */

/* Multi-color highlight system */
.user-highlight {
    padding: 2px 0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 2px dashed transparent;
}
.user-highlight.hl-yellow {
    background-color: rgba(255, 193, 7, 0.35);
    color: var(--text-primary);
    border-bottom-color: rgba(255, 193, 7, 0.8);
}
.user-highlight.hl-yellow:hover {
    background-color: rgba(255, 193, 7, 0.5);
}
.user-highlight.hl-blue {
    background-color: rgba(2, 132, 199, 0.2);
    color: var(--text-primary);
    border-bottom-color: rgba(2, 132, 199, 0.6);
}
.user-highlight.hl-blue:hover {
    background-color: rgba(2, 132, 199, 0.35);
}
.user-highlight.hl-red {
    background-color: rgba(211, 47, 47, 0.2);
    color: var(--text-primary);
    border-bottom-color: rgba(211, 47, 47, 0.6);
}
.user-highlight.hl-red:hover {
    background-color: rgba(211, 47, 47, 0.35);
}

/* Highlight tooltip circular selectors */
.highlight-popover {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(15, 23, 42, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
    border-radius: 30px !important;
    padding: 6px 12px !important;
    backdrop-filter: blur(8px) !important;
    animation: zoomIn 0.15s ease-out;
}
.hl-color-btn {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.4);
    transition: transform 0.15s ease;
}
.hl-color-btn:hover {
    transform: scale(1.25);
}
.hl-color-btn.color-yellow {
    background-color: #ffeb3b;
}
.hl-color-btn.color-blue {
    background-color: #0284c7;
}
.hl-color-btn.color-red {
    background-color: #d32f2f;
}
.hl-remove-btn {
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    margin-left: 4px;
    opacity: 0.8;
    transition: opacity 0.2s;
}
.hl-remove-btn:hover {
    opacity: 1;
    color: #ef4444;
}

/* Option strikethrough improvements */
.option-btn {
    position: relative;
    display: flex;
    align-items: center;
    transition: all var(--transition-fast) !important;
}
.option-btn.strikethrough {
    text-decoration: line-through;
    opacity: 0.45;
    background-color: rgba(0, 0, 0, 0.02) !important;
    border-color: var(--border-color) !important;
    transform: scale(0.98);
}
.option-btn.strikethrough .option-text {
    color: var(--text-tertiary) !important;
}
.option-btn.strikethrough .option-letter {
    background: rgba(0, 0, 0, 0.05) !important;
    color: var(--text-tertiary) !important;
    text-decoration: line-through;
}
.option-strike-toggle {
    margin-left: auto;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border-color);
    opacity: 0;
    transition: all 0.2s ease;
    z-index: 5;
}
.option-btn:hover .option-strike-toggle {
    opacity: 0.7;
}
.option-strike-toggle:hover {
    opacity: 1 !important;
    background: rgba(211, 47, 47, 0.1);
    color: var(--color-danger);
    border-color: rgba(211, 47, 47, 0.3);
    transform: scale(1.1);
}
.option-btn.strikethrough .option-strike-toggle {
    opacity: 1;
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-secondary);
}

/* Floating Draggable Scratchpad style */
.scratchpad-floating-panel {
    position: fixed;
    width: 340px;
    height: 240px;
    background: var(--bg-card);
    border: 1px solid var(--color-interactive);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: zoomIn 0.2s ease-out;
}
.scratchpad-header {
    background: linear-gradient(90deg, #1e293b 0%, #0f172a 100%);
    color: #fff;
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 700;
    cursor: move;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}
.scratchpad-title {
    display: flex;
    align-items: center;
    gap: 6px;
}
.scratchpad-close-btn {
    cursor: pointer;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    border-radius: 4px;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    transition: background 0.2s;
}
.scratchpad-close-btn:hover {
    background: rgba(211, 47, 47, 0.8);
}
.scratchpad-textarea {
    flex-grow: 1;
    border: none;
    resize: none;
    padding: 12px;
    font-family: var(--font-body);
    font-size: 13.5px;
    color: var(--text-primary);
    background: #fcfcf9;
    outline: none;
    line-height: 1.5;
}
.scratchpad-footer {
    padding: 6px 12px;
    background: #f8fafc;
    border-top: 1px solid var(--border-color);
    font-size: 10px;
    color: var(--text-tertiary);
    text-align: right;
}

/* Drills UI custom enhancements */
.drill-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 12px;
}
.drill-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
}
.drill-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-soft);
}
.drill-arena {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-top: 24px;
    box-shadow: var(--shadow-soft);
}
.keyword-word-span {
    display: inline-block;
    padding: 4px 6px;
    margin: 3px;
    border-radius: 4px;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid var(--border-color);
    font-weight: 500;
    transition: all 0.15s ease;
}
.keyword-word-span:hover {
    background: rgba(2, 132, 199, 0.08);
    border-color: var(--color-interactive);
}
.keyword-word-span.selected {
    background: rgba(255, 193, 7, 0.3);
    border-color: #ffc107;
    font-weight: 700;
}
.keyword-word-span.correct {
    background: rgba(76, 175, 80, 0.25) !important;
    border-color: #4caf50 !important;
}
.keyword-word-span.incorrect {
    background: rgba(211, 47, 47, 0.15) !important;
    border-color: var(--color-danger) !important;
}
.skimming-box-passage {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-primary);
    white-space: pre-wrap;
    transition: filter 0.4s ease;
}
.skimming-box-passage.blurred {
    filter: blur(12px);
    user-select: none;
    pointer-events: none;
}

/* ==========================================================================
   GRAMMAR FULLSCREEN FOCUS MODE
   ========================================================================== */
body.grammar-fullscreen-mode {
    overflow: hidden;
}

body.grammar-fullscreen-mode .sidebar,
body.grammar-fullscreen-mode .app-header {
    display: none !important;
}

body.grammar-fullscreen-mode .main-content {
    margin-left: 0 !important;
    width: 100vw !important;
    padding: 0 !important;
}

body.grammar-fullscreen-mode .workspace-viewport {
    padding: 0;
    max-width: 100% !important;
    width: 100% !important;
    margin: 0;
    border-radius: 0;
}

body.grammar-fullscreen-mode .grammar-lesson-view {
    padding: 0;
    min-height: 100vh;
}

/* Styles for the collapsible details element */
.grammar-strategy-details {
    margin-bottom: 24px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    transition: all var(--transition-normal);
}
.grammar-strategy-details[open] {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
}
.grammar-strategy-details summary {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
}
.grammar-strategy-details summary::-webkit-details-marker {
    display: none;
}
.grammar-strategy-details summary:hover {
    color: var(--color-interactive);
}
.grammar-strategy-details-content {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed var(--border-color);
}

/* Big CTA Button */
.btn-mega-practice {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px 24px;
    font-size: 18px;
    font-family: var(--font-heading);
    font-weight: 700;
    background: linear-gradient(135deg, var(--color-commitment), #ff8f00);
    color: var(--bg-main);
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    margin-top: 48px;
    box-shadow: var(--shadow-glow-amber);
    transition: all var(--transition-normal);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.btn-mega-practice:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(255, 143, 0, 0.4);
}
.btn-mega-practice:active {
    transform: translateY(0);
}

/* ==========================================================================
   GRAMMAR LESSON VERTICAL SIDEBAR LAYOUT
   ========================================================================== */
.grammar-lesson-view.with-sidebar {
    display: flex;
    flex-direction: row;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    gap: 0;
    padding: 0;
    margin: 0;
    background: var(--bg-main);
}

/* --- Sidebar --- */
.lesson-sidebar {
    width: 280px;
    min-width: 280px;
    height: 100vh;
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                min-width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease;
    box-shadow: 4px 0 16px rgba(0, 0, 0, 0.06);
    z-index: 10;
}

/* FIX Lỗi 3: Dùng width collapse thay vì margin-left âm — toggle vẫn hoạt động đúng */
.lesson-sidebar.hidden {
    width: 0;
    min-width: 0;
    opacity: 0;
    pointer-events: none;
    border-right: none;
}

.lesson-sidebar-top {
    padding: 20px 20px 12px 20px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

/* FIX Lỗi 1: Nút Trở lại gọn gàng, không có border box thừa */
.lesson-sidebar .lesson-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 4px;
    border-radius: 6px;
    transition: color 0.2s ease, background 0.2s ease;
}
.lesson-sidebar .lesson-back-btn:hover {
    color: var(--text-primary);
    background: rgba(0,0,0,0.04);
}

.lesson-sidebar-header {
    padding: 20px 20px 0 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

.lesson-sidebar-progress {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

/* FIX cho mastery bar chiếm đủ width */
.lesson-sidebar-progress .lesson-mastery-bar-bg {
    width: 100%;
}

.lesson-sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.lesson-sidebar-nav-label {
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-tertiary);
    letter-spacing: 0.6px;
    padding: 0 8px;
    margin-bottom: 6px;
}

/* FIX Lỗi 2: Pills theo chiều dọc không bị cắt chữ */
.lesson-sidebar-nav .lesson-subtopic-pill {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    justify-content: flex-start;
    white-space: normal;          /* Cho phép xuống dòng */
    word-break: break-word;
    line-height: 1.4;
    border-radius: 8px;
}

/* --- Main Content Area --- */
.lesson-main-area {
    flex: 1;
    height: 100vh;
    /* FIX Lỗi 5: overflow-x hidden để tránh content tràn ngang */
    overflow-x: hidden;
    overflow-y: auto;
    background: var(--bg-main);
    display: flex;
    flex-direction: column;
}

/* FIX Lỗi 3: Topbar cố định chứa toggle, luôn hiển thị */
.lesson-main-topbar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 28px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-card);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 5;
}

.lesson-sidebar-toggle {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.lesson-sidebar-toggle:hover {
    color: var(--color-interactive);
    border-color: var(--color-interactive);
    background: rgba(0, 176, 255, 0.05);
}

.lesson-main-topbar-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* FIX Lỗi 4: Body card với padding top đủ, không bị sát */
.lesson-main-area .lesson-body-card {
    max-width: 100%;
    margin: 0;
    width: 100%;
    padding: 32px 40px 64px 40px;
    box-shadow: none;
    border: none;
    background: transparent;
    flex: 1;
    box-sizing: border-box;
}


