/* ========================================
   CSS RESET & BASE STYLES
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-card: #ffffff;
    /* Soft Pastel Color Palette - Optimized for Smart Boards */
    --primary-50: #f0f9ff;
    --primary-100: #e0f2fe;
    --primary-200: #bae6fd;
    --primary-300: #7dd3fc;
    --primary-400: #38bdf8;
    --primary-500: #0ea5e9;
    --primary-600: #0284c7;
    --primary-700: #0369a1;

    --secondary-50: #fef3c7;
    --secondary-100: #fde68a;
    --secondary-200: #fcd34d;
    --secondary-300: #fbbf24;
    --secondary-400: #f59e0b;

    --accent-50: #fce7f3;
    --accent-100: #fbcfe8;
    --accent-200: #f9a8d4;
    --accent-300: #f472b6;

    --success-50: #f0fdf4;
    --success-100: #dcfce7;
    --success-200: #bbf7d0;
    --success-300: #86efac;
    --success-400: #4ade80;
    --success-500: #22c55e;
    --success-600: #16a34a;
    --success-700: #15803d;

    --danger-50: #fef2f2;
    --danger-100: #fee2e2;
    --danger-200: #fecaca;
    --danger-300: #fca5a5;
    --danger-400: #f87171;
    --danger-500: #ef4444;
    --danger-600: #dc2626;
    --danger-700: #b91c1c;

    --neutral-50: #fafafa;
    --neutral-100: #f5f5f5;
    --neutral-200: #e5e5e5;
    --neutral-300: #d4d4d4;
    --neutral-400: #a3a3a3;
    --neutral-500: #737373;
    --neutral-600: #525252;
    --neutral-700: #404040;
    --neutral-800: #262626;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-serif: 'Merriweather', Georgia, serif;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;

    /* Border Radius */
    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
    --radius-xl: 2rem;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 250ms ease-in-out;
    --transition-slow: 350ms ease-in-out;
}

[data-theme="dark"] {
    --primary-50: #0c4a6e;
    --primary-100: #075985;
    --primary-200: #0369a1;
    --primary-300: #0284c7;
    --primary-400: #0ea5e9;
    --primary-500: #38bdf8;
    --primary-600: #7dd3fc;
    --primary-700: #bae6fd;

    --secondary-50: #422006;
    --secondary-100: #713f12;
    --secondary-200: #854d0e;
    --secondary-300: #a16207;
    --secondary-400: #ca8a04;

    --neutral-50: #171717;
    --neutral-100: #262626;
    --neutral-200: #404040;
    --neutral-300: #525252;
    --neutral-400: #737373;
    --neutral-500: #a3a3a3;
    --neutral-600: #d4d4d4;
    --neutral-700: #e5e5e5;
    --neutral-800: #f5f5f5;

    --success-50: #052e16;
    --success-100: #14532d;
    --success-200: #166534;
    --success-300: #15803d;
    --success-400: #16a34a;
    --success-500: #22c55e;
    --success-600: #4ade80;
    --success-700: #86efac;

    --danger-50: #450a0a;
    --danger-100: #7f1d1d;
    --danger-200: #991b1b;
    --danger-300: #b91c1c;
    --danger-400: #dc2626;
    --danger-500: #ef4444;
    --danger-600: #f87171;
    --danger-700: #fca5a5;

    --bg-card: #262626;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

.theme-toggle {
    position: fixed;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    z-index: 9999;
    background: var(--neutral-50);
    border: 2px solid var(--primary-200);
    color: var(--primary-600);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-size: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}

body {
    font-family: var(--font-sans);
    /* Layered Background: Pattern on top, Gradient on bottom */
    /* Layered Background: Large Diagonal DNA Helix on top, Gradient on bottom */
    background-image:
        url("data:image/svg+xml,%3Csvg viewBox='0 0 800 800' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3ClinearGradient id='grad1' x1='0%25' y1='0%25' x2='100%25' y2='100%25'%3E%3Cstop offset='0%25' style='stop-color:%230ea5e9;stop-opacity:0.1' /%3E%3Cstop offset='50%25' style='stop-color:%230ea5e9;stop-opacity:0.3' /%3E%3Cstop offset='100%25' style='stop-color:%230ea5e9;stop-opacity:0.1' /%3E%3C/linearGradient%3E%3C/defs%3E%3Cg transform='rotate(-45 400 400)'%3E%3C!-- Strands --%3E%3Cpath d='M-100,400 Q 100,200 300,400 T 700,400 T 1100,400' stroke='url(%23grad1)' fill='none' stroke-width='35' opacity='0.9'/%3E%3Cpath d='M-100,400 Q 100,600 300,400 T 700,400 T 1100,400' stroke='url(%23grad1)' fill='none' stroke-width='35' opacity='0.9'/%3E%3C!-- Denser Rungs (Hydrogen Bonds) --%3E%3Cpath d='M20,360 L20,440 M60,320 L60,480 M100,280 L100,520 M140,320 L140,480 M180,360 L180,440 M220,380 L220,420 M260,395 L260,405 M340,395 L340,405 M380,380 L380,420 M420,360 L420,440 M460,320 L460,480 M500,280 L500,520 M540,320 L540,480 M580,360 L580,440 M620,380 L620,420 M660,395 L660,405 M740,395 L740,405 M780,380 L780,420' stroke='url(%23grad1)' stroke-width='8' opacity='0.6' /%3E%3C/g%3E%3C/svg%3E"),
        linear-gradient(135deg, var(--primary-50) 0%, var(--neutral-50) 100%);
    background-size:
        cover,
        100% 100%;
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    color: var(--neutral-800);
    line-height: 1.6;
    min-height: 100vh;
    font-size: 16px;
    position: relative;
    overflow-x: hidden;
}

/* Pseudo-element removed as background is now merged */

/* ========================================
   LAYOUT
   ======================================== */
#app {
    max-width: 1800px;
    margin: 0 auto;
    padding: var(--spacing-lg);
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* ========================================
   TYPOGRAPHY
   ======================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: var(--spacing-md);
    color: var(--neutral-800);
}

