/* ========================================
   DESIGN SYSTEM — Adjust Maadi
   Inspired by Karnataka's flag, filter coffee amber,
   and the warm glow of 100 Feet Road at night.
   ======================================== */

/* ========================================
   MODULE 1: CSS VARIABLES & BRAND COLORS
   ======================================== */

:root {
    /* Brand Colors — Karnataka / Indiranagar */
    --brand-primary: #E8962E;       /* Filter coffee amber / Karnataka saffron */
    --brand-accent: #CC2936;         /* Karnataka flag red */
    --brand-neutral: #64748B;        /* Slate — urban, modern */
    --brand-gold: #FFD200;           /* Karnataka flag gold */
    --brand-deep: #1A1A2E;           /* Deep Bangalore night */

    /* Semantic Colors */
    --color-success: #10B981;
    --color-error: #EF4444;
    --color-warning: #F59E0B;
    --color-info: #3B82F6;

    /* Surface Colors */
    --surface-glass: rgba(30, 41, 59, 0.7);
    --surface-card: rgba(255, 255, 255, 0.04);
    --surface-card-hover: rgba(255, 255, 255, 0.08);
    --surface-border: rgba(255, 255, 255, 0.08);

    /* Text */
    --text-primary: rgba(255, 255, 255, 0.92);
    --text-secondary: rgba(255, 255, 255, 0.6);
    --text-muted: rgba(255, 255, 255, 0.35);

    /* Spacing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
}

/* Override MkDocs Material primary color */
[data-md-color-scheme="slate"] {
    --md-primary-fg-color: #E8962E;
    --md-accent-fg-color: #CC2936;
    --md-default-bg-color: #0F172A;
    --md-default-fg-color: rgba(255, 255, 255, 0.87);
    --md-typeset-a-color: #E8962E;
}

[data-md-color-scheme="default"] {
    --md-primary-fg-color: #C4751A;
    --md-accent-fg-color: #CC2936;
    --md-typeset-a-color: #C4751A;
    --brand-primary: #C4751A;
    --surface-card: rgba(0, 0, 0, 0.04);
    --surface-card-hover: rgba(0, 0, 0, 0.08);
    --surface-border: rgba(0, 0, 0, 0.1);
    --text-primary: rgba(0, 0, 0, 0.87);
    --text-secondary: rgba(0, 0, 0, 0.6);
    --text-muted: rgba(0, 0, 0, 0.38);
}

/* ========================================
   MODULE 2: TYPOGRAPHY
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Inter:wght@400;500;600&family=Roboto+Mono:wght@400;500&display=swap');

.md-typeset h1,
.md-typeset h2,
.md-typeset h3 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.md-typeset h1 {
    font-size: 2.4rem;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
    margin-bottom: 0.25em;
}

.md-typeset h2 {
    font-size: 1.5rem;
    color: var(--brand-primary);
    border-bottom: 2px solid var(--surface-border);
    padding-bottom: 0.4em;
    margin-top: 2em;
}

/* ========================================
   MODULE 3: PHRASE CARDS
   ======================================== */

.phrase-card {
    background: var(--surface-card);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
    position: relative;
    overflow: hidden;
}

.phrase-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--brand-primary), var(--brand-accent));
    border-radius: 0 2px 2px 0;
}

.phrase-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(232, 150, 46, 0.15);
    border-color: rgba(232, 150, 46, 0.3);
}

.phrase-card.featured {
    background: linear-gradient(135deg, rgba(232, 150, 46, 0.12), rgba(204, 41, 54, 0.08));
    border-color: rgba(232, 150, 46, 0.3);
    grid-column: 1 / -1;
}

.phrase-kannada {
    font-family: 'Outfit', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--brand-primary);
    margin-bottom: 0.15em;
}

.phrase-phonetic {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.8rem;
    color: var(--brand-gold);
    margin-bottom: 0.4em;
    opacity: 0.85;
}

.phrase-english {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 0.3em;
}

