/**
 * Modern Minimalist Educational Design System
 * Counselling & Career Guidance Platform
 * Mobile-First, Accessible, Ultra-Clean Aesthetic
 * Fully Supporting Light & Dark Modes + Optical Sinhala/Tamil Typography Tuning
 */

:root {
    /* Color Palette */
    --primary: #0d9488;
    --primary-dark: #0f766e;
    --primary-light: #ccfbf1;
    --primary-subtle: #f0fdfa;
    
    --secondary: #4f46e5;
    --secondary-dark: #4338ca;
    --secondary-light: #e0e7ff;
    
    --accent: #ea580c;
    --accent-light: #ffedd5;
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    /* Theme: Light Mode Defaults */
    --bg-page: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-alt: #f1f5f9;
    --bg-card: #ffffff;
    --bg-card-hover: #ffffff;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-inverted: #ffffff;

    --border-light: #e2e8f0;
    --border-focus: #0d9488;

    --header-bg: rgba(255, 255, 255, 0.88);
    --bottom-nav-bg: rgba(255, 255, 255, 0.94);
    --hero-gradient: radial-gradient(circle at top right, rgba(13, 148, 136, 0.08) 0%, rgba(248, 250, 252, 0) 65%),
                     radial-gradient(circle at bottom left, rgba(79, 70, 229, 0.06) 0%, rgba(248, 250, 252, 0) 50%);

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.09);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    --header-height: 72px;
    --bottom-nav-height: 64px;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-si: 'Noto Sans Sinhala', 'Inter', -apple-system, sans-serif;
    --font-ta: 'Noto Sans Tamil', 'Inter', -apple-system, sans-serif;

    --transition-fast: 0.16s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =========================================================================
   DARK MODE OVERRIDES
   ========================================================================= */
[data-theme="dark"] {
    --bg-page: #0b0f19;
    --bg-surface: #111827;
    --bg-surface-alt: #1a2234;
    --bg-card: #111827;
    --bg-card-hover: #162032;

    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --text-inverted: #0f172a;

    --border-light: #1f293d;
    --border-focus: #14b8a6;

    --primary-subtle: rgba(13, 148, 136, 0.12);
    --primary-light: rgba(13, 148, 136, 0.25);
    --secondary-light: rgba(79, 70, 229, 0.25);

    --header-bg: rgba(17, 24, 39, 0.88);
    --bottom-nav-bg: rgba(17, 24, 39, 0.94);
    --hero-gradient: radial-gradient(circle at top right, rgba(13, 148, 136, 0.15) 0%, rgba(11, 15, 25, 0) 65%),
                     radial-gradient(circle at bottom left, rgba(79, 70, 229, 0.12) 0%, rgba(11, 15, 25, 0) 50%);

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

/* Reset & Box Sizing */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.6;
    letter-spacing: -0.01em;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    transition: background-color var(--transition-base), color var(--transition-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* =========================================================================
   OPTICAL TYPOGRAPHY TUNING FOR SINHALA & TAMIL
   (Solves oversized / overly bold glyph aesthetics)
   ========================================================================= */
html[lang="si"], body[lang="si"], :lang(si) {
    font-family: var(--font-si);
    font-size: 0.96rem;
    letter-spacing: 0.005em;
}

html[lang="ta"], body[lang="ta"], :lang(ta) {
    font-family: var(--font-ta);
    font-size: 0.96rem;
    letter-spacing: 0.005em;
}

/* Modulate heavy bolding in Sinhala & Tamil so letters look sleek & proportionate */
html[lang="si"] h1, html[lang="ta"] h1 {
    font-weight: 600;
    line-height: 1.3;
}
html[lang="si"] h2, html[lang="ta"] h2 {
    font-weight: 600;
    line-height: 1.35;
}
html[lang="si"] h3, html[lang="ta"] h3,
html[lang="si"] h4, html[lang="ta"] h4 {
    font-weight: 600;
    line-height: 1.4;
}

html[lang="si"] .hero-title, html[lang="ta"] .hero-title {
    font-weight: 600;
    letter-spacing: 0.01em;
}

html[lang="si"] .pillar-title, html[lang="ta"] .pillar-title,
html[lang="si"] .article-title, html[lang="ta"] .article-title {
    font-weight: 600;
    font-size: 1.1rem;
    line-height: 1.45;
}

html[lang="si"] p, html[lang="ta"] p {
    line-height: 1.72;
    font-weight: 400;
}

/* Standard Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

h1 { font-size: clamp(1.75rem, 3.8vw, 2.65rem); }
h2 { font-size: clamp(1.35rem, 2.8vw, 1.95rem); }
h3 { font-size: clamp(1.1rem, 2.2vw, 1.4rem); }
h4 { font-size: 1.1rem; }

p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.65;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* =========================================================================
   HEADER & NAVIGATION (Revamped: Sleek, Floating & Minimalist)
   ========================================================================= */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--header-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-light);
    height: var(--header-height);
    transition: background var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-fast);
}