h1 {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-600), var(--primary-400));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    font-size: 2.25rem;
    color: var(--primary-700);
}

h3 {
    font-size: 1.75rem;
}

h4 {
    font-size: 1.5rem;
}

p {
    margin-bottom: var(--spacing-sm);
    font-size: 1.125rem;
}

/* ========================================
   HEADER & NAVIGATION
   ======================================== */
.header {
    text-align: center;
    padding: var(--spacing-md) 0;
    margin-bottom: var(--spacing-lg);
    position: relative;
}

.header-title {
    font-size: 2rem;
    margin-bottom: 0;
    animation: fadeInDown 0.6s ease-out;
}

.header-subtitle {
    font-size: 1.25rem;
    color: var(--neutral-600);
    font-weight: 400;
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-sm) var(--spacing-md);
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

.breadcrumb-item {
    color: var(--neutral-600);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color var(--transition-fast);
}

.breadcrumb-item:hover {
    color: var(--primary-600);
}

.breadcrumb-item.active {
    color: var(--primary-600);
    font-weight: 500;
}

.breadcrumb-separator {
    color: var(--neutral-400);
    user-select: none;
}

/* ========================================
   CARDS & BUTTONS (Glassmorphism & 3D)
   ======================================== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.card {
    background: rgba(255, 255, 255, 0.75);
    /* Glass Effect */
    backdrop-filter: blur(12px);
    /* Blur behind */
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.05),
        0 2px 4px -1px rgba(0, 0, 0, 0.03),
        inset 0 0 0 1px rgba(255, 255, 255, 0.5);
    /* Inner shine */
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* Bouncy spring transition */
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-400), var(--primary-600));
    transform: scaleX(0);
    transition: transform 0.4s ease;
    z-index: 2;
}

.card:hover {
    transform: translateY(-8px) scale(1.02);
    /* Pop up effect */
    box-shadow:
        0 20px 25px -5px rgba(14, 165, 233, 0.15),
        /* Blue tinted shadow */
        0 10px 10px -5px rgba(14, 165, 233, 0.1);
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.9);
}

.card:hover::before {
    transform: scaleX(1);
}

.card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
}

.card-title {
    font-size: 1.5rem;
    color: var(--primary-700);
    margin-bottom: var(--spacing-sm);
}

.card-description {
    color: var(--neutral-600);
    font-size: 1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-lg);
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--primary-600);
    border: 2px solid var(--primary-200);
}

.btn-secondary:hover {
    background: var(--primary-50);
    border-color: var(--primary-400);
}

.btn-download {
    background: linear-gradient(135deg, var(--success-200), var(--success-300));
    color: var(--neutral-800);
}

.btn-download:hover {
    background: linear-gradient(135deg, var(--success-300), var(--success-300));
    box-shadow: var(--shadow-lg);
}

/* ========================================
   GRADE CARDS (Home Page - Premium Glass)
   ======================================== */
/* ========================================
   GRADE CARDS (Home Page - Premium Glass)
   ======================================== */
.grade-cards {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 30px !important;
    margin-top: var(--spacing-2xl);
    max-width: 1200px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 0 20px !important;
}

/* Sub-page Grid Override */
.grade-cards.sub-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    max-width: 800px !important;
    gap: 40px !important;
}

.grade-card {
    aspect-ratio: 1/1 !important;
    min-width: 0 !important;
    /* Critical for preventing grid overflow */
    width: 100% !important;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 24px !important;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    position: relative;
    border: none !important;
}

/* Card Color Variants */
.grade-card.teachers {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.grade-card.students {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%) !important;
}