.phrase-context {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.phrase-highlight-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

/* Phrase table styling for lesson pages */
.md-typeset table {
    border-collapse: separate;
    border-spacing: 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    width: 100%;
    font-size: 0.9rem;
}

.md-typeset table th {
    background: linear-gradient(135deg, rgba(232, 150, 46, 0.2), rgba(204, 41, 54, 0.1));
    color: var(--brand-primary);
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 0.8rem 1rem;
}

.md-typeset table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--surface-border);
}

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

.md-typeset table tr:hover td {
    background: var(--surface-card-hover);
}

/* ========================================
   MODULE 4: AUDIO BUTTON STYLING
   ======================================== */

.audio-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    background: transparent;
    border: 1.5px solid rgba(232, 150, 46, 0.4);
    border-radius: 20px;
    padding: 0.3em 0.8em;
    font-size: 0.8rem;
    color: var(--brand-primary);
    cursor: pointer;
    transition: all var(--transition-base);
    font-family: 'Roboto Mono', monospace;
}

.audio-btn:hover {
    background: rgba(232, 150, 46, 0.15);
    border-color: var(--brand-primary);
    transform: scale(1.03);
}

.audio-btn.playing {
    background: var(--brand-primary);
    color: white;
    border-color: var(--brand-primary);
}

.audio-btn .audio-icon {
    font-size: 1em;
    transition: transform var(--transition-base);
}

.audio-btn:hover .audio-icon {
    animation: pulse-ring 1s ease infinite;
}

@keyframes pulse-ring {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

/* ========================================
   MODULE 5: TOAST NOTIFICATIONS
   ======================================== */

.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    background: var(--surface-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    padding: 0.8rem 1.2rem;
    min-width: 240px;
    max-width: 340px;
    font-size: 0.85rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.6em;
    pointer-events: auto;
    animation: toast-in var(--transition-base) ease forwards;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.toast.success { border-left: 3px solid var(--color-success); }
.toast.error   { border-left: 3px solid var(--color-error); }
.toast.info    { border-left: 3px solid var(--brand-primary); }
.toast.badge   { border-left: 3px solid var(--brand-gold); }

@keyframes toast-in {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ========================================
   MODULE 6: TOGGLE SWITCHES
   ======================================== */

.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--surface-border);
}

.toggle-label {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--surface-border);
    border-radius: 34px;
    transition: var(--transition-base);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: var(--transition-base);
}

input:checked + .toggle-slider {
    background: var(--brand-primary);
}

input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

/* Lesson completion checkbox */
.lesson-check {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--surface-card);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    margin: 1rem 0;
    user-select: none;
}

.lesson-check:hover {
    border-color: var(--brand-primary);
    background: var(--surface-card-hover);
}

.lesson-check.completed {
    border-color: var(--color-success);
    background: rgba(16, 185, 129, 0.08);
}

.lesson-check-box {
    width: 20px;
    height: 20px;
    border: 2px solid var(--surface-border);
    border-radius: 4px;
    transition: all var(--transition-base);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.lesson-check.completed .lesson-check-box {
    background: var(--color-success);
    border-color: var(--color-success);
    color: white;
}

/* ========================================
   MODULE 7: STATUS HEADER BAR
   ======================================== */

.md-header {
    background: linear-gradient(90deg, #0F172A 0%, #1E293B 100%);
    box-shadow: 0 1px 0 rgba(232, 150, 46, 0.2);
}

.status-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 1rem;
    background: rgba(232, 150, 46, 0.08);
    border-bottom: 1px solid rgba(232, 150, 46, 0.15);
    font-size: 0.78rem;
    color: var(--text-secondary);
    overflow: hidden;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    padding: 0.2em 0.6em;
    background: rgba(255,255,255,0.06);
    border-radius: 20px;
    font-size: 0.75rem;
    white-space: nowrap;
}

.status-pill.rank { color: var(--brand-gold); }
.status-pill.streak { color: var(--brand-accent); }
.status-pill.lessons { color: var(--color-success); }

/* ========================================
   MODULE 8: PROFILE DASHBOARD
   ======================================== */

.profile-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.rank-card {
    background: linear-gradient(135deg, rgba(232, 150, 46, 0.15), rgba(204, 41, 54, 0.1));
    border: 1px solid rgba(232, 150, 46, 0.25);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    text-align: center;
    backdrop-filter: blur(8px);
}

.rank-icon {
    font-size: 3.5rem;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.rank-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--brand-primary);
    margin-bottom: 0.15em;
}