.site-header.scrolled {
    box-shadow: var(--shadow-sm);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    gap: 0.75rem;
}

/* Brand */
.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    user-select: none;
    flex-shrink: 0;
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary) 0%, #047857 100%);
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.28);
    flex-shrink: 0;
    transition: transform var(--transition-fast);
}

.brand:hover .brand-icon {
    transform: scale(1.05);
}

.brand-icon svg {
    width: 22px;
    height: 22px;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.brand-subtitle {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--primary);
    letter-spacing: 0.02em;
}

/* Desktop Nav (Modern Floating Pill Navigation - Clean & Consistent Width) */
.desktop-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: var(--bg-surface-alt);
    padding: 3px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-light);
    flex-shrink: 0;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    padding: 0.42rem 0.82rem;
    font-size: 0.83rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-link.active {
    color: var(--text-primary);
    background: var(--bg-surface);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .nav-link.active {
    color: #ffffff;
    background: #1f293d;
}

/* Header Actions (Never gets pushed out of view) */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-shrink: 0;
    margin-left: auto;
}

/* Language Switcher (Sleek Minimalist Segmented Control) */
.lang-switcher {
    display: flex;
    align-items: center;
    background: var(--bg-surface-alt);
    padding: 3px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-light);
}

.lang-btn {
    border: none;
    background: transparent;
    padding: 4px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
    line-height: 1;
}

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

.lang-btn.active {
    background: var(--bg-surface);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
    font-weight: 700;
}

[data-theme="dark"] .lang-btn.active {
    background: #1f293d;
    color: #2dd4bf;
}

/* Dark Mode Toggle Button */
.theme-toggle-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border-light);
    background: var(--bg-surface-alt);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-focus);
    transform: rotate(15deg);
}

.theme-toggle-btn svg {
    width: 18px;
    height: 18px;
}

/* =========================================================================
   PAGE TRANSITION SYSTEM (SPA)
   ========================================================================= */
#app-content {
    flex: 1;
    position: relative;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.22s cubic-bezier(0.4, 0, 0.2, 1), transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

#app-content.page-loading-out {
    opacity: 0;
    transform: translateY(8px);
}

#app-content.page-loading-in {
    opacity: 0;
    transform: translateY(-6px);
}

/* Progress bar indicator */
#page-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    z-index: 9999;
    width: 0%;
    transition: width 0.25s ease, opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
}

#page-progress-bar.active {
    opacity: 1;
}

/* =========================================================================
   HERO SECTION
   ========================================================================= */
.hero-section {
    padding: 3.5rem 0 2.5rem;
    background: var(--hero-gradient);
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition-base), border-color var(--transition-base);
}