.grade-card.games {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%) !important;
}

.grade-card.documentaries {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%) !important;
}

/* Content Styles */
.grade-card .grade-card-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    padding: 15px;
    text-align: center;
    color: white !important;
}

.grade-card .grade-card-title {
    color: white !important;
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    margin-bottom: 8px !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.grade-card .grade-card-description {
    color: rgba(255, 255, 255, 0.95) !important;
    font-size: 0.95rem !important;
    margin: 0 !important;
    font-weight: 500;
}

.grade-card .card-icon {
    font-size: 4rem;
    margin-bottom: 12px;
    line-height: 1;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
    transition: transform 0.3s ease;
}

/* Hover Effects */
.grade-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    z-index: 10;
}

.grade-card:hover .card-icon {
    transform: scale(1.1);
}

.grade-card-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
}

.grade-card-content {
    padding: var(--spacing-xl);
}

.grade-card-title {
    font-size: 2rem;
    color: var(--primary-700);
    margin-bottom: var(--spacing-sm);
}

.grade-card-description {
    color: var(--neutral-600);
    font-size: 1.125rem;
}

/* ========================================
   DASHBOARD SECTIONS
   ======================================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-lg);
}

@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

.section-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    cursor: pointer;
    text-align: center;
    border: 2px solid transparent;
}

.section-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-300);
}

.section-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
}

.section-title {
    font-size: 1.25rem;
    color: var(--primary-700);
    margin-bottom: var(--spacing-xs);
}

.section-count {
    color: var(--neutral-500);
    font-size: 0.9rem;
}

/* ========================================
   ACCORDION MENUS
   ======================================== */
.accordion {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.accordion-item {
    border-bottom: 1px solid var(--neutral-200);
}

.accordion-item:last-child {
    border-bottom: none;
}

.accordion-header {
    width: 100%;
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--bg-card);
    border: none;
    text-align: left;
    font-family: var(--font-sans);
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--neutral-800);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.accordion-header:hover {
    background: var(--primary-50);
    color: var(--primary-700);
}

.accordion-header.active {
    background: var(--primary-100);
    color: var(--primary-700);
}

.accordion-icon {
    transition: transform var(--transition-base);
    font-size: 1.25rem;
}

.accordion-header.active .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-slow);
    background: var(--neutral-50);
}

.accordion-content.active {
    max-height: 10000px;
}

.accordion-body {
    padding: var(--spacing-lg);
    color: var(--neutral-700);
    line-height: 1.8;
}

/* ========================================
   THREE-COLUMN LAYOUT (Presentation Detail)
   ======================================== */
.three-column-layout {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
    align-items: start;
}

.column-left {
    position: sticky;
    top: 20px;
    align-self: start;
    height: auto;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    /* Custom Scrollbar for sleek look */
    scrollbar-width: thin;
    scrollbar-color: var(--primary-200) transparent;
}

.column-right {
    position: static;
    /* Let right column scroll naturally */
    height: auto;
    overflow: visible;
}

.column-center {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
}

.pdf-viewer-container {
    width: 100%;
    min-height: 800px;
}

.pdf-viewer-container iframe {
    width: 100%;
    height: 800px;
    border: none;
    border-radius: var(--radius-md);
}

/* ========================================
   ACTIVITY DETAIL SECTIONS
   ======================================== */
.activity-sections {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.activity-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-md);
    border-left: 4px solid var(--primary-400);
}

