/* ============================================
   RENDER GUARD - Prevent FOUC
   ============================================ */
html.theme-loading {
    visibility: hidden;
}

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
    /* Brand Colors */
    --color-primary: #8b5cf6;
    --color-primary-dark: #7c3aed;
    --color-primary-light: #a78bfa;
    --color-success: #10b981;
    --color-error: #ef4444;
    --color-warning: #f59e0b;
    
    /* Text Colors */
    --text-primary: #2C3E50;
    --text-secondary: #64748b;
    --text-primary-dark: #e2e8f0;
    --text-secondary-dark: #94a3b8;
    
    /* Backgrounds */
    --bg-light: #f8fafc;
    --bg-dark: #1a1625;
    --bg-code-light: white;
    --bg-code-dark: #0f172a;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    --gradient-background-dark: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    
    /* Effects */
    --transition-standard: all 0.2s;
    --transition-slow: all 0.3s;
    --shadow-purple: 0 2px 8px rgba(139, 92, 246, 0.1);
    --shadow-purple-lg: 0 4px 12px rgba(139, 92, 246, 0.3);
    --shadow-dark: 0 4px 16px rgba(0, 0, 0, 0.3);
    
    /* Spacing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* Layout Dimensions - Responsive widths that shrink on medium screens */
    --ad-column-width: clamp(250px, 25vw, 400px);
    --coach-column-width: clamp(250px, 25vw, 400px);
    --ai-tutor-width: clamp(320px, 35vw, 520px);
    --header-height: 60px;
}


/* ============================================
   MAIN.CSS - Base Styles, Layout & Navigation
   ============================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Atkinson Hyperlegible', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    background: var(--gradient-background);
    height: 100vh; /* Lock to viewport height, not min-height */
    overflow: hidden; /* Prevent page scroll - children should scroll instead */
    display: flex;
    flex-direction: column;
}

/* ============================================
   HEADER - PHASE 2 TYPOGRAPHY SYSTEMIZATION (CORRECTED)
   Professional normalization: font-family, weight, line-height, letter-spacing, icon alignment
   ============================================*/
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;  /* Reduced from 70px for tighter layout */
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    padding: 0 20px;  /* 4px multiple: 20px = 5*4 */
    gap: 20px;  /* 4px multiple: consistent spacing */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    z-index: 100;
    backdrop-filter: blur(4px);
    border-bottom: 1px solid #e2e8f0;
}

/* Header center section: status + mode badge */
.header-center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;  /* 4px multiple */
    flex: 1;  /* Take up remaining space and center content */
}

/* Nav auth section: Sync Progress button + user area */
.nav-auth-section {
    display: flex;
    align-items: center;
    gap: 12px;  /* 4px multiple */
}

.nav-auth-section .btn-primary {
    background: #7c3aed;
    color: white;
    border: none;
    font-weight: 600;
}

.nav-auth-section .btn-primary:hover {
    background: #6d28d9;
    box-shadow: var(--shadow-purple);
}

.nav-user-hidden {
    display: none;
}

/* PHASE 2: Systemized logo typography */
.title {
    font-size: 24px;
    font-weight: 600;
    font-family: 'Atkinson Hyperlegible', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.2; /* Proper line-height for text rendering */
    letter-spacing: -0.02em; /* Professional tracking */
    color: var(--text-primary);
    display: flex;
    align-items: baseline; /* Align to text baseline like writing on a line */
    gap: 15px;
    /* Let flexbox determine natural height based on content */
}

/* Ensure all spans within title align properly */
.title span {
    display: inline-block;
    vertical-align: baseline; /* Sit on the baseline like writing on a line */
    line-height: 1.2; /* Proper line-height for text rendering */
}

.title span span {
    display: inline-block;
    vertical-align: baseline; /* Sit on the baseline like writing on a line */
    line-height: 1.2;
}

/* DEBUG backgrounds removed - use normal styling */