.rank-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.xp-bar-container {
    margin-top: 1rem;
}

.xp-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.4em;
}

.xp-bar {
    height: 8px;
    background: var(--surface-border);
    border-radius: 4px;
    overflow: hidden;
}

.xp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-gold));
    border-radius: 4px;
    transition: width 1s ease;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.stat-box {
    background: var(--surface-card);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    text-align: center;
}

.stat-value {
    font-family: 'Outfit', sans-serif;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--brand-primary);
    line-height: 1;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.2em;
}

/* ========================================
   MODULE 9: BADGE GRID
   ======================================== */

.badge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.badge-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0.5rem;
    background: var(--surface-card);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    text-align: center;
    transition: all var(--transition-base);
    cursor: default;
}

.badge-item.earned {
    background: linear-gradient(135deg, rgba(255, 210, 0, 0.1), rgba(232, 150, 46, 0.08));
    border-color: rgba(255, 210, 0, 0.35);
}

.badge-item.locked {
    opacity: 0.4;
    filter: grayscale(1);
}

.badge-item.earned:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 8px 20px rgba(255, 210, 0, 0.2);
}

.badge-icon {
    font-size: 2rem;
    line-height: 1;
}

.badge-item.locked .badge-icon::after {
    content: '🔒';
    display: block;
    font-size: 0.8rem;
    margin-top: -0.5rem;
}

.badge-name {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    line-height: 1.2;
}

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

.badge-item.earned:hover .badge-icon {
    animation: shimmer 2s linear infinite;
}

/* ========================================
   MODULE 10: WORD OF THE DAY WIDGET
   ======================================== */

.wotd-container {
    background: linear-gradient(135deg, rgba(232, 150, 46, 0.1), rgba(204, 41, 54, 0.07));
    border: 1px solid rgba(232, 150, 46, 0.2);
    border-radius: var(--radius-xl);
    padding: 1.5rem 2rem;
    margin: 2rem 0;
    position: relative;
    overflow: hidden;
}

.wotd-container::before {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(232, 150, 46, 0.2), transparent 70%);
    border-radius: 50%;
}

.wotd-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--brand-primary);
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.wotd-phrase {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.2em;
}

.wotd-phonetic {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.85rem;
    color: var(--brand-gold);
    margin-bottom: 0.4em;
}

.wotd-translation {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.wotd-context {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-style: italic;
    line-height: 1.6;
    border-left: 2px solid rgba(232, 150, 46, 0.3);
    padding-left: 0.75rem;
    margin-bottom: 1rem;
}

.streak-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    background: rgba(204, 41, 54, 0.15);
    border: 1px solid rgba(204, 41, 54, 0.3);
    border-radius: 20px;
    padding: 0.3em 0.75em;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--brand-accent);
}

/* ========================================
   MODULE 11: SHARE MODAL
   ======================================== */

.share-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
}

.share-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.share-modal {
    background: var(--surface-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-xl);
    padding: 2rem;
    max-width: 400px;
    width: 100%;
    transform: scale(0.95);
    transition: transform var(--transition-base);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.share-overlay.open .share-modal {
    transform: scale(1);
}

.share-preview {
    background: linear-gradient(135deg, rgba(232, 150, 46, 0.15), rgba(204, 41, 54, 0.1));
    border: 1px solid rgba(232, 150, 46, 0.2);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin: 1rem 0 1.5rem;
    text-align: center;
}

.share-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    padding: 0.75rem;
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    background: var(--surface-card);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all var(--transition-base);
    text-decoration: none;
}

.share-btn:hover {
    background: var(--surface-card-hover);
    border-color: var(--brand-primary);
    transform: translateY(-1px);
}