.activity-section-title {
    font-size: 1.5rem;
    color: var(--primary-700);
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.activity-section-content {
    color: var(--neutral-700);
    font-size: 1.125rem;
    line-height: 1.8;
}

.placeholder-text {
    color: var(--neutral-500);
    font-style: italic;
    padding: var(--spacing-lg);
    background: var(--neutral-100);
    border-radius: var(--radius-md);
    text-align: center;
}

/* ========================================
   MODAL
   ======================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    animation: fadeIn var(--transition-base);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
    animation: slideUp var(--transition-slow);
}

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

.modal-close {
    font-size: 2rem;
    font-weight: bold;
    color: var(--neutral-500);
    cursor: pointer;
    transition: color var(--transition-fast);
    line-height: 1;
}

.modal-close:hover {
    color: var(--neutral-800);
}

.modal-body {
    flex: 1;
    overflow: auto;
    padding: var(--spacing-lg);
}

.modal-body iframe {
    width: 100%;
    height: 70vh;
    border: none;
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.text-center {
    text-align: center;
}

.mt-1 {
    margin-top: var(--spacing-xs);
}

.mt-2 {
    margin-top: var(--spacing-sm);
}

.mt-3 {
    margin-top: var(--spacing-md);
}

.mt-4 {
    margin-top: var(--spacing-lg);
}

.mt-5 {
    margin-top: var(--spacing-xl);
}

.mb-1 {
    margin-bottom: var(--spacing-xs);
}

.mb-2 {
    margin-bottom: var(--spacing-sm);
}

.mb-3 {
    margin-bottom: var(--spacing-md);
}

.mb-4 {
    margin-bottom: var(--spacing-lg);
}

.mb-5 {
    margin-bottom: var(--spacing-xl);
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-transition {
    animation: slideUp 0.4s ease-out both;
}

/* ========================================
   DESKTOP / SMART BOARD OPTIMIZATIONS
   ======================================== */
/* Desktop / Smart Board - Large Screens */
@media (min-width: 1400px) {

    /* Ensure header buttons have proper spacing and wrapping */
    .header>div[style*="position: absolute"] {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        align-items: center;
        justify-content: flex-end;
        max-width: 600px;
    }

    .header .btn {
        white-space: nowrap;
        min-width: fit-content;
    }

    /* Improve grade card layout */
    .grade-cards {
        gap: var(--spacing-2xl);
    }

    .grade-card {
        min-height: 500px;
    }
}

/* Medium Desktop (Smart Boards / Tablets) */
@media (min-width: 1024px) and (max-width: 1399px) {
    .header>div[style*="position: absolute"] {
        flex-wrap: wrap;
        gap: 8px;
        max-width: 500px;
    }

    .header .btn {
        font-size: 0.9rem;
        padding: 8px 16px !important;
    }
}


/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 1100px) {
    .three-column-layout {
        grid-template-columns: 200px 1fr 200px;
        gap: var(--spacing-sm);
    }
}

@media (max-width: 900px) {
    .three-column-layout {
        grid-template-columns: 1fr;
        display: flex;
        flex-direction: column;
    }

    .column-left {
        position: static;
        max-height: 280px;
        overflow-y: auto;
        order: 1;
        width: 100%;
        margin-bottom: var(--spacing-md);
        /* Scrollbar styles */
        scrollbar-width: thin;
        scrollbar-color: var(--primary-300) transparent;
    }

    .column-left::-webkit-scrollbar {
        width: 6px;
    }

    .column-left::-webkit-scrollbar-thumb {
        background: var(--primary-300);
        border-radius: 3px;
    }

    .column-right,
    .column-center {
        position: static;
        max-height: none;
        order: 2;
        width: 100%;
    }

    .grade-cards {
        grid-template-columns: repeat(2, 1fr) !important;
        max-width: 600px !important;
        gap: 20px !important;
    }
}

@media (max-width: 500px) {
    .grade-cards {
        grid-template-columns: 1fr !important;
        max-width: 320px !important;
    }
}

@media (max-width: 768px) {

    /* Reduce overall header padding and margins */
    .header {
        padding: var(--spacing-xs) 0;
        margin-bottom: var(--spacing-sm);
    }

    /* Make header title more compact */
    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .header-title {
        font-size: 1.5rem !important;
        gap: 8px !important;
    }

    /* Reduce logo sizes on mobile */
    .header-title img {
        height: 45px !important;
    }

    /* Make subtitle smaller and more compact */
    .header-subtitle {
        font-size: 0.95rem !important;
        margin-bottom: var(--spacing-xs);
        padding: 0 var(--spacing-sm);
    }

    /* Stack header buttons vertically and make them smaller */
    .header>div[style*="position: absolute"] {
        position: static !important;
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-bottom: var(--spacing-sm);
        padding: 0 var(--spacing-sm);
    }

    .header .btn {
        width: 100%;
        padding: 8px 12px !important;
        font-size: 0.85rem !important;
        margin-left: 0 !important;
    }

    /* Make grade cards more compact */
    .grade-card-image {
        height: 180px;
    }

    .grade-card-content {
        padding: var(--spacing-md);
    }

    .grade-card-title {
        font-size: 1.5rem;
    }

    .grade-card-description {
        font-size: 0.95rem;
    }

    /* Adjust app container padding */
    #app {
        padding: var(--spacing-sm);
    }
}

@media (max-width: 480px) {

    /* Even more compact on very small screens */
    .header {
        padding: 4px 0;
        margin-bottom: 8px;
    }

    .header-title {
        font-size: 1.25rem !important;
        gap: 6px !important;
    }

    .header-title img {
        height: 35px !important;
    }

    .header-subtitle {
        font-size: 0.85rem !important;
        line-height: 1.3;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .three-column-layout {
        grid-template-columns: 1fr;
    }

    .column-left {
        max-height: 220px;
    }

    .grade-card-image {
        height: 150px;
    }

    .grade-cards {
        gap: var(--spacing-md);
        margin-top: var(--spacing-md);
    }

    /* Compact buttons even more */
    .header .btn {
        padding: 6px 10px !important;
        font-size: 0.8rem !important;
    }

    /* Reduce main app padding */
    #app {
        padding: 8px;
    }
}