/* PHASE 2: Systemized mode badge typography */
.python-badge {
    display: inline-block;
    background: rgba(139, 92, 246, 0.1);
    color: var(--color-primary-dark);
    padding: 6px 14px;
    margin: 4px 0; /* 4px baseline alignment */
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: 600;
    font-family: 'Atkinson Hyperlegible', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.2; /* Professional line-height */
    letter-spacing: 0.01em; /* Professional tracking for badges */
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.mode-accent {
    color: #3b82f6; /* Blue-500 for good contrast and visibility */
    vertical-align: baseline;
    line-height: inherit;
}

/* PHASE 2: Systemized status indicator typography */
.status-indicator {
    display: inline-block;
    padding: 6px 14px;
    margin: 4px 10px 4px 0; /* 4px baseline alignment */
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: 600;
    font-family: 'Atkinson Hyperlegible', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.2; /* Professional line-height */
    letter-spacing: 0.01em; /* Professional tracking */
}

/* Mobile auth items injected into sidebar - hidden on desktop */
.mobile-auth-item {
    display: none;
}

/* PHASE 2: Systemized nav auth buttons typography */
.nav-auth-section button,
.nav-auth-section .btn-primary {
    font-family: 'Atkinson Hyperlegible', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.2; /* Professional line-height */
    letter-spacing: 0.01em; /* Professional tracking */
    padding: 8px 16px;
    margin: 4px 0; /* 4px baseline alignment */
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition-standard);
}

/* PHASE 2: Icon normalization for all header buttons */
.header button span,
.header .title span,
.menu-btn,
.nav-auth-section button span {
    vertical-align: baseline; /* Align to baseline like writing on a line */
    line-height: inherit;
}

/* PHASE 2: Ensure emoji icons in header have consistent sizing */
.title > span:first-child,
.header button > span:first-child {
    font-size: 20px;
    vertical-align: baseline; /* Align to baseline like writing on a line */
    display: inline-block;
}

.status-ready {
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-loading {
    background: rgba(251, 191, 36, 0.1);
    color: var(--color-warning);
    border: 1px solid rgba(251, 191, 36, 0.2);
}

/* ============================================
   HAMBURGER MENU
   ============================================ */
/* PHASE 2: Systemized menu button typography */
.menu-btn {
    font-size: 20px;
    cursor: pointer;
    padding: 4px 10px; /* Minimal but sufficient padding */
    margin: 0;
    border: none;
    border-radius: 6px;
    background: #f1f5f9;
    color: var(--text-primary);
    font-family: 'Atkinson Hyperlegible', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-weight: 600;
    line-height: 1.2; /* Proper line-height for text rendering */
    letter-spacing: -0.01em;
    transition: var(--transition-standard);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.menu-btn:hover {
    background: #e2e8f0;
    color: var(--color-primary);
}

.menu-panel {
    position: fixed;
    left: -320px;
    top: 0;
    width: 300px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 2px 0 20px rgba(139, 92, 246, 0.15);
    transition: left 0.3s ease;
    z-index: 1000;
    padding: 2rem;
    /* Unified scroll: header → links → auth → dark-mode → progress bar
       all flow as one natural column; the panel itself is the scroll container. */
    overflow-y: auto;
    box-sizing: border-box;
}

.menu-panel.active {
    left: 0;
}

/* Nav links flow naturally within the panel's unified scroll column.
   No flex-pinning or scroll isolation needed — the panel scrolls as a whole. */
.menu-nav-links {}

.menu-header {
    font-size: 22px;
    font-weight: 600;
    /* !important needed to override dynamically-added inline styles */
    color: #5b21b6 !important;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #ede9fe;
    cursor: pointer;
}

.menu-item {
    padding: 14px 18px;
    margin: 10px 0;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition-standard);
    font-size: 18px;
}

.menu-item:hover {
    background: #f5f3ff;
    color: var(--color-primary-dark);
}

.menu-item.active {
    background: rgba(139, 92, 246, 0.1);
    color: var(--color-primary);
    border-left: 4px solid var(--color-primary);
    padding-left: 14px; /* Adjust padding for border */
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: none;
    z-index: 999;
}

.menu-overlay.active {
    display: block;
}

/* ============================================
   LESSONS & CHALLENGES LAYOUT
   ============================================ */
/* ============================================
   PAGE LAYOUT SYSTEM
   ============================================
   Each page mode has a specific grid structure:
   - Challenges: 3 columns (sidebar, content, ads)
   - Lessons: 2 columns (content, ads)
   - IDE: 1 column (full width, internal 2-col grid)
   - AI Tutor: 2 columns (content, ads)
   - GCSE: 1 column (full width content)
   ============================================ */

/* Three-column layout: Sidebar + Content + Ads */
.challenges-page-grid {
    display: grid;
    grid-template-columns: var(--coach-column-width) 1fr var(--ad-column-width);
    gap: 30px;
    flex-grow: 1;
    padding: 30px;
    padding-top: 80px;  /* FIXED: 60px header + 20px gap (consistent with IDE) */
    padding-bottom: 30px;  /* FIXED: Add breathing room at bottom */
    overflow: hidden;
    /* No background - let body gradient show through */
}

/* Two-column layout: Content + Ads (no sidebar) */
.lessons-page-grid {
    display: grid;
    grid-template-columns: 1fr var(--ad-column-width);
    flex-grow: 1;
    padding-top: 80px;  /* FIXED: 60px header + 20px gap */
    padding-bottom: 30px;  /* FIXED: Add breathing room at bottom */
    overflow: hidden;
    /* No background - let body gradient show through */
}

.ai-tutor-grid {
    display: grid;
    grid-template-columns: 1fr var(--ai-tutor-width) var(--ad-column-width); /* IDE | Chat | Ads */
    grid-template-rows: 1fr; /* Single row fills height */
    gap: 20px;
    flex-grow: 1; /* Grow to fill available space like IDE mode */
    min-height: 0; /* Allow flex children to shrink and enable proper scrolling */
    padding: 30px;
    padding-top: 80px;  /* FIXED: 60px header + 20px gap */
    padding-bottom: 30px;  /* FIXED: Add breathing room at bottom */
    overflow: hidden; /* Prevent page scroll */
    align-items: stretch; /* Columns stretch full height */
    /* No background - let body gradient show through */
}

/* Single-column layout: Full width */
.ide-page-grid {
    display: grid;
    grid-template-columns: 1fr;
    flex-grow: 1;
    padding-top: 0;  /* FIXED: Remove double offset - .ide-workstation-grid handles spacing */
    overflow: hidden;
    /* No background - let body gradient show through like Challenge mode */
}

.gcse-page-grid {
    display: grid;
    grid-template-columns: 1fr;
    flex-grow: 1;
    padding-top: 80px;  /* FIXED: 60px header + 20px gap */
    padding-bottom: 30px;  /* FIXED: Add breathing room at bottom */
    overflow: hidden;
    /* No background - let body gradient show through */
}

/* Content Area (1fr) */
.lessons-content,
.gcse-content,
.ide-content,
.ai-content {
    padding: 30px;
    overflow-y: auto;
    background: var(--surface-bg, white);
}

/* Ad Column (300px) */
.ad-column {
    padding: 30px 30px 30px 0;
    overflow-y: auto;
    background: var(--surface-bg, white);
}

/* Sidebar (300px) */
.lesson-sidebar {
    padding: 30px 0 30px 30px;
    overflow-y: auto;
    position: relative; /* Contain absolutely positioned children like progress-bar */
    background: var(--surface-bg, white);
}

/* ============================================
   AD SPACE
   ============================================ */
.partner-box {
    background: var(--bg-light);
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius-lg);
    padding: 30px;
    text-align: center;
    margin-bottom: 20px;
}