.hero-inner {
    max-width: 820px;
    margin: 0 auto;
    text-align: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.95rem;
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    margin-bottom: 1.25rem;
    box-shadow: 0 1px 3px rgba(13, 148, 136, 0.12);
}

[data-theme="dark"] .hero-badge {
    color: #2dd4bf;
    background: rgba(13, 148, 136, 0.2);
    border: 1px solid rgba(13, 148, 136, 0.35);
}

.hero-title {
    margin-bottom: 1.15rem;
    color: var(--text-primary);
}

.hero-title span {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-lead {
    font-size: 1.05rem;
    max-width: 640px;
    margin: 0 auto 2rem;
    color: var(--text-secondary);
}

/* Hero Search Bar */
.hero-search-box {
    position: relative;
    max-width: 580px;
    margin: 0 auto 2rem;
}

.hero-search-box input {
    width: 100%;
    padding: 0.95rem 1.25rem 0.95rem 3.25rem;
    font-size: 0.98rem;
    font-family: inherit;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    background: var(--bg-surface);
    color: var(--text-primary);
    box-shadow: var(--shadow-md);
    outline: none;
    transition: all var(--transition-fast);
}

.hero-search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.14), var(--shadow-md);
}

.hero-search-box .search-icon {
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

/* Quick Metrics Row */
.hero-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-top: 2rem;
}

.stat-pill {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: background var(--transition-base), border-color var(--transition-base);
}

.stat-pill .stat-num {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--primary);
    display: block;
    line-height: 1.1;
}

[data-theme="dark"] .stat-pill .stat-num {
    color: #2dd4bf;
}

.stat-pill .stat-label {
    font-size: 0.74rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    margin-top: 0.25rem;
    display: block;
}

/* =========================================================================
   THE 4 PILLARS (CORE CATEGORIES)
   ========================================================================= */
.pillars-section {
    padding: 3.5rem 0;
}

.section-header {
    margin-bottom: 2rem;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
}

.section-subtitle {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary);
    margin-bottom: 0.35rem;
}

.section-title {
    margin: 0;
}

.pillars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
}

.pillar-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.75rem 1.5rem;
    transition: all var(--transition-base);
    position: relative;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.pillar-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(13, 148, 136, 0.4);
    background: var(--bg-card-hover);
}

.pillar-icon-box {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.pillar-icon-box svg {
    width: 24px;
    height: 24px;
}

.pillar-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.65rem;
    line-height: 1.35;
}

.pillar-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.55;
    margin-bottom: 1.25rem;
    flex-grow: 1;
}

.pillar-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
}

.pillar-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--primary);
    font-weight: 600;
}

/* =========================================================================
   PILLAR FILTER BAR
   ========================================================================= */
.pillar-filter-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.5rem 0 1.25rem;
    margin-bottom: 1.5rem;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.pillar-filter-bar::-webkit-scrollbar {
    display: none;
}

.filter-chip {
    white-space: nowrap;
    padding: 0.5rem 1rem;
    font-size: 0.82rem;
    font-weight: 600;
    border: 1px solid var(--border-light);
    background: var(--bg-surface);
    color: var(--text-secondary);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-chip:hover {
    background: var(--bg-surface-alt);
    color: var(--text-primary);
}

.filter-chip.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .filter-chip.active {
    background: var(--primary-dark);
    color: #ffffff;
}

/* =========================================================================
   CARDS & GRIDS (Articles, Resources, Cases)
   ========================================================================= */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

/* Article Card */
.article-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.article-card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.85rem;
    width: fit-content;
}

.audience-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.22rem 0.65rem;
    border-radius: var(--radius-full);
    font-size: 0.73rem;
    font-weight: 600;
    margin-bottom: 0.85rem;
    width: fit-content;
    border: 1px solid var(--border-light);
    line-height: 1.2;
}

.article-title {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 0.65rem;
}

.article-summary {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.55;
    margin-bottom: 1.25rem;
    flex-grow: 1;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--text-muted);
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