/* ========================================
   DARK MODE FIXES
   ======================================== */
/* Fix 1: Force dark text for containers that retain white backgrounds in Dark Mode */
[data-theme="dark"] .accordion-header,
[data-theme="dark"] .activity-section,
[data-theme="dark"] .card,
[data-theme="dark"] .modal-content,
[data-theme="dark"] .notebook-wrapper {
    color: #2c3e50 !important;
}

[data-theme="dark"] .card h4,
[data-theme="dark"] .card p {
    color: #2c3e50 !important;
}

/* Force dark text for elements with inline light backgrounds */
[data-theme="dark"] div[style*="background-color"],
[data-theme="dark"] div[style*="background:"] {
    color: #2c3e50 !important;
}

[data-theme="dark"] div[style*="background-color"] h1,
[data-theme="dark"] div[style*="background-color"] h2,
[data-theme="dark"] div[style*="background-color"] h3,
[data-theme="dark"] div[style*="background-color"] h4,
[data-theme="dark"] div[style*="background-color"] h5,
[data-theme="dark"] div[style*="background-color"] h6,
[data-theme="dark"] div[style*="background-color"] strong,
[data-theme="dark"] div[style*="background-color"] b,
[data-theme="dark"] div[style*="background-color"] li {
    color: #1a1a1a !important;
}



/* Print Optimization */
@media print {

    /* Hide UI Elements */
    .theme-toggle,
    .search-toggle-btn,
    .breadcrumb,
    .btn,
    button,
    .modal,
    iframe,
    .accordion-header .accordion-icon {
        display: none !important;
    }

    /* Layout Reset */
    body,
    #app,
    .header,
    .three-column-layout,
    .container {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
        color: black !important;
        box-shadow: none !important;
        display: block !important;
    }

    /* Content Visibility */
    .accordion-content {
        display: block !important;
        max-height: none !important;
        border: none !important;
    }

    .accordion-item {
        border: 1px solid #eee !important;
        margin-bottom: 20px;
        page-break-inside: avoid;
    }

    .header-title img {
        display: none;
        /* Hide logos in print to save ink */
    }

    .header-title {
        font-size: 18pt !important;
        text-align: center;
        margin-bottom: 10px;
        color: black !important;
    }

    .header-subtitle {
        text-align: center;
        font-size: 12pt !important;
        margin-bottom: 20px;
        color: #555 !important;
    }

    /* Expand Columns */
    .column-left,
    .column-center,
    .column-right {
        width: 100% !important;
        display: block !important;
        page-break-inside: avoid;
        margin-bottom: 20px;
        border: none !important;
    }

    /* Typography */
    p,
    li,
    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
        color: black !important;
    }

    a {
        text-decoration: none !important;
        color: black !important;
    }
}

/* ========================================
   SCROLLBAR STYLING
   ======================================== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--neutral-100);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-300);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-400);
}

/* ========================================
   NOTEBOOK STYLES
   ======================================== */