.share-btn.whatsapp:hover { border-color: #25D366; color: #25D366; }
.share-btn.twitter:hover  { border-color: #1DA1F2; color: #1DA1F2; }
.share-btn.copy:hover     { border-color: var(--brand-gold); color: var(--brand-gold); }

/* ========================================
   MODULE 12: ACTIVITY HEATMAP
   ======================================== */

.heatmap-container {
    margin: 1.5rem 0;
}

.heatmap-grid {
    display: grid;
    grid-template-columns: repeat(52, 1fr);
    gap: 3px;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.heatmap-cell {
    aspect-ratio: 1;
    min-width: 10px;
    border-radius: 2px;
    background: rgba(255,255,255,0.05);
    transition: transform var(--transition-fast);
    cursor: default;
}

.heatmap-cell:hover {
    transform: scale(1.3);
}

.heatmap-cell[data-level="1"] { background: rgba(232, 150, 46, 0.3); }
.heatmap-cell[data-level="2"] { background: rgba(232, 150, 46, 0.55); }
.heatmap-cell[data-level="3"] { background: rgba(232, 150, 46, 0.75); }
.heatmap-cell[data-level="4"] { background: rgba(232, 150, 46, 1); }

.heatmap-legend {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    justify-content: flex-end;
}

.heatmap-legend-cell {
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

/* ========================================
   MODULE 13: GAME FEATURE CARDS
   ======================================== */

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    margin: 1.5rem 0;
}

.game-card {
    background: var(--surface-card);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all var(--transition-base);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
    position: relative;
    overflow: hidden;
}

.game-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(232, 150, 46, 0.05), transparent);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.game-card:hover {
    border-color: rgba(232, 150, 46, 0.35);
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(232, 150, 46, 0.12);
}

.game-card:hover::before {
    opacity: 1;
}

.game-card-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    display: block;
}

.game-card-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.4em;
}

.game-card-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.game-card-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.difficulty-pill {
    padding: 0.2em 0.6em;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
}

.difficulty-pill.easy   { background: rgba(16, 185, 129, 0.15); color: #10B981; }
.difficulty-pill.medium { background: rgba(245, 158, 11, 0.15); color: #F59E0B; }
.difficulty-pill.hard   { background: rgba(239, 68, 68, 0.15);  color: #EF4444; }

/* ========================================
   MODULE 14: HOMEPAGE COMPONENTS
   ======================================== */

.hero-tagline {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin: -0.5rem 0 1.5rem;
    font-style: italic;
}

.quick-start-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.quick-start-card {
    background: var(--surface-card);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    transition: all var(--transition-base);
}

.quick-start-card:hover {
    border-color: rgba(232, 150, 46, 0.35);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(232, 150, 46, 0.1);
}

.qsc-icon { font-size: 1.75rem; margin-bottom: 0.5rem; }
.qsc-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.35em;
}
.qsc-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0.75rem;
}
.qsc-link {
    display: inline-block;
    color: var(--brand-primary);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: gap var(--transition-fast);
}
.qsc-link:hover { text-decoration: underline; }

/* Lessons overview grid */
.lessons-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.75rem;
    margin: 1.25rem 0;
}

.lesson-tile {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    background: var(--surface-card);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: inherit;
    transition: all var(--transition-base);
}

.lesson-tile:hover {
    border-color: rgba(232, 150, 46, 0.3);
    background: var(--surface-card-hover);
    transform: translateX(3px);
}

.lt-num {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--brand-primary);
    min-width: 2rem;
    opacity: 0.7;
}

.lt-title {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-primary);
    display: block;
}

.lt-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
    margin-top: 0.15em;
}

.see-all-link {
    text-align: right;
    font-size: 0.82rem;
    margin-top: 0.5rem;
}

.see-all-link a {
    color: var(--brand-primary);
    text-decoration: none;
}

.see-all-link a:hover {
    text-decoration: underline;
}

/* ========================================
   MODULE 15: LESSON PAGE COMPONENTS
   ======================================== */

.lesson-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, rgba(232, 150, 46, 0.1), rgba(204, 41, 54, 0.06));
    border-radius: var(--radius-lg);
    border: 1px solid rgba(232, 150, 46, 0.2);
    margin-bottom: 1.5rem;
}