/* Resource Card */
.resource-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    transition: all var(--transition-base);
}

.resource-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.resource-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.resource-file-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: #fee2e2;
    color: #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

[data-theme="dark"] .resource-file-icon {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.resource-file-icon svg {
    width: 22px;
    height: 22px;
}

.resource-title {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.25rem;
}

.resource-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1.25rem;
    flex-grow: 1;
}

/* Case Study Card */
.case-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.75rem 1.5rem;
    margin-bottom: 1.5rem;
    transition: all var(--transition-base);
}

.case-card:hover {
    box-shadow: var(--shadow-md);
}

.case-audience-tag {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-surface-alt);
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-sm);
    display: inline-block;
    margin-bottom: 0.75rem;
}

.case-accordion-trigger {
    background: none;
    border: 1px solid var(--border-light);
    padding: 0.65rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    margin-top: 1rem;
    transition: all var(--transition-fast);
}

.case-accordion-trigger:hover {
    background: var(--primary-subtle);
}

.case-solution-box {
    margin-top: 1.25rem;
    padding: 1.25rem;
    background: var(--bg-surface-alt);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary);
    display: none;
}

.case-solution-box.open {
    display: block;
    animation: fadeIn 0.25s ease-out;
}

/* Interactive Tools Grid */
.tool-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.75rem 1.5rem;
    display: flex;
    flex-direction: column;
    transition: all var(--transition-base);
}

.tool-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--secondary);
    transform: translateY(-3px);
}

.tool-badge-time {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

/* Discussion Forum */
.forum-topic-row {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    margin-bottom: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.forum-topic-row:hover {
    border-color: var(--primary);
    background: var(--primary-subtle);
}

.forum-author-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    background: var(--bg-surface-alt);
    color: var(--text-secondary);
}

.forum-author-badge.counsellor {
    background: var(--primary-light);
    color: var(--primary-dark);
}

[data-theme="dark"] .forum-author-badge.counsellor {
    color: #2dd4bf;
    background: rgba(13, 148, 136, 0.25);
}

/* =========================================================================
   FRIENDLY 404 / UNDER CONSTRUCTION PAGE
   ========================================================================= */
.not-found-container {
    padding: 4.5rem 1.25rem;
    text-align: center;
    max-width: 680px;
    margin: 0 auto;
}

.not-found-icon-wrap {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary-subtle);
    border: 2px dashed var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    margin-bottom: 1.75rem;
    animation: gentlePulse 3s infinite ease-in-out;
}

.not-found-icon-wrap svg {
    width: 40px;
    height: 40px;
}

.not-found-title {
    font-size: clamp(1.4rem, 3vw, 1.85rem);
    margin-bottom: 0.85rem;
    color: var(--text-primary);
}

.not-found-lead {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 2rem;
}

.not-found-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    flex-wrap: wrap;
}

@keyframes gentlePulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(13, 148, 136, 0.2); }
    50% { transform: scale(1.05); box-shadow: 0 0 0 12px rgba(13, 148, 136, 0); }
}

/* =========================================================================
   BUTTONS & FORM ELEMENTS
   ========================================================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-full);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    line-height: 1.2;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: white;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.25);
}

.btn-secondary {
    background: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background: var(--secondary-dark);
    color: white;
}

.btn-outline {
    background: var(--bg-surface);
    border-color: var(--border-light);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--bg-surface-alt);
    border-color: var(--text-muted);
}

.btn-sm {
    padding: 0.45rem 0.85rem;
    font-size: 0.78rem;
}

.btn-block {
    width: 100%;
}

/* Form inputs */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.45rem;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-family: inherit;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    color: var(--text-primary);
    outline: none;
    transition: border-color var(--transition-fast);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.12);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

/* =========================================================================
   MODAL DIALOG
   ========================================================================= */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast);
}

.modal-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-dialog {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(16px);
    transition: transform var(--transition-fast);
    border: 1px solid var(--border-light);
}