.notebook-entry {
    background-color: #fff9c4;
    /* Light yellow paper color */
    background-image: linear-gradient(#e1e1e1 1px, transparent 1px);
    background-size: 100% 1.5em;
    padding: var(--spacing-lg);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    font-family: var(--font-sans);
    /* Clean sans-serif font as per screenshot */
    line-height: 1.5em;
    color: #2c3e50;
    position: relative;
    border-left: 4px solid #ef5350;
    /* Red margin line */
}

.notebook-title-container {
    text-align: center;
    margin-bottom: 2rem;
    border-bottom: 2px solid #3498db;
    padding-bottom: 1rem;
}

.notebook-main-title {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.notebook-sub-title {
    font-size: 1.1rem;
    color: #7f8c8d;
    font-style: italic;
}

.notebook-section-header {
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    margin-top: 25px;
    margin-bottom: 15px;
    font-weight: 600;
    font-size: 1.2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-blue {
    background-color: #2980b9;
}

.header-green {
    background-color: #27ae60;
}

.header-orange {
    background-color: #d35400;
}

.header-purple {
    background-color: #8e44ad;
}

.header-red {
    background-color: #c0392b;
}

.header-teal {
    background-color: #16a085;
}

.notebook-entry ul {
    list-style-type: none;
    padding-left: 1em;
}

.notebook-entry li {
    margin-bottom: 0.8em;
    position: relative;
}

.notebook-entry li::before {
    content: "•";
    color: #e74c3c;
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}

.notebook-highlight {
    background-color: rgba(255, 235, 59, 0.4);
    padding: 0 4px;
    border-radius: 3px;
}

.notebook-note-box {
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    border-left: 4px solid #ffc107;
    padding: 15px;
    margin: 15px 0;
    border-radius: 4px;
    font-size: 0.95em;
}

.notebook-info-box {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    border-left: 4px solid #17a2b8;
    padding: 15px;
    margin: 15px 0;
    border-radius: 4px;
    font-size: 0.95em;
}

/* ========================================
   UNIFIED NOTEBOOK STYLES
   ======================================== */
.notebook-container {
    max-width: 900px;
    margin: 0 auto;
    padding-bottom: 4rem;
}

.notebook-wrapper {
    position: relative;
    z-index: 1;
}

.notebook-wrapper::after {
    content: "--- ✂ ---";
    display: block;
    text-align: center;
    color: var(--neutral-400);
    margin: 2rem 0;
    font-family: monospace;
    letter-spacing: 2px;
}

.notebook-wrapper:last-child::after {
    display: none;
}

/* ========================================
   DARK MODE FIXES (FINAL)
   ======================================== */
/* Fix for Accordion Headers in Dark Mode */
/* Default: Light text for dark backgrounds */
[data-theme="dark"] .accordion-header {
    color: #e5e5e5 !important;
    background-color: #374151 !important;
}

[data-theme="dark"] .accordion-header .accordion-icon {
    color: #e5e5e5 !important;
}

/* Override: Also apply dark background + light text to headers with inline styles */
[data-theme="dark"] .accordion-header[style*="background-color"],
[data-theme="dark"] .accordion-header[style*="background:"] {
    color: #e5e5e5 !important;
    background-color: #374151 !important;
}

[data-theme="dark"] .accordion-header[style*="background-color"] span,
[data-theme="dark"] .accordion-header[style*="background:"] span,
[data-theme="dark"] .accordion-header[style*="background-color"] .accordion-icon,
[data-theme="dark"] .accordion-header[style*="background:"] .accordion-icon {
    color: #e5e5e5 !important;
}

/* Fix for Content with Inline Light Backgrounds (e.g. Expectations, Warnings) */
[data-theme="dark"] div[style*="background-color"],
[data-theme="dark"] div[style*="background:"] {
    color: #1a1a1a !important;
    /* Force dark text on light backgrounds */
}

/* Ensure headers inside these light boxes are also dark */
[data-theme="dark"] div[style*="background-color"] h1,
[data-theme="dark"] div[style*="background-color"] h2,
[data-theme="dark"] div[style*="background-color"] h3,
[data-theme="dark"] div[style*="background-color"] h4,
[data-theme="dark"] div[style*="background-color"] h5,
[data-theme="dark"] div[style*="background-color"] strong {
    color: #000000 !important;
}

/* ========================================
   DARK MODE CARD FIXES
   ======================================== */
[data-theme="dark"] .card-title,
[data-theme="dark"] .section-title,
[data-theme="dark"] .grade-card-title,
[data-theme="dark"] .intro-title,
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4 {
    color: #bae6fd !important;
    /* Force Light Blue */
}

[data-theme="dark"] .card-description,
[data-theme="dark"] .section-count,
[data-theme="dark"] .grade-card-description,
[data-theme="dark"] .intro-text,
[data-theme="dark"] p,
[data-theme="dark"] li {
    color: #e5e5e5 !important;
    /* Force Light Gray */
}

[data-theme="dark"] .breadcrumb {
    background: #262626;
    border: 1px solid #404040;
}

[data-theme="dark"] .breadcrumb-item {
    color: #a3a3a3;
}

[data-theme="dark"] .breadcrumb-item.active {
    color: #38bdf8;
}

/* Ensure borders are visible in dark mode */
/* Ensure borders are visible in dark mode */
[data-theme="dark"] .section-card,
[data-theme="dark"] .card,
[data-theme="dark"] .grade-card {
    border: 1px solid #404040;
}

/* ========================================
   DARK MODE CARD FIXES (FORCED)
   ======================================== */
[data-theme="dark"] .card-title,
[data-theme="dark"] .section-title,
[data-theme="dark"] .grade-card-title,
[data-theme="dark"] .intro-title,
[data-theme="dark"] .card-title-text,
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4 {
    color: #bae6fd !important;
    /* Force Light Blue */
}

[data-theme="dark"] .card-description,
[data-theme="dark"] .section-count,
[data-theme="dark"] .grade-card-description,
[data-theme="dark"] .intro-text,
[data-theme="dark"] .card-desc-text,
[data-theme="dark"] p,
[data-theme="dark"] li {
    color: #e5e5e5 !important;
    /* Force Light Gray */
}

/* ========================================
   SCROLL PROGRESS BAR
   ======================================== */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg,
            var(--primary-400),
            var(--primary-500),
            var(--accent-300),
            var(--primary-400));
    background-size: 200% 100%;
    animation: gradientShift 2s ease infinite;
    z-index: 10000;
    transition: width 0.1s ease-out;
    border-radius: 0 2px 2px 0;
    box-shadow: 0 0 10px rgba(14, 165, 233, 0.5);
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* ========================================
   SKELETON LOADING
   ======================================== */
.skeleton {
    background: linear-gradient(90deg,
            var(--neutral-200) 25%,
            var(--neutral-100) 50%,
            var(--neutral-200) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
    border-radius: 4px;
}

.skeleton-text:last-child {
    width: 70%;
}

.skeleton-title {
    height: 2em;
    width: 60%;
    margin-bottom: 1em;
}

.skeleton-card {
    height: 200px;
    margin-bottom: var(--spacing-md);
}

.skeleton-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

[data-theme="dark"] .skeleton {
    background: linear-gradient(90deg,
            #404040 25%,
            #525252 50%,
            #404040 75%);
    background-size: 200% 100%;
}

/* ========================================
   FLOATING ACTION BUTTON (Mobile)
   ======================================== */
.fab-container {
    position: fixed;
    bottom: 90px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column-reverse;
    gap: 12px;
    align-items: center;
}

.fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: white;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow:
        0 4px 12px rgba(14, 165, 233, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    display: flex;
    align-items: center;
    justify-content: center;
}

.fab:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow:
        0 6px 20px rgba(14, 165, 233, 0.5),
        0 4px 8px rgba(0, 0, 0, 0.15);
}

.fab:active {
    transform: scale(0.95);
}

.fab-menu {
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    transform: translateY(20px);
}

.fab-container.open .fab-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.fab-item {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--primary-200);
    color: var(--primary-600);
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fab-item:hover {
    background: var(--primary-50);
    border-color: var(--primary-400);
    transform: scale(1.1);
}

/* Hide FAB on desktop */
@media (min-width: 769px) {
    .fab-container {
        display: none;
    }
}

/* ========================================
   GRADIENT BORDER CARDS
   ======================================== */
.gradient-border {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 2px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg,
            var(--primary-400),
            var(--accent-300),
            var(--success-400),
            var(--primary-400));
    background-size: 300% 300%;
    animation: borderGradient 4s ease infinite;
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

@keyframes borderGradient {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* ========================================
   ANIMATED ICONS
   ======================================== */
.icon-bounce {
    display: inline-block;
    transition: transform 0.3s ease;
}

.icon-bounce:hover,
.card:hover .icon-bounce,
.section-card:hover .icon-bounce {
    animation: iconBounce 0.6s ease;
}

@keyframes iconBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    25% {
        transform: translateY(-8px);
    }

    50% {
        transform: translateY(0);
    }

    75% {
        transform: translateY(-4px);
    }
}

.icon-spin {
    display: inline-block;
    transition: transform 0.5s ease;
}

.icon-spin:hover,
.card:hover .icon-spin,
.section-card:hover .icon-spin {
    transform: rotate(360deg);
}

.icon-pulse {
    display: inline-block;
    transition: transform 0.3s ease;
}

.icon-pulse:hover,
.card:hover .icon-pulse,
.section-card:hover .icon-pulse {
    animation: iconPulse 0.5s ease;
}

@keyframes iconPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

/* Section card icon animation */
.section-card:hover .section-icon {
    animation: iconBounce 0.6s ease;
}

/* ========================================
   NOTIFICATION BADGE
   ======================================== */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-new {
    background: linear-gradient(135deg, var(--success-400), var(--success-500));
    color: white;
    animation: badgePulse 2s ease infinite;
}

.badge-hot {
    background: linear-gradient(135deg, var(--danger-400), var(--danger-500));
    color: white;
}

.badge-update {
    background: linear-gradient(135deg, var(--primary-400), var(--primary-500));
    color: white;
}

@keyframes badgePulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);
    }
}