.partner-box span {
    display: block;
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 500;
}

.partner-box span:first-child {
    font-size: 32px;
    margin-bottom: 10px;
}

/* ============================================
   GENERAL CONTENT STYLING
   ============================================ */
.lessons-header {
    margin-bottom: 30px;
}

.lessons-header h2 {
    font-size: 32px;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.lessons-header p {
    font-size: 18px;
    color: var(--text-secondary);
}

/* ============================================
   FILTERS
   ============================================ */
.filter-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.filter-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-btn {
    background: var(--bg-code-light);
    color: var(--text-secondary);
    border: 1px solid #cbd5e1;
    padding: 8px 16px;
    border-radius: var(--radius-xl);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition-standard);
}

.filter-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary-dark);
}

/* PHASE 3: Accessible active filter - High-contrast border + Bold text */
.filter-btn.active {
    background: var(--gradient-primary);
    color: white;
    border-color: var(--color-primary);
    border-bottom: 3px solid var(--color-primary-dark);
    font-weight: 700;
    padding-bottom: 6px; /* Compensate for thicker bottom border */
}

/* ============================================
   LESSON CARDS GRID
   ============================================ */
.lesson-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.lesson-card {
    background: var(--bg-code-light);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-purple);
    transition: var(--transition-standard);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 1px solid #ede9fe;
}

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

.lesson-card h3 {
    font-size: 20px;
    color: var(--text-primary);
    margin-bottom: 10px;
    font-weight: 600;
}

.lesson-card p {
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 15px;
    flex-grow: 1;
}

.lesson-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
}

.lesson-card-footer div {
    display: flex;
    gap: 8px;
}

.lesson-card-footer span {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 600;
}

.lesson-category {
    background: rgba(139, 92, 246, 0.1);
    color: var(--color-primary-dark);
}