.modal-backdrop.open .modal-dialog {
    transform: translateY(0);
}

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

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-body {
    padding: 1.5rem;
}

/* =========================================================================
   MOBILE BOTTOM NAVIGATION BAR
   ========================================================================= */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--bottom-nav-height);
    background: var(--bottom-nav-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-light);
    z-index: 45;
    padding: 0 0.5rem;
}

.bottom-nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: 100%;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex: 1;
    height: 100%;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.68rem;
    font-weight: 600;
    transition: color var(--transition-fast);
    cursor: pointer;
}

.bottom-nav-item svg {
    width: 20px;
    height: 20px;
}

.bottom-nav-item.active {
    color: var(--primary);
}

[data-theme="dark"] .bottom-nav-item.active {
    color: #2dd4bf;
}

/* =========================================================================
   FOOTER (Featuring Kasun Rukmaldeniya Link)
   ========================================================================= */
.site-footer {
    background: #0b1120;
    color: #94a3b8;
    padding: 3.5rem 0 2rem;
    margin-top: auto;
    border-top: 1px solid #1e293b;
}

[data-theme="dark"] .site-footer {
    background: #070a12;
    border-top: 1px solid #172033;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2.5rem;
    margin-bottom: 2.5rem;
}

.footer-col h4 {
    color: white;
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.65rem;
}

.footer-links a {
    color: #94a3b8;
    font-size: 0.88rem;
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    padding-top: 1.5rem;
    border-top: 1px solid #1e293b;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.84rem;
}

.author-link {
    color: inherit;
    font-weight: 700;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color var(--transition-fast);
}

.author-link:hover {
    border-bottom-color: currentColor;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================================================
   RESPONSIVENESS (Mobile-First)
   ========================================================================= */
@media (max-width: 1024px) {
    .desktop-nav {
        display: none;
    }

    .mobile-bottom-nav {
        display: block;
    }

    body {
        padding-bottom: var(--bottom-nav-height);
    }

    .hero-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 1.75rem;
    }
}

@media (max-width: 600px) {
    .brand-subtitle {
        display: none;
    }

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

    .stat-pill .stat-num {
        font-size: 1.25rem;
    }
    
    .hero-section {
        padding: 2.5rem 0 1.5rem;
    }
}

/* =========================================================================
   INTERACTIVE TOOLS: BOX BREATHING PACER & QUIZ ENHANCEMENTS
   ========================================================================= */
.breathing-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    text-align: center;
    margin: 2rem 0;
}

.breathing-orb-wrapper {
    position: relative;
    width: 240px;
    height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2rem 0;
}

.breathing-orb {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--primary) 0%, rgba(13, 148, 136, 0.4) 100%);
    box-shadow: 0 0 30px rgba(13, 148, 136, 0.35);
    transition: transform 4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.breathing-orb.inhale {
    transform: scale(1.65);
    box-shadow: 0 0 60px rgba(13, 148, 136, 0.6);
}

.breathing-orb.hold {
    transform: scale(1.65);
    box-shadow: 0 0 70px rgba(79, 70, 229, 0.55);
}

.breathing-orb.exhale {
    transform: scale(1.0);
    box-shadow: 0 0 25px rgba(13, 148, 136, 0.2);
}

.breathing-timer-display {
    position: absolute;
    font-size: 2.2rem;
    font-weight: 800;
    color: white;
    text-shadow: 0 2px 6px rgba(0,0,0,0.3);
    pointer-events: none;
}

.breathing-phase-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
    min-height: 2rem;
}

.breathing-phase-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    max-width: 480px;
}

.breathing-controls {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.quiz-option-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 0.65rem;
}

.quiz-option-label:hover {
    border-color: var(--primary);
    background: var(--primary-subtle);
}

.quiz-option-label input[type="radio"] {
    margin-top: 0.25rem;
}