.lesson-num-badge {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    color: var(--brand-primary);
    opacity: 0.5;
    min-width: 3rem;
    line-height: 1;
}

.scenario-box {
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin: 1.25rem 0;
    font-size: 0.88rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.scenario-box::before {
    content: '📍 Scenario: ';
    font-weight: 700;
    color: var(--color-info);
}

.pro-tip {
    background: rgba(16, 185, 129, 0.08);
    border-left: 3px solid var(--color-success);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: 0.9rem 1.1rem;
    margin: 1rem 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.pro-tip::before {
    content: '💡 Pro tip: ';
    font-weight: 700;
    color: var(--color-success);
}

.warning-box {
    background: rgba(239, 68, 68, 0.08);
    border-left: 3px solid var(--color-error);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: 0.9rem 1.1rem;
    margin: 1rem 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.warning-box::before {
    content: '⚠️ Watch out: ';
    font-weight: 700;
    color: var(--color-error);
}

.kanglish-tag {
    display: inline-block;
    background: rgba(232, 150, 46, 0.12);
    border: 1px solid rgba(232, 150, 46, 0.25);
    border-radius: 4px;
    padding: 0 0.4em;
    font-size: 0.75em;
    color: var(--brand-primary);
    font-weight: 600;
    vertical-align: middle;
    margin-left: 0.3em;
}

/* Dialogue / conversation blocks */
.dialogue {
    margin: 1.5rem 0;
    padding: 1.25rem;
    background: var(--surface-card);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
}

.dialogue-line {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    align-items: flex-start;
}

.dialogue-line:last-child { margin-bottom: 0; }

.dialogue-speaker {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    min-width: 4.5rem;
    padding-top: 0.2em;
    color: var(--text-muted);
}

.dialogue-line.you .dialogue-speaker { color: var(--brand-primary); }
.dialogue-line.them .dialogue-speaker { color: var(--brand-accent); }

.dialogue-text {
    flex: 1;
    font-size: 0.9rem;
    line-height: 1.6;
}

.dialogue-kannada {
    font-weight: 600;
    color: var(--text-primary);
}

.dialogue-phonetic {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.78rem;
    color: var(--brand-gold);
    display: block;
}

.dialogue-english {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: block;
    font-style: italic;
}

/* ========================================
   MODULE 16: GLASSMORPHISM PATTERN
   ======================================== */

.glass-card {
    background: var(--surface-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* ========================================
   MODULE 17: RESPONSIVE OVERRIDES
   ======================================== */

@media (max-width: 768px) {
    .md-typeset h1 { font-size: 1.8rem; }

    .phrase-highlight-grid {
        grid-template-columns: 1fr;
    }

    .phrase-card.featured { grid-column: auto; }

    .quick-start-grid {
        grid-template-columns: 1fr 1fr;
    }

    .lessons-overview-grid {
        grid-template-columns: 1fr;
    }

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

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

    .badge-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .heatmap-grid {
        grid-template-columns: repeat(26, 1fr);
    }

    .share-modal {
        padding: 1.5rem;
    }

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

@media (max-width: 480px) {
    .quick-start-grid {
        grid-template-columns: 1fr;
    }

    .share-buttons {
        grid-template-columns: 1fr;
    }

    .wotd-container {
        padding: 1.25rem;
    }

    .wotd-phrase {
        font-size: 1.4rem;
    }
}

/* ========================================
   MODULE 18: UTILITY CLASSES
   ======================================== */

.text-primary   { color: var(--brand-primary); }
.text-accent    { color: var(--brand-accent); }
.text-gold      { color: var(--brand-gold); }
.text-muted     { color: var(--text-muted); }
.text-mono      { font-family: 'Roboto Mono', monospace; }
.text-heading   { font-family: 'Outfit', sans-serif; }

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    padding: 0.65em 1.3em;
    background: linear-gradient(135deg, var(--brand-primary), #D4841F);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(232, 150, 46, 0.35);
    color: white;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    padding: 0.65em 1.3em;
    background: transparent;
    color: var(--brand-primary);
    border: 1.5px solid rgba(232, 150, 46, 0.5);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
}

.btn-secondary:hover {
    background: rgba(232, 150, 46, 0.1);
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

.divider {
    border: none;
    border-top: 1px solid var(--surface-border);
    margin: 2rem 0;
}

/* Scroll to top button */
.md-top {
    background: var(--brand-primary);
    color: white;
    border-radius: 50%;
}

/* Admonitions — customize for the theme */
.md-typeset .admonition {
    border-radius: var(--radius-md);
    border-left-width: 3px;
}

.md-typeset .admonition.tip {
    border-color: var(--brand-primary);
}

.md-typeset .admonition-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
}

/* Nav styling */
.md-nav__item--active > .md-nav__link {
    color: var(--brand-primary);
    font-weight: 600;
}

.md-nav__link:hover {
    color: var(--brand-primary);
}

/* Search */
.md-search__input {
    border-radius: var(--radius-md);
}

/* Footer */
.md-footer {
    background: #0F172A;
    border-top: 1px solid rgba(232, 150, 46, 0.15);
}

/* ========================================
   MODULE: FEATURE CARDS (Games Dashboard)
   ======================================== */

.swalpa-feature-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.swalpa-feature-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--surface-card);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.swalpa-feature-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.swalpa-feature-icon {
    font-size: 48px;
    flex-shrink: 0;
    line-height: 1;
}

.swalpa-feature-content h3 {
    margin: 0 0 4px;
    font-family: 'Outfit', 'Inter', sans-serif;
    font-weight: 700;
    font-size: 18px;
}

.swalpa-feature-content p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

.swalpa-feature-action {
    flex-shrink: 0;
}

.swalpa-button {
    display: inline-block;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    background: var(--brand-primary);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 14px;
    transition: opacity var(--transition-fast), transform var(--transition-fast);
    white-space: nowrap;
}

.swalpa-button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    color: #fff;
}

@media (max-width: 600px) {
    .swalpa-feature-item {
        flex-direction: column;
        text-align: center;
    }
    .swalpa-feature-icon {
        font-size: 36px;
    }
}

/* ========================================
   MODULE: COMPANION LIST
   ======================================== */

.swalpa-companion-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.swalpa-companion-list li a {
    display: block;
    padding: 14px 18px;
    background: var(--surface-card);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    color: var(--brand-primary);
    font-weight: 600;
    text-decoration: none;
    transition: background var(--transition-fast), transform var(--transition-fast);
}

.swalpa-companion-list li a:hover {
    background: var(--surface-card-hover);
    transform: translateX(4px);
}

/* ========================================
   MODULE: PROFILE DASHBOARD
   ======================================== */

.profile-rank-card {
    background: var(--surface-card);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-xl);
    padding: 32px;
    text-align: center;
    margin-bottom: 32px;
}

.profile-rank-emoji { font-size: 56px; margin-bottom: 8px; }
.profile-rank-title {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 28px;
    font-weight: 800;
    color: var(--brand-primary);
    margin-bottom: 4px;
}
.profile-rank-desc { color: var(--text-secondary); font-size: 14px; margin-bottom: 20px; }

.profile-progress-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.profile-progress-bar {
    flex: 1;
    height: 8px;
    background: rgba(255,255,255,0.06);
    border-radius: 4px;
    overflow: hidden;
}

.profile-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-gold));
    border-radius: 4px;
    transition: width 0.6s ease;
}