/* Dot notification (for icons) */
.notification-dot {
    position: relative;
}

.notification-dot::after {
    content: '';
    position: absolute;
    top: -4px;
    right: -4px;
    width: 10px;
    height: 10px;
    background: var(--danger-500);
    border-radius: 50%;
    border: 2px solid var(--bg-card);
    animation: dotPulse 2s ease infinite;
}

@keyframes dotPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

/* ========================================
   SMOOTH PAGE TRANSITIONS
   ======================================== */
.page-enter {
    opacity: 0;
    transform: translateY(20px);
}

.page-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.page-exit {
    opacity: 1;
    transform: translateY(0);
}

.page-exit-active {
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease-out;
}

/* Improved page transition */
#app {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#app.loading {
    opacity: 0.5;
    transform: scale(0.98);
}

/* ========================================
   ENHANCED BUTTON EFFECTS
   ======================================== */
.btn-glow {
    position: relative;
    overflow: hidden;
}

.btn-glow::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-glow:hover::after {
    width: 300px;
    height: 300px;
}

/* Ripple effect */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::before {
    content: '';
    position: absolute;
    top: var(--ripple-y, 50%);
    left: var(--ripple-x, 50%);
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease, opacity 0.5s ease;
    opacity: 0;
}

.ripple:active::before {
    width: 200px;
    height: 200px;
    opacity: 1;
}