.lesson-difficulty {
    background: #e2e8f0;
    color: #64748b;
}

/* Completed card: golden border + positioned anchor for the shield badge */
.lesson-card.completed {
    border: 2px solid #d97706; /* Amber-600: achievement gold */
    background: #fffbeb;       /* Amber-50: warm tint */
    opacity: 1;
    position: relative;        /* Anchor for ::after shield badge */
}

/* Gamified shield badge — stamped in the top-right corner */
.lesson-card.completed::after {
    content: '🛡️';
    position: absolute;
    top: -12px;
    right: -10px;
    font-size: 26px;
    line-height: 1;
    transform: rotate(15deg);
    filter: drop-shadow(0 2px 6px rgba(217, 119, 6, 0.55));
    z-index: 2;
    pointer-events: none; /* Badge is decorative only */
}

.lesson-card.completed:hover {
    border-color: #b45309; /* Amber-700: deepen on hover */
    transform: translateY(-5px);
}

.lesson-link {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}

.lesson-link:hover {
    text-decoration: underline;
}

.lesson-link.new {
    background: var(--gradient-success);
    color: white;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    margin-left: 10px;
}

/* ============================================
   PROGRESS BAR
   Natural flow element at the bottom of the unified-scroll menu panel.
   ============================================ */
.progress-bar {
    padding: 1rem 0 0.5rem;
    margin-top: 0.75rem;
}

.progress-label {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.progress-track {
    height: 10px;
    background: #ede9fe;
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-success));
    transition: var(--transition-slow);
}

/* ============================================
   GCSE COVERAGE & UI UTILITIES (Removes inline styles)
   ============================================ */
.coverage-description {
    color: #475569;
    line-height: 1.6;
}

.coverage-note {
    font-style: italic;
    color: #6c757d;
}

.coverage-warning {
    color: #ef4444;
    font-style: italic;
}

.coverage-missing {
    color: #dc2626;
}

.coach-header-flex {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

/* Template-specific: AI Tutor collapses earlier to prevent narrow editor */
@media (max-width: 1400px) {
    .ai-tutor-grid {
        grid-template-columns: 1fr; /* Stack early to keep editor usable */
    }
}

@media (max-width: 1024px) {
    /* CRITICAL: Override global body lock to allow page scroll */
    body {
        height: auto !important;
        overflow-y: auto !important;
    }

    .lessons-page-grid,
    .challenges-page-grid,
    .ide-page-grid,
    .ai-tutor-grid,
    .gcse-page-grid,
    .container,
    .challenge-grid {
        grid-template-columns: 1fr; /* Stack on smaller screens */
    }

    /* FIX: Enable page scroll for IDE mode on mobile */
    /* CRITICAL: Flex properties needed because body has overflow:hidden + flex layout */
    .ide-page-grid {
        flex: 1 1 auto;        /* Allow flex child to grow/shrink */
        min-height: 0;         /* Critical: allow flex child to shrink below content size */
        overflow-y: auto;      /* Create scroll container */
        /* FIX (Bug 2): On desktop, .ide-workstation-grid owns padding-top:90px for
           navbar clearance. On mobile, that inner padding is zeroed out so the grid
           can flow naturally. .ide-page-grid (the outer scroll container) now carries
           the 80px clearance to keep content below the fixed 60px .header. */
        padding-top: 80px;
    }

    /* FIX: Enable page scroll for Challenge mode on tablet/mobile */
    /* CRITICAL: Allow natural page scroll - DO NOT trap content in scroll container */
    #mainContainer.container {
        flex: 1 1 auto;        /* Allow flex child to grow/shrink */
        min-height: 0;         /* Critical: allow flex child to shrink below content size */
        height: auto;          /* Natural height based on content */
        overflow: visible;     /* KILL SCROLL TRAP - page scrolls, not container */
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    }

    .lesson-sidebar {
        padding: var(--radius-xl) var(--radius-xl) 0 var(--radius-xl);
        overflow-y: auto; /* Allow internal scrolling */
        max-height: calc(100vh - var(--header-height) - 60px); /* Constrain to viewport height */
    }

    .ad-column {
        display: none; /* Hide ads on mobile/tablet - unusable at narrow widths */
    }

    .lessons-content,
    .gcse-content,
    .ide-content,
    .ai-content {
        padding: 30px;
    }

    .lessons-header {
        margin-bottom: var(--radius-xl);
    }
}

/* ============================================
   MOBILE NAV AUTH (768px)
   Move auth buttons from header into sidebar
   ============================================ */