.profile-progress-label { font-size: 13px; color: var(--text-muted); white-space: nowrap; }

.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.profile-stat {
    background: rgba(255,255,255,0.03);
    border-radius: var(--radius-md);
    padding: 16px 8px;
}

.profile-stat-value {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 24px;
    font-weight: 800;
    color: var(--brand-primary);
}

.profile-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 4px;
}

/* Badges */
.badge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 16px;
    margin-bottom: 32px;
}

.badge-item {
    background: var(--surface-card);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    padding: 16px 12px;
    text-align: center;
    transition: transform var(--transition-fast);
}

.badge-item.unlocked { border-color: rgba(232, 150, 46, 0.3); }
.badge-item.locked { opacity: 0.4; filter: grayscale(0.8); }
.badge-item:hover { transform: translateY(-2px); }

.badge-emoji { font-size: 32px; margin-bottom: 6px; }
.badge-title { font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.badge-desc { font-size: 11px; color: var(--text-muted); line-height: 1.4; }

/* Heatmap */
.heatmap-grid {
    display: grid;
    grid-template-columns: repeat(13, 1fr);
    gap: 3px;
    margin-top: 12px;
}

.heatmap-cell {
    aspect-ratio: 1;
    border-radius: 3px;
    min-width: 0;
}

/* Header Status Bar */
.status-header-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    font-size: 13px;
    white-space: nowrap;
}