/* ========================================
   TOOLTIP STYLES
   ======================================== */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    padding: 8px 12px;
    background: var(--neutral-800);
    color: white;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
    z-index: 1000;
}

.tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    border: 6px solid transparent;
    border-top-color: var(--neutral-800);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.tooltip:hover::after,
.tooltip:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-10px);
}

.tooltip:hover::before {
    transform: translateX(-50%) translateY(0);
}

/* ========================================
   CARD HOVER ENHANCEMENTS
   ======================================== */
.card-interactive {
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card-interactive:hover {
    transform: translateY(-10px) rotateX(5deg);
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(14, 165, 233, 0.1);
}

/* Tilt effect on mouse move (requires JS) */
.card-tilt {
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

.card-tilt:hover {
    transform: perspective(1000px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
}

/* ========================================
   LOADING STATES
   ======================================== */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--neutral-200);
    border-top-color: var(--primary-500);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-dots {
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: center;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: var(--primary-500);
    border-radius: 50%;
    animation: dotBounce 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0s;
}

@keyframes dotBounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* ========================================
   FOCUS STYLES (Accessibility)
   ======================================== */
:focus-visible {
    outline: 3px solid var(--primary-400);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--primary-400);
    outline-offset: 2px;
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {

    .scroll-progress,
    .fab-container,
    .theme-toggle,
    .scroll-to-top {
        display: none !important;
    }

    body {
        background: white !important;
    }

    .card,
    .section-card,
    .grade-card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}

/* ========================================
   MYTH-BUSTERS STYLES
   ======================================== */
.myth-section {
    margin: var(--spacing-2xl) 0;
    padding: var(--spacing-xl);
    background: rgba(14, 165, 233, 0.03);
    border-radius: var(--radius-xl);
    border: 1px dashed var(--primary-200);
}

.myth-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}

.myth-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid var(--neutral-200);
    position: relative;
    overflow: hidden;
    cursor: help;
}

.myth-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-300);
}

.myth-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--primary-600);
}

.myth-content {
    margin-bottom: var(--spacing-md);
}

.myth-label {
    color: var(--danger-500);
    font-weight: 700;
    font-size: 0.9rem;
    display: block;
    margin-bottom: 4px;
}

.myth-text {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--neutral-800);
    line-height: 1.4;
}

.truth-container {
    background: var(--success-50);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-top: var(--spacing-md);
    border-left: 4px solid var(--success-500);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.4s ease;
    max-height: 0;
    overflow: hidden;
}

.myth-card:active .truth-container,
.myth-card:hover .truth-container {
    opacity: 1;
    transform: translateY(0);
    max-height: 300px;
    margin-top: var(--spacing-md);
}

.truth-label {
    color: var(--success-600);
    font-weight: 700;
    font-size: 0.9rem;
    display: block;
    margin-bottom: 4px;
}

.truth-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--neutral-800);
    display: block;
    margin-bottom: 4px;
}

/* ========================================
   Additional Grade Card Colors & Layout Fixes
   ======================================== */
.grade-card.grade-9 {
    background: linear-gradient(135deg, #4481eb 0%, #04befe 100%) !important;
}

.grade-card.grade-10 {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%) !important;
}

/* Sub-page Compact Layout - Balanced */
.grade-cards.sub-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 30px !important;
    max-width: 900px !important;
    margin-top: 30px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.grade-cards.sub-grid .grade-card {
    aspect-ratio: auto !important;
    min-height: 200px !important;
    height: auto !important;
    width: 100% !important;
}

.grade-cards.sub-grid .grade-card-content {
    padding: 30px !important;
}

.grade-cards.sub-grid .card-icon {
    font-size: 3.5rem !important;
    margin-bottom: 15px !important;
}

.grade-cards.sub-grid .grade-card-title {
    font-size: 1.5rem !important;
    margin-bottom: 5px !important;
}

.grade-cards.sub-grid .grade-card-description {
    font-size: 1rem !important;
    line-height: 1.4 !important;
}


.truth-explanation {
    font-size: 0.95rem;
    color: var(--neutral-600);
    line-height: 1.5;
}

[data-theme="dark"] .myth-card {
    border-color: var(--neutral-700);
}

[data-theme="dark"] .truth-container {
    background: rgba(22, 163, 74, 0.1);
}

[data-theme="dark"] .myth-text,
[data-theme="dark"] .truth-text {
    color: var(--neutral-100);
}

[data-theme="dark"] .truth-explanation {
    color: var(--neutral-300);
}

.myth-hint {
    text-align: center;
    font-size: 0.9rem;
    color: var(--neutral-500);
    margin-top: var(--spacing-sm);
    font-style: italic;
}