@media (max-width: 768px) {
    /* Hide auth section in header (needs !important to beat inline style) */
    .nav-auth-section {
        display: none !important;
    }

    /* Show auth items inside the slide-out sidebar */
    .mobile-auth-item {
        display: flex;
    }
}

@media (max-width: 600px) {
    .header {
        height: 60px;
        padding: 0 15px;
    }

    .title {
        font-size: 20px;
    }

    /* POLISH: Mode badge mobile styling */
    .python-badge {
        font-size: 11px;
        padding: 4px 10px;
        white-space: nowrap;
    }

    .status-indicator {
        font-size: 11px;
        padding: 4px 10px;
        margin-right: 6px;
    }

    .menu-panel {
        width: 250px;
    }

    .lessons-page-grid,
    .challenges-page-grid,
    .ai-tutor-grid,
    .gcse-page-grid {
        padding-top: 80px;  /* FIXED: 60px header + 20px gap */
    }

    .ide-page-grid {
        /* FIX (Bug 2): Was 0 — relied on .ide-workstation-grid's desktop padding-top:90px
           to clear the fixed navbar. On mobile, that inner padding is zeroed out (editor.css
           @media max-width:1024px) so the outer .ide-page-grid must carry the clearance.
           80px = 60px fixed .header height + 20px breathing gap, consistent with all other
           page grids (.lessons-page-grid, .challenges-page-grid, etc.) at this breakpoint. */
        padding-top: 80px;
    }

    .lessons-content,
    .gcse-content,
    .ide-content,
    .ai-content {
        padding: 15px;
    }

    .lesson-sidebar {
        padding: 15px 15px 0 15px;
    }

    .ad-column {
        padding: 15px;
    }
}

/* ============================================
   CHALLENGE EXPECTED OUTPUT BOX
   ============================================ */
.expected-output-box {
    margin-top: 12px;
    padding: 10px;
    background: var(--bg-light);
    border-left: 3px solid var(--color-primary);
    border-radius: var(--radius-sm);
}

.expected-output-box pre {
    margin: 5px 0 0 0;
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
}

/* ============================================
   DEBUG COPY BUTTON (tiny click target on python emoji)
   ============================================ */
.js-copy-debug {
    cursor: pointer;
    user-select: none;
}

.js-copy-debug:hover {
    opacity: 0.7;
}

.js-copy-debug:focus {
    outline: 2px solid var(--color-primary, #8b5cf6);
    outline-offset: 2px;
    border-radius: 2px;
}

/* ============================================
   BUILD STAMP (deployment verification)
   ============================================ */
.build-stamp {
    position: fixed;
    bottom: 8px;
    right: 8px;
    font-size: 11px;
    opacity: 0.4;
    font-family: monospace;
    pointer-events: none;
    color: #64748b;
}

body.dark-mode .build-stamp {
    color: #94a3b8;
}

/* ============================================
   PRO MODE - Ad-Free Layout
   ============================================
   Triggered by adding 'is-pro-user' class to body.
   Removes ad column and adjusts grid layouts to fill space.

   SPECIFICITY STRATEGY:
   - Base rules use class selectors (.challenges-page-grid = 0-1-0)
   - We use body.is-pro-user + ID selectors (1-1-1) to win cleanly
   - NO !important flags needed
   ============================================ */

/* Hide ad columns and partner boxes */
body.is-pro-user .ad-column,
body.is-pro-user #adSpaceBox,
body.is-pro-user .partner-box {
    display: none;
}

/* Override grid layouts using ID selectors for clean specificity win */

/* Challenge Mode: Code | Coach (was: Code | Coach | Ads) */
/* Pro user layout is now the same as base - this override is kept for future customization */
body.is-pro-user #mainContainer.container {
    grid-template-columns: 1fr var(--coach-column-width);
}

/* Challenges Page: Sidebar | Content (was: Sidebar | Content | Ads) */
body.is-pro-user #challengesPage {
    grid-template-columns: var(--coach-column-width) 1fr;
}

/* Lessons Page: Content only (was: Content | Ads) */
body.is-pro-user #lessonsPage {
    grid-template-columns: 1fr;
}

/* AI Tutor: IDE | Chat (was: IDE | Chat | Ads) */
body.is-pro-user #aiTutorPage {
    grid-template-columns: 1fr var(--ai-tutor-width);
}

/* Hide ALL ad placeholders for Pro users (including sidebar ad box) */
body.is-pro-user #adSpaceBox,
body.is-pro-user .partner-box {
    display: none !important;
}