.shp-emoji { font-size: 16px; }
.shp-rank { font-weight: 700; color: var(--brand-primary); font-size: 12px; }

.shp-bar-wrapper {
    width: 60px;
    height: 4px;
    background: rgba(255,255,255,0.08);
    border-radius: 2px;
    overflow: hidden;
}

.shp-bar-fill {
    height: 100%;
    background: var(--brand-primary);
    border-radius: 2px;
    transition: width 0.4s ease;
}

.shp-points { font-size: 11px; color: var(--text-muted); }

@media (max-width: 600px) {
    .profile-stats-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .badge-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
    .status-header-bar { display: none; }
}

/* ── Flashcards ── */

.fc-deck {
    max-width: 460px;
    margin: 0 auto;
    perspective: 900px;
}

.fc-card-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 2;
    cursor: pointer;
    margin-bottom: 20px;
}

.fc-card {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 16px;
}

.fc-card.flipped { transform: rotateY(180deg); }

.fc-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 28px 24px;
    text-align: center;
    border: 1px solid rgba(232, 150, 46, 0.15);
}

.fc-front {
    background: linear-gradient(145deg, #1E293B 0%, #0F172A 100%);
}

.fc-back {
    background: linear-gradient(145deg, #1a2236 0%, #162032 100%);
    transform: rotateY(180deg);
    justify-content: flex-start;
    padding-top: 24px;
    text-align: left;
    align-items: flex-start;
    overflow-y: auto;
}

.fc-category {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--brand-primary);
    font-weight: 700;
    margin-bottom: 8px;
}

.fc-front .fc-name {
    font-size: 22px;
    font-weight: 700;
    color: #F8FAFC;
    line-height: 1.3;
}

.fc-front .fc-hint {
    margin-top: 14px;
    font-size: 12px;
    color: rgba(248, 250, 252, 0.35);
}

.fc-back .fc-detail {
    font-size: 14px;
    color: #CBD5E1;
    line-height: 1.65;
    margin-bottom: 6px;
}

.fc-back .fc-detail strong {
    color: var(--brand-primary);
    font-weight: 600;
}

.fc-back .fc-tip {
    margin-top: auto;
    padding-top: 10px;
    font-size: 12px;
    color: rgba(232, 150, 46, 0.75);
    font-style: italic;
    border-top: 1px solid rgba(255,255,255,0.06);
    width: 100%;
}

.fc-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 8px;
}

.fc-btn {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: #F8FAFC;
    border-radius: 10px;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    font-family: inherit;
}

.fc-btn:hover {
    background: rgba(232, 150, 46, 0.15);
    border-color: rgba(232, 150, 46, 0.3);
}

.fc-progress {
    font-size: 13px;
    color: rgba(248, 250, 252, 0.5);
    font-variant-numeric: tabular-nums;
    min-width: 60px;
    text-align: center;
}

.fc-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 24px;
}

.fc-filter {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    color: #94A3B8;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.fc-filter:hover { color: #F8FAFC; border-color: rgba(255,255,255,0.2); }

.fc-filter.active {
    background: rgba(232, 150, 46, 0.15);
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

@media (max-width: 480px) {
    .fc-card-wrapper { aspect-ratio: 4 / 3; }
    .fc-front .fc-name { font-size: 18px; }
    .fc-back .fc-detail { font-size: 13px; }
    .fc-btn { padding: 8px 16px; font-size: 13px; }
}
