﻿:root {
    --primary: #4f46e5;
    --primary-rgb: 79, 70, 229;
    --primary-hover: #4338ca;
    --bg-color: #f8fafc;
    --surface: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --highlight: rgba(var(--primary-rgb), 0.08);
    --correct: var(--primary-solid);
    --incorrect: #ef4444;
    --key-base: #f1f5f9;
    --key-shadow: #cbd5e1;
    --primary-glow: rgba(var(--primary-rgb), 0.4);
    --text-untyped: #94a3b8;
    --typing-area-bg: rgba(255, 255, 255, 0.82);
    --logo-text: var(--primary);
    --surface-rgb: 255, 255, 255;
    --text-primary-rgb: 30, 41, 59;
}

.hidden {
    display: none !important;
}

@font-face {
    font-family: 'Preeti';
    src: url('../assets/fonts/PreetiNormal.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

.preeti-font {
    font-family: 'Preeti', sans-serif !important;
}

[data-theme='dark'] {
    --bg-color: #0d1117;
    --surface: #161b22;
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --border: #30363d;
    --highlight: rgba(var(--primary-rgb), 0.15);
    --key-base: #1e1e1e;
    --key-shadow: #000000;
    --text-untyped: #94a3b8;
    --typing-area-bg: rgba(22, 27, 34, 0.82);
    --logo-text: #ffffff;
    --surface-rgb: 22, 27, 34;
    --text-primary-rgb: 240, 246, 252;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    background-image:
        radial-gradient(circle at top right, var(--highlight), transparent 70%),
        linear-gradient(to bottom, var(--bg-tint, transparent), transparent);
    background-attachment: fixed;
    color: var(--text-primary);
    transition: background 0.6s ease, color 0.3s ease;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: scroll;
}

.fullscreen-promo {
    position: relative;
    max-width: 650px;
    margin: -10px auto 15px auto;
    background: white;
    backdrop-filter: blur(8px);
    color: var(--text-secondary);
    padding: 10px 24px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    border: 1px solid #e2e8f0;
    font-size: 0.85rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: slideDownInner 0.5s ease-out;
}

.fullscreen-promo.hidden {
    height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
    margin-bottom: 0;
    opacity: 0;
    overflow: hidden;
    border: none;
}

.fullscreen-promo kbd {
    background: #f8fafc;
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    border-bottom: 3px solid #cbd5e1;
    font-family: inherit;
    font-weight: 700;
    font-size: 11px;
}

.promo-close {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0 5px;
    transition: color 0.2s;
}

.promo-close:hover {
    color: white;
}

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

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

.app-container {
    max-width: 1480px;
    /* Increased to reduce wide screen margins */
    margin: 0 auto;
    padding: 10px 20px 10px 20px;
    /* Reduced side padding from 20px to 12px */
    width: 100%;
    height: 100vh;
    /* Fallback */
    height: 100svh;
    /* Stable Viewport Height */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    /* Changed from space-between to avoid forced spacing */
    box-sizing: border-box;
    overflow: hidden;
}

@media (max-height: 800px) {
    .app-container {
        padding: 5px 15px 0 15px;
        /* Minimal padding for laptops */
    }

    .main-content {
        gap: 10px;
        /* Tighter gaps */
    }

    .typing-area-wrapper {
        height: 140px;
        /* Compress typing area slightly */
        padding: 8px 20px;
    }

    .global-dashboard-bottom {
        padding: 8px 20px;
        /* Slimmer dashboard */
        margin-top: 5px;
        /* Less push */
    }

    /* Scale down keyboard to fit */
    .keyboard-section {
        transform: scale(0.9);
        transform-origin: bottom center;
        margin-top: -10px;
        /* Pull up to compensate scale */
    }
}

body.is-fullscreen .app-container {
    justify-content: space-between;
    padding: 10px 8px 10px 8px;
    /* Greatly reduced top/bottom padding */
    /* Consistent side padding */
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex: 1;
    justify-content: flex-start;
    padding-top: 10px;
    overflow: hidden;
    /* Reverted per request */
}

body.is-fullscreen .main-content {
    gap: 15px;
    /* Reduced gap between elements */
    padding-top: 5px;
    /* Minimal top padding */
    /* Moves typing area higher up */
}

/* SECTION MANAGEMENT */
.mode-section {
    display: none;
    flex-direction: column;
    width: 100%;
    animation: fadeIn 0.4s ease-out;
}

.mode-section.active {
    display: flex;
}

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

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

/* FREE ZONE SETUP */
.free-zone-setup {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    padding: 24px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
    max-width: 650px;
    width: 95%;
    margin: 15px auto;
    /* Tighter margin for 1 viewport */
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.free-zone-setup h3 {
    font-family: 'Tiro Devanagari Hindi', serif;
    font-size: 1.6rem;
    color: var(--primary);
    margin: 0;
}

.free-zone-setup p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 5px;
}

#free-text-input {
    width: 100%;
    height: 120px;
    /* Shorter to fit viewport */
    background: rgba(241, 245, 249, 0.5);
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 15px;
    font-family: 'Preeti', sans-serif;
    font-size: 1.2rem;
    resize: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-primary);
    line-height: 1.6;
}

#free-text-input:focus {
    outline: none;
    background: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.free-writing-placeholder {
    color: var(--text-secondary);
    font-style: italic;
    font-family: 'Tiro Devanagari Hindi', serif;
    font-size: 1.5rem;
    opacity: 0.6;
    position: absolute;
    top: 50%;
    left: 40px;
    transform: translateY(-50%);
    pointer-events: none;
    user-select: none;
    z-index: 0;
}

/* --- MODERN GLASS HEADER --- */
.glass-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    margin: 10px auto 20px auto;
    z-index: 1000;
    max-width: 1420px;
    width: 98%;
    background: #ffffff;
    /* User request: White nav for light mode */
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(var(--primary-rgb), 0.15);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 10px;
}

[data-theme='dark'] .glass-header {
    background: rgba(22, 27, 34, 0.9);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.mobile-hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--primary);
    padding: 8px;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s;
}

.mobile-hamburger:hover {
    background: var(--highlight);
}

.mobile-hamburger .menu-icon {
    width: 24px;
    height: 24px;
}

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

.logo {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--logo-text, var(--primary));
    background: var(--logo-bg, transparent);
    padding: 8px 16px;
    border-radius: 14px;
    font-family: 'Inter', sans-serif;
    letter-spacing: -0.03em;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logo:hover {
    transform: translateY(-1px);
}

.logo:active {
    transform: scale(0.98);
}

.logo .highlight {
    font-family: 'Tiro Devanagari Hindi', serif;
    color: inherit;
    padding: 0;
    display: inline-block;
    /* Nudge down to center with English text */
    transform: translateY(4px);
    filter: drop-shadow(0 2px 4px var(--primary-glow));
}

/* Nav Pills - Modern Minimalist Style */
.nav-pills {
    display: flex;
    background: transparent;
    /* Removed grey background */
    padding: 5px;
    border-radius: 14px;
    gap: 16px;
    /* Slightly more gap for the new style */
}

.nav-pill {
    position: relative;
    border: none;
    background: none;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    /* Bolder for prominence */
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.nav-pill.active {
    background: transparent;
    /* No background color */
    color: var(--primary);
    transform: translateY(-3px) scale(1.05);
    /* "Pop up" effect */
    text-shadow: 0 4px 10px var(--primary-glow);
}

/* Selected underline for main nav */
.nav-pill.active::after {
    content: '';
    position: absolute;
    bottom: 0px;
    left: 4px;
    right: 4px;
    height: 3px;
    background: var(--primary);
    border-radius: 10px;
    box-shadow: 0 2px 8px var(--primary-glow);
    animation: slideInWidth 0.3s ease;
}

/* Lesson Trigger */
/* --- QUICK NAV IN HEADER --- */
.quick-nav-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quick-nav-btn {
    background: transparent;
    border: 1px solid #e2e8f0;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.quick-nav-btn:hover {
    background: #4f46e5;
    color: white;
    border-color: #4f46e5;
}

.lesson-trigger-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    background: transparent;
    border: none;
    padding: 10px 16px;
    cursor: pointer;
    transition: all 0.2s;
}

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

.lesson-trigger-btn .text-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1 1 auto;
    /* Allow to expand */
    min-width: 0;
    /* Allow shrinking */
}

.lesson-trigger-btn .label {
    font-size: 10px;
    text-transform: uppercase;
    color: #94a3b8;
    font-weight: 800;
    letter-spacing: 0.05em;
}

.lesson-trigger-btn .value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    /* Removed max-width to show full title */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Mobile nav trigger hidden by default */
.mobile-nav-trigger {
    display: none;
}

/* --- SECONDARY NAVIGATION BAR (UNIFIED) --- */
.secondary-nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    padding: 8px 12px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    margin: 0 auto 12px auto;
    z-index: 110;
    flex-wrap: nowrap;
    gap: 8px;
    max-width: 1380px;
    width: 100%;
}

.secondary-nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 8px;
}

.nav-left-curriculum {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.nav-section-group {
    display: flex;
    gap: 2px;
}

.quick-add-lesson-btn {
    background: var(--highlight);
    color: var(--primary);
    border: 1px dashed var(--primary);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    font-weight: 700;
    transition: all 0.2s;
    margin-left: 8px;
}

.quick-add-lesson-btn:hover {
    background: var(--primary);
    color: white;
    border-style: solid;
    transform: scale(1.05);
}

/* Center Lesson Focus */
.nav-center-lesson {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    padding: 6px 12px;
    border-radius: 16px;
    border: 1px solid var(--border);
    flex: 2;
    /* Increased weight to stretch more */
    min-width: 0;
    justify-content: space-between;
}

.active-lesson-glow {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    justify-content: center;
    min-width: 0;
}

.l-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    /* Allow it to take full width and show long titles */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    flex: 1;
}

/* --- VIEW TOGGLE CONTROLS --- */
.view-toggle-group {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    padding: 6px;
    border-radius: 16px;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.view-toggle-btn {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    text-decoration: none;
}

.view-toggle-btn:hover {
    background: var(--highlight);
    color: var(--primary);
    transform: translateY(-1px);
}

.view-toggle-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.toggle-icon {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

/* See More Button (Special Styling) */
.see-more-btn {
    width: auto;
    padding: 0 14px;
    gap: 8px;
    background: var(--highlight);
    color: var(--primary);
    border: 1px solid var(--primary-glow);
}

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

.see-more-text {
    font-size: 13px;
    font-weight: 700;
}

/* Aligned to dashboard far right reset */
.nav-far-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
}

.mini-xp-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 180px;
}

.xp-bar-mini {
    width: 100%;
    height: 4px;
    background: var(--primary-glow);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 2px;
}

[data-theme='dark'] .xp-bar-mini {
    background: rgba(255, 255, 255, 0.05);
}

.xp-fill-mini {
    height: 100%;
    background: var(--primary-solid);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.xp-info-tiny {
    font-size: 9px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Global Dashboard Bottom (Relocated) */
.global-dashboard-bottom {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 40px;
    margin: 10px auto;
    /* Normal spacing, stops pushing down */
    padding: 12px 30px;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    width: 100%;
    max-width: 1380px;
    /* Aligned to hands scale */
    flex-shrink: 0;
}

[data-theme='dark'] .global-dashboard-bottom {
    background: rgba(38, 38, 38, 0.6);
    /* Slightly lighter grey */
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

/* Dashboard Stat Items */
.mini-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.m-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: center;
}

.m-value {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--primary);
    /* Use the theme color */
    font-family: 'Inter', sans-serif;
    line-height: 1.2;
    text-shadow: 0 2px 10px var(--primary-glow);
    /* Subtle glow to pop */
}

.global-dashboard-bottom .nav-stats-group {
    border: none;
    margin: 0;
    padding: 0;
    gap: 30px;
}

.global-dashboard-bottom .mini-xp-group {
    width: 200px;
}

[data-theme='dark'] .secondary-nav-container {
    background: #121212;
    border-color: #262626;
}

[data-theme='dark'] .nav-center-lesson {
    background: #1e1e1e;
    border-color: #262626;
}

.nav-far-right {
    margin-left: 10px;
    padding-left: 10px;
    border-left: 1px solid var(--border);
    display: flex;
    align-items: center;
}

.reset-btn-link {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    position: relative;
}

.reset-btn-link:hover {
    color: #ef4444;
    background: transparent;
    /* Removed background */
    transform: translateY(-3px) scale(1.1);
    /* Pop up effect */
}

/* Underline for reset on hover */
.reset-btn-link:hover::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 8px;
    right: 8px;
    height: 3px;
    background: #ef4444;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
    animation: slideInWidth 0.3s ease;
}

.reset-icon-svg {
    width: 20px;
    height: 20px;
}

.undo-btn-pill {
    background: #10b981;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    text-transform: uppercase;
    animation: undoPulse 2s infinite;
}

@keyframes undoPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Security Modal */
.security-modal {
    text-align: center;
    max-width: 400px;
    width: 95%;
    /* Fluid width for mobile */
}

.security-warning-icon {
    font-size: 48px;
    margin-bottom: 20px;
    display: block;
}

.btn-danger-locked {
    background: #ef4444;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    opacity: 1;
    transition: all 0.3s;
}

.btn-danger-locked:disabled {
    background: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
}

[data-theme='dark'] .btn-danger-locked:disabled {
    background: #262626;
    color: #525252;
}

.reset-footer {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
}

.nav-dropdown {
    position: relative;
}

.dropdown-trigger {
    background: transparent;
    border: 1px solid transparent;
    padding: 8px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.dropdown-trigger:hover {
    color: var(--primary);
    /* Removed background hover */
}

.nav-dropdown.open .dropdown-trigger,
.nav-dropdown.active .dropdown-trigger {
    background: transparent;
    /* No background hover */
    color: var(--primary);
    transform: translateY(-2px) scale(1.02);
    /* Pop up effect */
}

.nav-dropdown.active .dropdown-trigger {
    position: relative;
    padding-bottom: 14px;
}

.nav-dropdown.active .dropdown-trigger::after {
    content: '';
    position: absolute;
    bottom: 6px;
    left: 14px;
    right: 14px;
    height: 3px;
    background: var(--primary);
    border-radius: 10px;
    animation: slideInWidth 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInWidth {
    from {
        opacity: 0;
        transform: scaleX(0);
    }

    to {
        opacity: 1;
        transform: scaleX(1);
    }
}

.dropdown-content {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    width: 260px;
    max-height: 350px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2000;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-dropdown.open .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    padding: 8px 12px;
    border-radius: 10px;
    transition: all 0.2s;
    cursor: pointer;
}

.dropdown-item:hover {
    background: #f8fafc;
}

.dropdown-item.active {
    background: #f5f3ff;
    border: 1px solid #ddd6fe;
}

.d-lesson-id {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.d-keys-big {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    font-family: 'Preeti', 'Tiro Devanagari Hindi', serif;
}

.d-item-meta {
    display: none;
    /* Hide previous meta if still in HTML */
}

.d-module-tag {
    font-size: 9px;
    font-weight: 800;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Hands inside dropdown items */
.mini-hands-row {
    display: flex;
    gap: 8px;
    opacity: 0.7;
}

.mini-hand-tiny {
    display: flex;
    gap: 2px;
    align-items: flex-end;
}

.mini-finger-tiny {
    width: 3px;
    height: 8px;
    background: #cbd5e1;
    border-radius: 1px;
}

.mini-finger-tiny.active {
    background: var(--primary);
}

/* Quick Nav Buttons (Small) */
.quick-nav-btn {
    background: white;
    border: 1px solid #e2e8f0;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 11px;
}

.quick-nav-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Header Actions & Theme Toggle */
.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.theme-toggle-btn {
    background: var(--key-base);
    border: 1px solid var(--border);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.theme-toggle-btn:hover {
    transform: rotate(15deg) scale(1.1);
    background: var(--highlight);
    border-color: var(--primary);
}

.google-signin-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    border: 1px solid #e2e8f0;
    padding: 8px 16px;
    border-radius: 12px;
    color: #475569;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.google-signin-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
}

.google-icon {
    width: 18px;
    height: 18px;
}

.user-profile-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--highlight);
    border: 2px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--primary);
}

.user-profile-circle.hidden {
    display: none;
}

.user-profile-circle:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(79, 70, 229, 0.3);
}

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

[data-theme='dark'] .google-signin-btn {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

[data-theme='dark'] .google-signin-btn:hover {
    background: #334155;
}

[data-theme='dark'] .user-profile-circle {
    background: #312e81;
    border-color: #4f46e5;
    color: #f1f5f9;
}

/* ADMIN MODE STYLES */
.admin-toggle-btn {
    background: var(--key-base);
    border: 1px solid var(--border);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.admin-toggle-btn:hover {
    background: var(--highlight);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
}

.admin-icon {
    width: 20px;
    height: 20px;
}

.modal-content.extra-wide {
    width: 900px;
    max-width: 95vw;
    height: 80vh;
    display: flex;
    flex-direction: column;
}

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

.admin-actions-top {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.btn-danger-outline {
    background: rgba(239, 68, 68, 0.05);
    /* Very light red tint */
    color: #ef4444;
    /* tailwind red-500 */
    border: 1.5px solid rgba(239, 68, 68, 0.2);
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-danger-outline:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
    transform: translateY(-1px);
}

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

.btn-danger-outline:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f1f5f9;
    color: #94a3b8;
    border-color: #e2e8f0;
}

.btn-danger-outline.ready {
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

.modal-content.destructive {
    border-top: 4px solid #ef4444;
}

.admin-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
}

.admin-lesson-list-header {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.admin-lesson-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.admin-lesson-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.2s;
}

.admin-lesson-card:hover {
    border-color: var(--primary);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
}

.alc-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.alc-title {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.4;
}

.alc-category {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 6px;
    background: var(--highlight);
    color: var(--primary);
    font-weight: 800;
}

.alc-preview {
    font-size: 12px;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 34px;
}

.alc-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.alc-btn {
    flex: 1;
    padding: 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.alc-btn.edit {
    background: var(--highlight);
    color: var(--primary);
    border: 1px solid transparent;
}

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

.alc-btn.delete {
    background: #fef2f2;
    color: #ef4444;
    border: 1px solid transparent;
}

.alc-btn.delete:hover {
    background: #ef4444;
    color: white;
}

.btn-close-circle {
    background: var(--key-base);
    border: 1px solid var(--border);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-secondary);
}

.btn-close-circle:hover {
    background: var(--incorrect);
    color: white;
    border-color: var(--incorrect);
}

/* Stats in header */
.stats-dashboard-compact {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-stats-group {
    display: flex;
    gap: 16px;
    padding: 0 16px;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    margin: 0 16px;
}

.mini-stat {
    display: flex;
    flex-direction: column;
    min-width: 50px;
    gap: 0;
}

.m-label {
    font-size: 8px;
    text-transform: uppercase;
    font-weight: 800;
    color: #94a3b8;
    letter-spacing: 0.05em;
    line-height: 1;
}

.m-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: normal;
}

/* Mini XP */
.mini-xp-group {
    width: 160px;
}

.xp-info-tiny {
    display: flex;
    justify-content: flex-end;
    font-size: 10px;
    font-weight: 800;
    color: #64748b;
    margin-bottom: 4px;
}

.xp-bar-mini {
    height: 6px;
    background: #f1f5f9;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

/* Scrollbar */
.explorer-overlay::-webkit-scrollbar {
    width: 8px;
}

.explorer-overlay::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.explorer-overlay::-webkit-scrollbar-track {
    background: transparent;
}

.dropdown-scroll-list::-webkit-scrollbar-track {
    background: transparent;
}

.dropdown-scroll-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.drill-link.action-link {
    color: var(--primary);
    font-weight: 600;
}

.lesson-item-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 14px;
    border-radius: 6px;
    transition: all 0.1s;
    font-family: 'Preeti', sans-serif;
    /* Show title in Preeti */
    cursor: pointer;
}

.lesson-item-link:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.lesson-item-link.active {
    background: var(--highlight);
    color: var(--primary);
}

.lesson-item-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.lesson-item-link:hover .lesson-item-actions {
    opacity: 1;
}

.mini-btn {
    font-family: 'Inter', sans-serif;
    /* Buttons need standard font */
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    background: #e2e8f0;
    color: #475569;
}

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

.mini-btn.delete:hover {
    background: var(--wrong);
}

/* Typing Area Controls */

.typing-area-actions {
    position: absolute;
    top: 10px;
    right: 15px;
    display: flex;
    gap: 8px;
    z-index: 20;
}

.copy-btn,
.clear-btn {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.copy-btn:hover,
.clear-btn:hover {
    background: var(--primary);
    color: white;
    border-color: transparent;
}

.clear-btn:hover {
    background: #ef4444;
}

/* Button States for Clear Logic */
.clear-btn.btn-warning {
    background: #f59e0b;
    /* Amber for Confirm? */
    color: white;
    border-color: #f59e0b;
}

.clear-btn.btn-warning:hover {
    background: #d97706;
}

.clear-btn.btn-undo {
    background: #3b82f6;
    /* Blue for Undo */
    color: white;
    border-color: #3b82f6;
    width: 80px;
    /* Prevent jitter on timer tick */
}

.clear-btn.btn-undo:hover {
    background: #2563eb;
}

/* Old dropdown styles removed */

.drill-link {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    text-decoration: none;
    color: #475569;
    font-size: 14px;
    border-radius: 8px;
    transition: all 0.2s;
    font-weight: 500;
}

.drill-link:hover {
    background: #f1f5f9;
    color: var(--primary);
    padding-left: 16px;
    /* Subtle slide effect */
}

/* NAV ACTIONS (Right Side) */
.nav-actions {
    display: flex;
    gap: 12px;
}

nav {
    display: flex;
    gap: 8px;
    background: rgba(241, 245, 249, 0.5);
    padding: 4px;
    border-radius: 14px;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-btn span {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.nav-btn:hover span {
    transform: scale(1.2);
}

.nav-btn.active {
    background: #ffffff;
    color: var(--primary);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.nav-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.3);
    color: var(--text-primary);
}

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

/* Layout Toggle Switch */
.layout-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-right: 20px;
    background: rgba(255, 255, 255, 0.5);
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

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

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-radius: 50%;
}

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

input:checked+.slider:before {
    transform: translateX(18px);
}

/* Small Variant for Inline Toggles */
.switch.small {
    width: 34px;
    height: 18px;
}

.switch.small .slider:before {
    height: 12px;
    width: 12px;
    left: 3px;
    bottom: 3px;
}

.switch.small input:checked+.slider:before {
    transform: translateX(16px);
}

/* Stats */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 40px;
    background: var(--surface);
    padding: 10px 20px;
    border-radius: 16px;
    box-shadow: 0 2px 4px rgb(0 0 0 / 0.05);
    max-width: 1380px;
    /* Aligned to hands scale */
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    transition: all 0.3s ease;
}

[data-theme='dark'] .stats-bar {
    background: rgba(38, 38, 38, 0.6);
    /* Matching the bottom dashboard grey */
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-item .label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.stat-item .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-secondary);
    /* Changed to gray per request */
}

/* Typing Area */
.typing-area-wrapper {
    position: relative;
    background: var(--typing-area-bg);
    backdrop-filter: blur(16px);
    padding: 10px 24px;
    border-radius: 24px;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.05), 0 8px 10px -6px rgb(0 0 0 / 0.05);
    height: 160px;
    overflow: hidden;
    display: block;
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    scroll-behavior: smooth;
    position: relative;
    flex-shrink: 0;
    max-width: 1380px;
    /* Aligned to hands scale */
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

#text-display {
    position: relative;
    width: 100%;
    height: 100%;
    font-size: 2.8rem;
    line-height: 1.6;
    font-family: 'Preeti', sans-serif;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    padding: 0;
    /* Managed by layers-container */
    cursor: default;
    scroll-behavior: smooth;
    /* Cinematic scrolling for lyrics */
}

/* Container to hold both layers and manage centering */
.layers-container {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    padding: 3rem 2rem;
}

/* Teleprompter Mode: Active line always in center */
.layers-container.lyrics-mode {
    padding-top: 40vh;
    /* Start first line in center */
    padding-bottom: 40vh;
    /* Allow last line to center */
    line-height: 3.5;
    /* Dramatic poetical spacing */
}

/* Both layers occupy the same grid cell for perfect overlap */
.ghost-layer,
.typed-layer {
    grid-area: 1 / 1;
    word-wrap: break-word;
    white-space: pre-wrap;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    pointer-events: none;
    user-select: none;
}

.ghost-layer {
    color: #cbd5e1;
    /* Light slate grey ghost */
    z-index: 1;
}

.typed-layer {
    color: var(--primary-solid);
    z-index: 2;
    text-align: inherit;
}

.cursor-ghost {
    display: inline-block;
    width: 2px;
    height: 1.1em;
    background: var(--primary);
    vertical-align: text-bottom;
    margin-left: -1px;
    animation: blink 1s infinite;
}

/* Error feedback: highlights on the ghost layer or a separate layer? 
   Let's keep it simple: the ghost layer stays constant. Typed layer shows progress. */

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

#text-display.centered-text .char {
    display: inline-block;
}

#text-display::-webkit-scrollbar {
    display: none;
}

/* Text Display Basic Styling - Single Layer "Coloring Book" Mode */
#text-display .char {
    color: #94a3b8;
    transition: color 0.1s ease;
    display: inline-block;
    min-width: 0.3em;
}

/* Force line break for newlines - using inline with pre-wrap for perfect single breaks */
.char.newline {
    display: inline;
    white-space: pre;
    pointer-events: none;
}

/* Lyrics Mode: Each line is centered independently */
#text-display.lyrics-mode {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-content: flex-start;
    /* Start from top, scroll will center current */
    justify-content: center;
    text-align: center;
    line-height: 2.2;
    /* More space for lyrics */
    padding: 100px 40px;
    /* Large padding to allow centering top/bottom lines */
}

/* Paragraph Mode: Dense block centered */
#text-display.paragraph-mode {
    align-content: center;
    justify-content: center;
    padding: 40px;
}

#text-display .char.correct {
    color: var(--primary-solid);
}

#text-display .char.incorrect {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

#text-display .char.current {
    color: var(--primary-readable);
    border-bottom: 3px solid var(--primary-readable);
    background: var(--highlight);
}

/* Free Mode Overrides */
/* Free Mode Overrides */
.free-writing-placeholder {
    color: #94a3b8;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    font-size: 1.5rem;
    opacity: 0.5;
}

.free-typing-textarea {
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    outline: none;
    resize: none;
    color: var(--primary-solid);
    font-family: 'Preeti', sans-serif;
    font-size: 2.8rem;
    line-height: 1.6;
    padding: 2rem;
    overflow-y: auto;
    text-align: center;
}

.free-typing-textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.4;
    font-size: 1.5rem;
    font-family: 'Inter', sans-serif;
}

#text-display .char.typed-free {
    color: var(--primary-solid);
}

.caps-lock-warning {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 237, 213, 0.7);
    /* Translucent amber */
    color: #c2410c;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(251, 146, 60, 0.2);
    z-index: 100;
    display: none;
    pointer-events: none;
}

.caps-lock-warning.visible {
    display: block;
}

/* Custom Scrollbar for Typing Area */
.typing-area-wrapper::-webkit-scrollbar {
    width: 6px;
}

.typing-area-wrapper::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.typing-area-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--highlight);
}

.restart-btn {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid rgba(var(--primary-rgb), 0.3);
    /* Subtle stroke */
    padding: 8px 18px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Inter', sans-serif;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.key.pressed-correct,
.key.active {
    background: var(--primary);
    color: white;
    transform: translateY(2px);
    box-shadow: 0 2px 10px var(--primary-glow);
}

.key.pressed-correct .key-label,
.key.pressed-correct .key-nepali,
.key.active .key-label,
.key.active .key-nepali {
    color: white;
}

.restart-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    /* Full stroke color on hover */
    transform: translateY(-3px) scale(1.05);
    text-shadow: 0 4px 10px var(--primary-glow);
}


.restart-btn:active {
    transform: translateY(0) scale(1);
}

.text-display {
    font-family: 'Preeti', sans-serif;
    font-size: 2.2rem;
    line-height: 1.8;
    color: var(--text-secondary);
    text-align: left;
    pointer-events: none;
    position: relative;
    width: 100%;
    display: block;
    white-space: pre-wrap;
    /* Better for joining and spaces */
    word-break: break-word;
    letter-spacing: normal;
}

.char {
    display: inline;
    /* Keep natural joining for normal/finished words */
    position: relative;
    transition: all 0.05s;
    color: var(--text-untyped);
    font-size: 2.2rem;
    line-height: 1.8;
    margin: 0;
    padding: 0;
    vertical-align: baseline;
    font-feature-settings: "liga" 1, "clig" 1;
}



/* Ensure no separation during active word typing */
.typed-free {
    font-family: 'Preeti', sans-serif !important;
    color: var(--primary-readable);
    font-size: 2.6rem;
    /* Preeti is often smaller, so slight bump */
    line-height: 1.5;
    letter-spacing: 1px;
}

.char.active-word {
    display: inline;
    margin: 0;
    min-width: 0;
}

/* Only correct characters join naturally with their predecessors */
.char.correct {
    display: inline !important;
    color: var(--correct);
    margin: 0 !important;
    background: transparent;
}

.char.incorrect {
    display: inline;
    color: white;
    background: var(--wrong);
    border-radius: 2px;
    margin: 0;
}

.char.current {
    display: inline;
    position: relative;
    color: var(--primary-readable);
    background: var(--highlight);
    border-radius: 2px;
    margin: 0;
    min-width: 0;
    z-index: 10;
}

.char.current::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary-readable);
    border-radius: 2px;
    /* Removed blinking animation per request */
    z-index: 11;
}

@keyframes blink {

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

    50% {
        opacity: 0.2;
        transform: scaleX(0.8);
    }
}

.cursor {
    display: inline-block;
    width: 3px;
    height: 2.4em;
    /* Increased for Preeti Font */
    /* Adjusted to match large Nepali text */
    background: var(--primary);
    margin-left: 2px;
    vertical-align: text-bottom;
    border-radius: 4px;
    animation: cursor-blink 1.2s infinite;
    box-shadow: 0 0 8px rgba(79, 70, 229, 0.4);
}

/* Hide vertical cursor in Learn Mode (replaced by solid underline) */
.text-display .cursor {
    display: none !important;
}

@keyframes cursor-blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.input-hidden {
    position: absolute;
    opacity: 0;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    cursor: text;
}

/* Keyboard */
/* Keyboard & Hands Wrapper */
.keyboard-section {
    display: flex;
    flex-direction: row;
    /* Horizontal layout: Left Hand | Keyboard | Right Hand */
    align-items: flex-end;
    /* Rest hands on same baseline as keyboard */
    justify-content: center;
    gap: 30px;
    margin-top: auto;
    /* Push keyboard to bottom of container */
    padding-bottom: 20px;
    width: 100%;
    flex-shrink: 0;
}

body.is-fullscreen .keyboard-section {
    margin-top: auto;
    /* Push to absolute bottom in fullscreen */
    padding-bottom: 0px;
}

.keyboard-container {
    background: #e2e8f0;
    padding: 12px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: inset 0 2px 4px rgb(0 0 0 / 0.1);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

/* Keyboard Container Themes */
.keyboard-container.dark-theme {
    background: #1e293b;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3);
}

.keyboard-container.dark-theme .key {
    background: #334155;
    border-bottom-color: #0f172a;
}

.keyboard-container.dark-theme .key-nepali {
    color: #f1f5f9;
}

.keyboard-container.dark-theme .key-label,
.keyboard-container.dark-theme .key-shift {
    color: #94a3b8;
}

.keyboard-container.dark-theme .kb-toggle-group {
    background: rgba(15, 23, 42, 0.5);
    border-color: rgba(255, 255, 255, 0.1);
}

.keyboard-container.dark-theme .toggle-text {
    color: #94a3b8;
}

.keyboard-container.dark-theme .slider {
    background-color: #0f172a;
}

.keyboard-container.dark-theme .key-highlight {
    background: var(--primary) !important;
    border-color: var(--primary-hover) !important;
    box-shadow: 0 0 15px var(--primary-glow);
}

.keyboard-container.dark-theme .key-bg-label {
    color: #f1f5f9;
    opacity: 0;
}

.keyboard-container.dark-theme .key-highlight .key-bg-label {
    opacity: 0;
    /* Only show on press, not highlight in dark mode */
}

/* Ensure letters are visible on highlight in dark mode */
.keyboard-container.dark-theme .key-highlight .key-nepali,
.keyboard-container.dark-theme .key-highlight .key-label,
.keyboard-container.dark-theme .key-highlight .key-shift {
    color: #ffffff !important;
}

.keyboard-container.dark-theme .slider {
    background-color: #0f172a;
}

.kb-toggle-group.side {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 65px;
    /* Slightly narrower to fit comfortably in row */
    background: rgba(255, 255, 255, 0.4);
    padding: 6px 0;
    border-radius: 8px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    transition: all 0.2s ease;
    align-self: center;
}

.keyboard-container.dark-theme .kb-toggle-group.side {
    background: rgba(15, 23, 42, 0.5);
    border-color: rgba(255, 255, 255, 0.1);
}

.toggle-text {
    font-size: 8px;
    /* Slightly smaller for tighter fit */
    font-weight: 800;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    user-select: none;
    text-align: center;
}

/* Hands Visualization */
/* .hands-container removed as they are now direct children */

/* LESSON DRAWER */
.lesson-drawer {
    position: fixed;
    top: 0;
    left: -400px;
    width: 380px;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.lesson-drawer.open {
    left: 0;
}

.drawer-header {
    padding: 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.drawer-header h3 {
    margin: 0;
    color: var(--text-primary);
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-secondary);
}



.lesson-list {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lesson-card {
    padding: 16px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: 0.2s;
}

.lesson-card:hover {
    border-color: var(--primary);
    transform: translateX(5px);
}

.lesson-card.active {
    background: var(--highlight);
    border-color: var(--primary);
}

.lesson-card h4 {
    margin: 0 0 4px 0;
    font-size: 16px;
    color: var(--text-primary);
    font-family: 'Preeti', sans-serif;
}

.lesson-card p {
    margin: 0;
    font-size: 14px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'Preeti', sans-serif;
}

/* MODAL */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

#lesson-modal {
    z-index: 11000;
}

#factory-reset-modal {
    z-index: 20000;
}

.modal.open {
    display: flex;
}

.modal-content {
    background: white;
    width: 500px;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-content.small {
    width: 400px;
    padding: 32px;
    text-align: center;
}

.confirm-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

#confirm-title {
    margin-bottom: 12px;
    color: #1e293b;
    font-size: 1.5rem;
}

#confirm-message {
    color: #64748b;
    margin-bottom: 24px;
    line-height: 1.6;
}

.modal-content.wide {
    width: 700px;
}

.alt-codes-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.alt-codes-table th,
.alt-codes-table td {
    border: 1px solid #e2e8f0;
    padding: 12px;
    text-align: center;
}

.alt-codes-table th {
    background-color: #f8fafc;
    color: var(--text-primary);
    font-weight: 600;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.input-group input,
.input-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Preeti', sans-serif;
}

.input-group textarea {
    height: 150px;
    resize: none;
    font-family: 'Preeti', sans-serif;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}


.theme-popup {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 200px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 10px;
    display: none;
    flex-direction: column;
    gap: 8px;
    z-index: 9999;
    border: 1px solid var(--border);
}

.theme-popup.active {
    display: flex !important;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
}

.keyboard-row {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.key {
    width: 55px;
    height: 55px;
    background: #ffffff;
    border-radius: 6px;
    border-bottom: 3px solid #cbd5e1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: default;
    transition: all 0.1s;
    user-select: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.key-bump::after {
    content: '';
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 3px;
    background: #94a3b8;
    /* Darker grey for visibility */
    border-radius: 2px;
    opacity: 0.8;
}

.key:active,
.key.pressed {
    transform: translateY(3px);
    border-bottom-width: 1px;
    background: #eff6ff;
    box-shadow: inset 0 2px 4px rgb(0 0 0 / 0.05);
}

.key-label {
    position: absolute;
    top: 4px;
    left: 4px;
    font-size: 10px;
    color: #94a3b8;
    font-weight: 700;
    text-transform: uppercase;
    z-index: 2;
}

.key-bg-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
    font-weight: 800;
    color: var(--primary);
    opacity: 0;
    text-transform: uppercase;
    z-index: 1;
    pointer-events: none;
    transition: opacity 0.1s;
}

.key:active .key-bg-label,
.key.pressed-correct .key-bg-label,
.key.pressed-wrong .key-bg-label {
    opacity: 0.4;
    /* High visibility on press */
}

.key-nepali {
    font-size: 18px;
    color: #334155;
    font-family: 'Tiro Devanagari Hindi', serif;
    margin-top: 8px;
    line-height: 1;
    z-index: 2;
}

.key-shift {
    position: absolute;
    top: 2px;
    right: 5px;
    /* Moved slightly left for better spacing */
    font-size: 18px;
    /* Increased from 12px */
    font-weight: 600;
    color: #64748b;
    font-family: 'Tiro Devanagari Hindi', serif;
}

/* MODERN LAYOUT MODE */

.layout-modern .key-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 22px;
    color: #1e293b;
    font-weight: 800;
}

.layout-modern .key-nepali {
    position: absolute;
    top: 4px;
    left: 4px;
    font-size: 12px;
    color: #94a3b8;
    margin-top: 0;
}

.layout-modern .key-shift {
    top: 4px;
    right: 4px;
    font-size: 11px;
    color: #94a3b8;
}

/* Special labels in modern should still be small */
.layout-modern .key-large .key-label,
.layout-modern .key-xlarge .key-label {
    font-size: 12px;
}

/* Key Modifiers */
.key-large {
    width: 80px;
}

.key-xlarge {
    width: 100px;
}

.key-space {
    width: 300px;
}

/* Highlight - The key you are SUPPOSED to press */
.key-highlight {
    background: var(--highlight) !important;
    border-color: var(--primary) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.25);
}

.key-highlight .key-nepali,
.key-highlight .key-label,
.key-highlight .key-shift {
    color: #3730a3 !important;
    /* Darker Blue Text for contrast */
}

/* Pressed States - Feedback on physical tap */
.key.pressed-correct {
    background: var(--primary) !important;
    border-bottom-width: 1px;
    transform: translateY(3px);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2), 0 0 15px var(--primary-glow);
}

.key.pressed-correct * {
    color: white !important;
}

.key.pressed-correct .key-bg-label {
    display: none;
}

.key.pressed-wrong {
    background: #ef4444 !important;
    /* Red */
    border-bottom-color: #b91c1c !important;
    border-bottom-width: 1px;
    transform: translateY(3px);
    animation: shake 0.1s ease-in-out;
}

.key.pressed-wrong .key-bg-label {
    display: none;
}

.key.pressed-wrong * {
    color: white !important;
}

@keyframes shake {

    0%,
    100% {
        transform: translate(0, 3px);
    }

    25% {
        transform: translate(-2px, 3px);
    }

    75% {
        transform: translate(2px, 3px);
    }
}

/* CAPS ACTIVE STATES ON KEYBOARD */
.keyboard.caps-active .key-nepali {
    opacity: 0.3;
}

.keyboard.caps-active .key-shift {
    opacity: 1 !important;
    font-weight: 800;
    color: var(--primary);
    transform: scale(1.1);
}

.hand {
    position: relative;
    width: 240px;
    height: 180px;
    background: linear-gradient(to bottom, #f1f5f9, #e2e8f0);
    border-radius: 40px 40px 20px 20px;
    display: flex;
    justify-content: space-evenly;
    align-items: flex-end;
    padding-bottom: 25px;
    /* Lift fingers slightly */
    box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    margin-top: 20px;
    margin-bottom: 5px;
}

/* Finger Name Display (The floating labels) */
.finger-name-display {
    position: absolute;
    top: -70px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Tiro Devanagari Hindi', serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 14px;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 1);
    pointer-events: none;
    z-index: 10;
}

.finger-name-display.visible {
    opacity: 1;
    top: -60px;
}

/* Dark Mode adjustment for Finger Name Labels */
.keyboard-container.dark-theme~.hand .finger-name-display {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

.palm {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: #e2e8f0;
    border-radius: 0 0 20px 20px;
    opacity: 0.5;
}

.left-hand {
    transform: none;
}

.right-hand {
    transform: none;
}

.finger {
    width: 32px;
    background: #cbd5e1;
    border-radius: 16px 16px 0 0;
    transition: all 0.1s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    transform-origin: bottom center;
    z-index: 2;
}

.finger::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 6px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 4px;
}

.finger.pinky {
    height: 80px;
}

.finger.ring {
    height: 115px;
}

.finger.middle {
    height: 135px;
}

.finger.index {
    height: 110px;
}

.finger.thumb {
    height: 65px;
    width: 44px;
    margin-bottom: 35px;
}

.left-hand .finger.thumb {
    transform: rotate(20deg);
    margin-right: -15px;
}

.right-hand .finger.thumb {
    transform: rotate(-20deg);
    margin-left: -15px;
}

/* ROW-BASED DYNAMIC MOVEMENTS */
.finger.active.active-row-0 {
    transform: translateY(-50px);
    background: var(--primary);
    box-shadow: 0 0 20px var(--highlight);
}

.finger.active.active-row-1 {
    transform: translateY(-25px);
    background: var(--primary);
    box-shadow: 0 0 20px var(--highlight);
}

.finger.active.active-row-2 {
    transform: translateY(-8px);
    background: var(--primary);
    box-shadow: 0 0 20px var(--highlight);
}

.finger.active.active-row-3 {
    transform: translateY(24px);
    background: var(--primary);
    box-shadow: 0 0 20px var(--highlight);
}

/* Space Bar (Thumb) - Move LOWER to tap */
.left-hand .finger.thumb.active.active-row-4 {
    transform: rotate(20deg) translateY(18px);
    /* Moves lower */
    background: var(--primary);
}

.right-hand .finger.thumb.active.active-row-4 {
    transform: rotate(-20deg) translateY(18px);
    /* Moves lower */
    background: var(--primary);
}

/* Finger Active State Fallback */
.finger.active {
    background: var(--primary);
    box-shadow: 0 0 20px var(--highlight);
}

.finger.intensity-90 {
    opacity: 0.6;
    background: #cbd5e1;
    /* Less vibrant */
    box-shadow: 0 0 5px var(--highlight);
}

.finger.intensity-100 {
    opacity: 1;
}

/* Mobile responsive core */

@media (max-width: 768px) {
    .app-container {
        height: auto !important;
        min-height: 100vh !important;
        overflow-y: auto !important;
        padding: 5px 8px !important;
        display: block !important;
    }

    /* Fix Theme Popup on Mobile to prevent going off-screen */
    .theme-popup {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: 85vw !important;
        max-width: 320px !important;
        max-height: 85vh !important;
        overflow-y: auto !important;
        right: auto !important;
        z-index: 9999 !important;
        margin: 0 !important;
    }

    /* Ensure secondary nav content allows dropdowns to overflow */
    #secondary-nav-content {
        overflow: visible !important;
    }

    .glass-header {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 2px !important;
        padding: 0.6rem 1rem !important;
        margin-bottom: 0.5rem !important;
        justify-content: space-between !important;
        align-items: center !important;
        position: relative;
    }

    /* Force visibility and positioning for mobile menu */
    .header-center.mobile-active {
        display: block !important;
        position: absolute;
        top: 100%;
        /* Below header */
        left: 0;
        right: 0;
        z-index: 2000;
        padding: 10px;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    }

    .header-left {
        display: flex;
        align-items: center;
        gap: 8px !important;
        width: auto !important;
    }

    .mobile-hamburger {
        display: block !important;
        padding: 4px !important;
    }

    .logo {
        font-size: 1.3rem !important;
        padding: 4px 8px !important;
        gap: 4px !important;
    }

    .header-right {
        width: auto !important;
        justify-content: flex-end !important;
        display: flex !important;
    }

    .header-actions {
        width: auto !important;
        gap: 6px !important;
        justify-content: flex-end !important;
        display: flex !important;
        flex-wrap: nowrap !important;
        /* Prevent wrapping */
    }

    /* Compact icons for mobile header */
    .admin-toggle-btn,
    .view-toggle-btn,
    .stats-nav-btn,
    .google-signin-btn,
    .see-more-btn {
        padding: 5px !important;
        min-width: 34px !important;
        height: 34px !important;
        border-radius: 8px !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
        background: var(--surface) !important;
        border: 1px solid var(--border) !important;
        box-shadow: none !important;
        color: var(--primary) !important;
        gap: 0 !important;
    }

    .google-signin-btn span,
    .stats-nav-btn span,
    .see-more-text {
        display: none !important;
        /* Icon only */
    }

    /* Force See More btn visible in header on mobile */
    .nav-far-right .see-more-btn {
        display: none !important;
        /* Hide old location */
    }

    .header-center {
        display: none !important;
        /* Hidden by default on mobile */
        /* width: 100% !important;  <-- Removed to let absolute positioning handle width */
    }

    /* CONSOLIDATED MOBILE MENU RULE */
    .header-center.mobile-active {
        display: block !important;
        position: absolute !important;
        top: 100% !important;
        /* Push it exactly below the header */
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        z-index: 9999 !important;
        /* Verify high z-index */
        background: var(--surface) !important;
        padding: 15px !important;
        border-bottom: 1px solid var(--border) !important;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
        animation: slideDown 0.3s ease-out;
        border-radius: 0 0 12px 12px;
        /* Nice bottom rounded corners */
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }

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

    .header-center .nav-pills {
        flex-direction: column !important;
        gap: 0 !important;
        background: var(--surface);
        padding: 0 !important;
        border-radius: 12px;
        border: 1px solid var(--border);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
        width: 100%;
        overflow: hidden !important;
    }

    /* Force interactivity and sizing for mobile nav buttons */
    .header-center.mobile-active .nav-pill {
        width: 100% !important;
        display: block !important;
        text-align: left !important;
        padding: 15px 20px !important;
        margin: 0 !important;
        border-radius: 0 !important;
        border-bottom: 1px solid var(--border) !important;
        background: transparent !important;
        color: var(--text-primary) !important;
        pointer-events: auto !important;
        /* CRITICAL FIX */
        font-size: 1rem !important;
        height: auto !important;
    }

    .header-center.mobile-active .nav-pill:last-child {
        border-bottom: none !important;
    }

    .header-center.mobile-active .nav-pill.active {
        background: var(--primary) !important;
        color: white !important;
    }


    .header-center .nav-pill:hover {
        background: rgba(255, 255, 255, 0.2);
    }


    .secondary-nav-container {
        flex-direction: column !important;
        height: auto !important;
        gap: 0 !important;
        padding: 6px !important;
        border-radius: 16px !important;
        overflow: visible !important;
        /* Allow dropdowns to show */
    }

    /* Mobile Dropdown Logic - Accordion Style */
    /* Mobile Dropdown Logic - Accordion Style */
    .nav-dropdown.open .dropdown-content {
        position: relative !important;
        top: 0 !important;
        width: 100% !important;
        box-shadow: none !important;
        border: none !important;
        background: rgba(0, 0, 0, 0.03) !important;
        margin-top: 10px;
        transform: none !important;
        opacity: 1 !important;
        visibility: visible !important;
        display: flex !important;
        z-index: 1000 !important;
    }

    .mobile-nav-trigger {
        display: flex !important;
        width: 100%;
        padding: 14px 20px;
        background: var(--surface);
        border: none;
        border-radius: 12px;
        justify-content: space-between;
        align-items: center;
        color: var(--primary);
        font-weight: 800;
        font-size: 1.1rem;
        cursor: pointer;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        text-align: left;
    }

    .mobile-nav-trigger.active {
        background: var(--highlight);
        border-radius: 12px 12px 0 0;
    }

    .mobile-nav-trigger .trigger-icon {
        transition: transform 0.3s;
        font-size: 0.8rem;
    }

    .mobile-nav-trigger.active .trigger-icon {
        transform: rotate(180deg);
    }

    .secondary-nav-content {
        display: none;
        flex-direction: column;
        width: 100%;
        gap: 1.5rem;
        padding: 1.5rem 0.5rem;
        background: var(--surface);
    }

    .secondary-nav-content.active {
        display: flex;
    }

    .nav-left-curriculum,
    .nav-center-lesson,
    .view-toggle-group,
    .nav-far-right {
        width: 100% !important;
        justify-content: center !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        background: transparent !important;
    }

    .nav-section-group {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem !important;
        width: 100%;
    }

    .nav-dropdown {
        width: 100%;
    }

    .dropdown-trigger {
        width: 100% !important;
        justify-content: center !important;
    }

    .active-lesson-glow {
        max-width: none !important;
        width: 100%;
        text-align: center;
    }

    .typing-area-wrapper {
        min-height: 140px !important;
        height: auto !important;
        padding: 1rem !important;
        margin: 0.5rem 0 !important;
    }

    .text-display {
        font-size: 1.5rem !important;
        line-height: normal !important;
    }

    .stats-bar {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
        padding: 1rem !important;
    }

    .stats-bar .stat-item:last-child {
        grid-column: span 2;
    }

    .keyboard-section {
        display: flex !important;
        transform: scale(0.42);
        transform-origin: top center;
        margin-top: 40px !important;
        /* POSITIVE margin to push it completely below the stats bar */
        margin-bottom: -150px !important;
    }

    .hand {
        display: none !important;
        /* Hands are too large for scale 0.45 and block keys */
    }

    .global-dashboard-bottom {
        display: none !important;
    }

    .nav-stats-group {
        justify-content: center !important;
        gap: 1.5rem !important;
    }

    @media (max-width: 360px) {
        .nav-stats-group {
            gap: 1rem !important;
        }

        .m-value {
            font-size: 1.1rem !important;
        }

        .logo {
            font-size: 1.4rem !important;
        }
    }

    .nav-right-progress-bars {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
        padding: 0 !important;
    }

    .xp-status-mini {
        width: 100% !important;
    }
}

/* Result Overlay - Cinematic Card-less Design */
.result-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(var(--primary-rgb), 0.1);
    backdrop-filter: blur(15px) saturate(180%);
    -webkit-backdrop-filter: blur(15px) saturate(180%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeInBackground 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    color: var(--text-primary);
    padding: 15px;
}

@keyframes fadeInBackground {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }

    to {
        opacity: 1;
        backdrop-filter: blur(15px);
    }
}

.result-celebration-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    width: 100%;
    max-width: 900px;
    max-height: 95vh;
    text-align: center;
    position: relative;
    z-index: 10;
    padding: 10px;
    box-sizing: border-box;
    margin: auto;
}

/* Confetti Styles */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--primary);
    opacity: 0.8;
    animation: confettiFall 3s ease-out forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(-10vh) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(110vh) rotate(720deg);
        opacity: 0;
    }
}

/* Celebratory Elements */
.celeb-header {
    animation: celebSlideDown 1s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.celeb-header h1 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 3px;
}

.celeb-header p {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 14px;
}

@keyframes celebSlideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

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

.celeb-stars {
    display: flex;
    gap: 15px;
}

.celeb-star {
    font-size: 60px;
    color: #cbd5e1;
    /* Clearer gray for unearned stars */
    opacity: 0.5;
    transform: scale(0);
    animation: starPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.05));
}

.celeb-star.earned {
    color: #f59e0b;
    opacity: 1;
    filter: drop-shadow(0 0 25px rgba(245, 158, 11, 0.5));
}

[data-theme='dark'] .celeb-star {
    color: #334155;
    opacity: 0.6;
}

.celeb-star.half {
    position: relative;
    color: #cbd5e1;
    opacity: 1;
}

.celeb-star.half::after {
    content: '★';
    position: absolute;
    left: 0;
    top: 0;
    width: 46%;
    overflow: hidden;
    color: #f59e0b;
    filter: drop-shadow(0 0 15px rgba(245, 158, 11, 0.4));
}

[data-theme='dark'] .celeb-star.half {
    color: #334155;
}

@keyframes starPop {
    to {
        transform: scale(1);
    }
}

.celeb-stats {
    display: flex;
    gap: 60px;
    margin: 20px 0;
}

.celeb-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: statFadeIn 0.8s ease-out forwards;
    opacity: 0;
}

.celeb-stat .val {
    font-size: 70px;
    font-weight: 900;
    color: var(--primary);
    line-height: 1;
    letter-spacing: -2px;
}

.celeb-stat .lbl {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-top: 12px;
}

@keyframes statFadeIn {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

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

.performance-graph-container {
    width: 95%;
    max-width: 850px;
    height: 200px;
    background: rgba(var(--surface-rgb), 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(var(--primary-rgb), 0.1);
    border-radius: 20px;
    padding: 12px;
    margin: 10px auto;
    animation: graphFadeIn 1s cubic-bezier(0.16, 1, 0.3, 1) 0.8s forwards;
    opacity: 0;
    transform: translateY(20px);
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .performance-graph-container {
        height: 220px;
        padding: 10px;
    }
}

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

#performanceChart {
    width: 100% !important;
    height: 100% !important;
}

.celeb-actions {
    display: flex;
    flex-direction: column;
    gap: 20px;
    animation: actionsFadeIn 1s ease-out 0.5s forwards;
    opacity: 0;
}

@keyframes actionsFadeIn {
    to {
        opacity: 1;
    }
}

.celeb-row {
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: center;
}

.celeb-hint {
    color: var(--text-secondary);
    font-size: 13px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.celeb-btn {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 12px 24px;
    border-radius: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.celeb-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.celeb-btn.primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px 35px;
    font-size: 16px;
}

.celeb-btn.primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 10px 20px rgba(var(--primary-rgb), 0.2);
}

.celeb-kbd {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 700;
}

[data-theme='dark'] .celeb-kbd {
    background: #1e293b;
    color: #cbd5e1;
    border-color: #334155;
}

/* Typebox Fullscreen Overlay */
.typebox-fs-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 90;
    border-radius: 12px;
    background: rgba(248, 250, 252, 0.4);
    backdrop-filter: blur(8px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.typebox-fs-overlay.hidden {
    opacity: 0 !important;
    pointer-events: none;
    backdrop-filter: blur(0px);
}

.fs-overlay-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 32px;
    padding: 18px 44px;
    background: white;
    border-radius: 60px;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.15);
    border: 1px solid #e2e8f0;
    color: var(--text-primary);
    text-align: left;
    transform: translateY(0);
    animation: slideUpCenter 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUpCenter {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

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


.fs-text-wrap {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.fs-icon-pulse {
    font-size: 2.8rem;
    margin-bottom: 0;
    animation: iconPulse 2s infinite ease-in-out;
}

.fs-overlay-content h3 {
    font-size: 1.4rem;
    margin-bottom: 0;
    font-family: 'Tiro Devanagari Hindi', serif;
    line-height: 1.2;
}

.fs-overlay-content p {
    color: var(--text-secondary);
    margin-bottom: 0;
    font-weight: 500;
    font-size: 0.9rem;
}

.fs-overlay-content kbd {
    background: var(--surface);
    padding: 3px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    box-shadow: 0 3px 0 var(--border);
    margin: 0 4px;
}

.fs-go-btn {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.fs-go-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
    filter: brightness(1.1);
}

/* Quit Fullscreen Trigger (Top Right) */
.quit-fs-zone {
    position: fixed;
    top: 0;
    right: 0;
    width: 200px;
    height: 80px;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

body.is-fullscreen .quit-fs-zone {
    pointer-events: auto;
}

body.is-fullscreen .quit-fs-zone:hover {
    opacity: 1;
}

.quit-fs-zone button {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.quit-fs-zone button:hover {
    background: #ef4444;
    border-color: #ef4444;
}

@keyframes iconPulse {

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

    50% {
        transform: scale(1.1);
        opacity: 1;
        filter: drop-shadow(0 0 15px rgba(79, 70, 229, 0.3));
    }
}

/* Response Scale for very small heights */
@media (max-height: 850px) {
    .app-container {
        transform: scale(0.95);
        transform-origin: top center;
    }
}

@media (max-height: 750px) {
    .app-container {
        transform: scale(0.85);
        transform-origin: top center;
    }
}

/* --- COMPACT VIEW FOR TABS-OPEN MODE --- */
@media (max-height: 850px) {
    .main-content {
        gap: 8px;
    }

    .typing-area-wrapper {
        height: 130px;
    }

    .hand {
        height: 140px;
    }

    .global-dashboard-bottom {
        padding: 6px 20px;
        gap: 20px;
        margin-top: 5px !important;
    }

    .global-dashboard-bottom .mini-stat {
        min-width: 40px;
    }

    .global-dashboard-bottom .mini-xp-group {
        width: 150px;
    }

    .global-dashboard-bottom .m-value {
        font-size: 11px;
    }

    .global-dashboard-bottom .m-label {
        font-size: 7px;
    }
}

/* === FOCUS MODE STYLES === */
body.focus-mode {
    overflow: hidden;
}

body.focus-mode .main-content {
    margin-top: 0;
    padding-top: 20px;
}

.exit-focus-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    background: rgba(239, 68, 68, 0.95);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.exit-focus-btn:hover {
    background: rgba(220, 38, 38, 0.95);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

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

[data-theme='dark'] .exit-focus-btn {
    background: rgba(239, 68, 68, 0.9);
}

[data-theme='dark'] .exit-focus-btn:hover {
    background: rgba(220, 38, 38, 0.95);
}

/* === FREE MODE TYPEBOX EXPANSION === */
.typing-area-wrapper {
    transition: height 0.3s ease;
}

/* Expand typebox when in Free Typezone mode */
body.free-mode-active .typing-area-wrapper {
    height: 220px;
    overflow: hidden;
    /* Wrapper stays hidden, textarea scrolls */
    padding: 0 !important;
}

/* Ensure the hidden input field doesn't steal focus/clicks in Free Mode */
body.free-mode-active .input-hidden {
    pointer-events: none !important;
    display: none !important;
}

/* Free Mode: Left-aligned writing area */
body.free-mode-active #text-display {
    text-align: left !important;
    display: block !important;
    padding: 40px 25px 15px 25px !important;
    /* Start text 40px down from top */
    margin: 0 !important;
    font-size: 1.4rem;
    line-height: 1.2;
    /* Tighten line spacing even more */
    min-height: unset !important;
    white-space: pre-wrap !important;
    overflow-wrap: break-word;
}

/* Ensure typed characters match the new size */
body.free-mode-active #text-display .char {
    font-size: 1.4rem !important;
    line-height: 1.4 !important;
    display: inline;
    /* Changed to inline so \n works naturally with pre-wrap */
    min-width: 0;
}

/* Free Mode: Enhanced placeholder visibility */
body.free-mode-active .free-writing-placeholder {
    display: inline;
    position: relative;
    top: 0;
    left: 0;
    transform: none;
    font-size: 1.4rem;
    opacity: 0.5;
    color: var(--text-secondary);
    font-family: 'Preeti', sans-serif;
    margin-left: 2px;
}

/* Free Mode: Native Styling */
.free-typing-textarea {
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    resize: none;
    outline: none;
    padding: 40px 25px 20px 25px;
    font-size: 1.4rem;
    line-height: 1.4;
    font-family: 'Preeti', sans-serif !important;
    color: var(--text-primary);
    overflow-y: auto;
    display: block;
    user-select: text !important;
    pointer-events: auto !important;
}

#copy-free-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 50;
    opacity: 0.8;
    transition: opacity 0.2s;
}

#copy-free-btn:hover {
    opacity: 1;
}

/* Update text-display hiding when textarea is active */
body.free-mode-active #text-display {
    display: none !important;
}

body.free-mode-active .free-typing-textarea.hidden {
    display: none !important;
}

body.free-mode-active .free-typing-textarea:not(.hidden) {
    display: block !important;
}

/* Dynamic height for Free Mode Typing Area to fill space without pushing keyboard */
body.free-mode-active .typing-area-wrapper {
    height: auto !important;
    flex: 1 !important;
    min-height: 160px;
    /* Minimum fallback */
}

/* ==========================================
   FONT CONVERTER STYLES
   ========================================== */
/* ==========================================
   FONT CONVERTER STYLES (PREMIUM)
   ========================================== */
.converter-section {
    width: 100%;
    max-width: 1280px;
    margin: 20px auto;
    padding: 0 40px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.4s ease-out;
    background: transparent;
}

/* Hero Section */
.converter-hero {
    text-align: left;
    margin-bottom: 30px;
    padding: 22px 0;
}

.hero-label {
    display: inline-block;
    padding: 4px 12px;
    background: var(--highlight);
    color: var(--primary);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.converter-hero h1 {
    font-size: 2.2rem;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.converter-hero p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
}

/* Layout */
.converter-main-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
    align-items: start;
}

/* Tool Area */
.converter-tool-area {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.converter-grid {
    display: grid;
    grid-template-columns: 1fr 60px 1fr;
    gap: 20px;
    align-items: center;
}

.converter-box {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    height: 350px;
    border: 1px solid rgba(255, 255, 255, 0.82);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.converter-box:focus-within {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
    border-color: var(--primary);
}

.converter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.5);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.ch-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ch-left .icon {
    font-size: 1.2rem;
}

.converter-header h3 {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.converter-box textarea {
    width: 100%;
    flex-grow: 1;
    padding: 20px;
    font-size: 1.3rem;
    line-height: 1.6;
    background: transparent;
    border: none;
    resize: none;
    outline: none;
    color: var(--text-primary);
}

/* Preeti Textarea uses Preeti Font */
#converter-preeti {
    font-family: 'Preeti', sans-serif !important;
}

/* Unicode Textarea uses standard Nepali matching font */
#converter-unicode {
    font-family: 'Inter', 'Tiro Devanagari Hindi', sans-serif;
}

/* FREE TYPING AREA - Must use Preeti font for glyphs */
#free-typing-area {
    font-family: 'Preeti', sans-serif !important;
    font-size: 1.5rem;
    line-height: 1.8;
}

/* Arrow / Swap Section */
.converter-arrow {
    display: flex;
    justify-content: center;
    align-items: center;
    user-select: none;
}

.arrow-icon {
    font-size: 2.5rem;
    color: var(--primary);
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.6;
    line-height: 1;
}

.arrow-icon:hover {
    opacity: 1;
    transform: scale(1.15);
    text-shadow: 0 0 15px rgba(79, 70, 229, 0.4);
}

/* Footer Actions */
.converter-actions-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding: 0 10px;
}

.action-btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.action-btn-outline:hover {
    background: #fee2e2;
    /* Light red */
    color: #ef4444;
    border-color: #fecaca;
}

.converter-stats {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Sidebar */
.converter-sidebar {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.side-card {
    padding: 20px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.82);
}

.side-card h4 {
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.side-card p {
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.side-card.pro {
    background: linear-gradient(135deg, var(--primary-solid), var(--primary-glow));
    border: none;
}

.side-card.pro h4,
.side-card.pro p {
    color: white;
}

.pro-tag {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 10px;
}

/* Responsive */
@media (max-width: 1100px) {
    .converter-main-layout {
        grid-template-columns: 1fr;
    }

    .converter-sidebar {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

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

    .converter-arrow {
        transform: rotate(90deg);
        height: 60px;
    }
}

/* --- REFINED DASHBOARD --- */
.global-dashboard-bottom {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 12px 24px;
    display: flex;
    justify-content: center;
    width: 100%;
    position: relative;
    z-index: 100;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 60px;
    width: 100%;
    max-width: 1200px;
}

.nav-stats-group {
    display: flex;
    gap: 32px;
}

.mini-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.m-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.m-value {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
}

.nav-right-progress-bars {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    padding: 0 20px;
}

.progress-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.p-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.p-value {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--primary);
}

.xp-status-mini {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 200px;
}

.xp-label-group {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.xp-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.xp-val {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--text-primary);
}

/* --- STAR RATING SYSTEM --- */
.star-rating {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 15px 0;
}

.star {
    font-size: 32px;
    color: #e2e8f0;
    /* Default gray for unearned stars */
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
}

.star.earned {
    color: #FFD700;
    /* Golden Yellow */
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.6), 0 0 30px rgba(255, 215, 0, 0.3);
    transform: scale(1.2);
    animation: star-pop 0.5s forwards;
}

@keyframes star-pop {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    70% {
        transform: scale(1.3);
    }

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

/* Compact stars for dropdowns */
.dropdown-stars {
    display: flex;
    gap: 2px;
    margin-top: 4px;
}

.dropdown-stars .star-tiny {
    font-size: 10px;
    color: #e2e8f0;
}

.dropdown-stars .star-tiny.earned {
    color: #FFD700;
}

[data-theme='dark'] .star-tiny {
    color: rgba(255, 255, 255, 0.1);
}

/* --- ALT HELPER BUTTON --- */
.alt-helper-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--primary);
    cursor: pointer;
    font-weight: 700;
    font-size: 1.2rem;
    position: absolute;
    /* Changed to absolute for inner placement */
    right: 180px;
    /* Position next to controls */
    top: 50%;
    transform: translateY(-50%);
    transition: all 0.2s;
    z-index: 20;
}

.alt-helper-btn:hover {
    background: var(--highlight);
    border-color: var(--primary);
    transform: translateY(-52%);
    /* slight lift taking Y-centering into account */
}

/* Learn Mode Position Override */
.learn-mode-pos {
    right: 20px;
    top: auto;
    bottom: 20px;
    transform: none;
}

.learn-mode-pos:hover {
    transform: translateY(-2px);
}

.alt-helper-btn .alt-tooltip {
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.alt-helper-btn:hover .alt-tooltip {
    opacity: 1;
}

/* --- DRAGGABLE ALT MODAL --- */
#alt-helper-modal {
    background-color: transparent !important;
    backdrop-filter: none !important;
    /* Remove Blur */
    pointer-events: none;
    justify-content: unset;
    align-items: unset;
    display: none;
    z-index: 9999;
}

#alt-helper-modal.open {
    display: block;
}

#alt-helper-modal .modal-content {
    pointer-events: auto;
    position: fixed;
    top: 80px;
    right: 20px;
    left: auto !important;
    bottom: auto;
    width: 480px;
    max-width: calc(100vw - 40px);
    margin: 0;

    /* TRUE GLASS EFFECT - Very transparent to see blur */
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(40px) saturate(200%);
    -webkit-backdrop-filter: blur(40px) saturate(200%);

    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transform: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Dark mode glass */
[data-theme="dark"] #alt-helper-modal .modal-content {
    background: rgba(20, 20, 20, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

#alt-helper-modal .modal-header {
    cursor: move;
    user-select: none;
    background: transparent;
    /* Allow blur to show through */
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    border-radius: 16px 16px 0 0;
}

/* Close button with theme color */
#alt-helper-modal .close-modal-btn {
    background: transparent;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

#alt-helper-modal .close-modal-btn:hover {
    background: var(--primary);
    color: white;
    transform: rotate(90deg);
}

/* --- ALT MODAL GRID --- */
.alt-grid-wrapper {
    background: rgba(255, 255, 255, 0.2) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
}

[data-theme="dark"] .alt-grid-wrapper {
    background: rgba(30, 30, 30, 0.3) !important;
}

.alt-grid-wrapper::-webkit-scrollbar {
    width: 8px;
}

.alt-grid-wrapper::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.alt-grid-item {
    width: 45px;
    height: 45px;
    background: var(--surface);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 4px;
    font-size: 1.6rem;
    font-family: 'Preeti', sans-serif;
    color: var(--text-primary);
    transition: background 0.15s;
}

.alt-grid-item:hover {
    background: var(--highlight);
    border-color: var(--primary);
}

.key-badge {
    display: inline-block;
    padding: 2px 6px;
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-weight: 600;
    margin: 0 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Pro Footer Styles - Theme Aware */
.pro-footer {
    background: var(--surface);
    color: var(--text-primary);
    padding: 8rem 2rem 4rem;
    border-top: 1px solid var(--border);
    font-family: 'Inter', sans-serif;
    position: relative;
    z-index: 10;
    margin-top: 6rem;
}

/* Accent for pro look */
.pro-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--primary-glow));
    opacity: 0.9;
}

.footer-content {
    max-width: 1240px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.5fr repeat(3, 1fr);
    gap: 5rem;
    margin-bottom: 6rem;
}

.footer-logo {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1.8rem;
    transition: transform 0.3s ease;
}

.footer-logo:hover {
    transform: translateY(-2px);
}

.footer-logo span {
    color: var(--primary);
    font-family: 'Tiro Devanagari Hindi', serif;
    filter: drop-shadow(0 2px 4px var(--primary-glow));
}

.footer-desc {
    color: var(--text-secondary);
    max-width: 320px;
    line-height: 1.8;
    font-size: 1rem;
    opacity: 0.85;
}

.footer-col h5 {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 2.5rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    position: relative;
    display: inline-block;
}

.footer-col h5::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 24px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
    align-items: flex-start;
    /* CRITICAL: Prevent vertical stretching */
}

.footer-links li {
    width: auto;
    margin-bottom: 0 !important;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
}

.footer-links a:hover {
    color: var(--primary);
    transform: translateX(10px);
}

.footer-links svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.3s ease;
}

.footer-links a:hover svg {
    transform: rotate(-10deg) scale(1.1);
}

.footer-bottom {
    max-width: 1240px;
    margin: 0 auto;
    padding-top: 3rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
    opacity: 0.8;
}

@media (max-width: 1100px) {
    .footer-content {
        gap: 3rem;
    }
}

@media (max-width: 968px) {
    .pro-footer {
        padding: 5rem 2rem 3rem;
    }

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

@media (max-width: 640px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }

    .footer-logo,
    .footer-desc {
        margin-left: auto;
        margin-right: auto;
    }

    .footer-links {
        align-items: center;
    }

    .footer-links a {
        justify-content: center;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }
}

/* COMING SOON OVERLAY */
.converter-main-layout {
    position: relative;
    /* Anchor for overlay */
}

/* Blur the background content to indicate inactivity */
.converter-tool-area,
.converter-sidebar {
    filter: blur(5px);
    opacity: 0.6;
    pointer-events: none;
    /* Disable clicking underneath */
    user-select: none;
}

.coming-soon-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 50;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.cs-content {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    padding: 40px 60px;
    border-radius: 24px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 1);
    animation: floatUp 0.8s ease-out;
}

[data-theme='dark'] .cs-content {
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(255, 255, 255, 0.1);
}

.cs-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

.cs-content h2 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 10px;
}

.cs-content p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 25px;
}

.cs-badge {
    display: inline-block;
    padding: 6px 16px;
    background: var(--highlight);
    color: var(--primary-solid);
    border: 1px solid var(--primary-glow);
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

[data-theme='dark'] .cs-badge {
    background: var(--highlight);
    color: var(--primary-solid);
}

@keyframes bounce {

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

    50% {
        transform: translateY(-10px);
    }
}

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

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

/* View Toggle Controls */
.view-toggle-group {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-left: 12px;
    padding-left: 12px;
    border-left: 1px solid #e2e8f0;
}

.view-toggle-btn {
    height: 38px;
    padding: 0 10px;
    border-radius: 12px;
    border: none;
    /* Removed border */
    background: transparent;
    /* Removed background */
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #64748b;
    font-weight: 700;
    font-size: 0.9rem;
    position: relative;
}

.view-toggle-btn:hover {
    color: var(--primary);
}

.view-toggle-btn.active {
    background: transparent;
    color: var(--primary);
    transform: translateY(-3px) scale(1.05);
    /* Pop up effect */
    text-shadow: 0 4px 10px var(--primary-glow);
}

/* Underline for toggles */
.view-toggle-btn.active::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 8px;
    right: 8px;
    height: 3px;
    background: var(--primary);
    border-radius: 10px;
    box-shadow: 0 2px 8px var(--primary-glow);
    animation: slideInWidth 0.3s ease;
}

.view-toggle-btn .toggle-icon {
    width: 18px;
    height: 18px;
}

/* Transitions for smooth layout shifts */
.keyboard-section {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.keyboard-container {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        margin 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hand {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hide keyboard/hands when toggled off */
body.hide-keyboard .keyboard-container {
    display: none !important;
}

body.hide-keyboard .keyboard-section {
    gap: 550px;
}

body.hide-keyboard .hand {
    transform: scale(1.5);
    transform-origin: bottom center;
}

body.hide-hands .hand {
    display: none !important;
}

body.hide-hands .keyboard-container {
    transform: scale(1.08);
    margin: 0 40px;
}

/* Appearance Context Menu / Popup */
.theme-controls {
    margin-left: 12px;
    padding-left: 12px;
    border-left: 1px solid #e2e8f0;
}

.theme-dropdown-wrapper {
    position: relative;
    display: inline-block;
}

.theme-nav-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.recent-colors-nav {
    display: flex;
    gap: 6px;
    align-items: center;
}

.nav-color-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    cursor: pointer;
    border: 1.5px solid white;
    box-shadow: 0 0 0 1px #e2e8f0;
    transition: all 0.2s ease;
}

.nav-color-dot:hover {
    transform: scale(1.2);
}

.nav-color-dot.active {
    box-shadow: 0 0 0 2px white, 0 0 0 4px var(--primary);
    transform: scale(1.15);
    width: 20px;
    height: 20px;
}

[data-theme='dark'] .nav-color-dot {
    border-color: #1e293b;
    box-shadow: 0 0 0 1px #334155;
}

.theme-popup {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 240px;
    padding: 12px;
    border-radius: 16px;
    background: var(--surface);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    transform-origin: top right;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.theme-popup.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.popup-header {
    margin-bottom: 14px;
}

.popup-header h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 2px;
}

.popup-header p {
    font-size: 0.75rem;
    color: #64748b;
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.color-option {
    aspect-ratio: 1;
    border-radius: 10px;
    background: var(--option-color);
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.color-option:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.color-option.active {
    border-color: white;
    box-shadow: 0 0 0 2px var(--option-color);
}

.popup-divider {
    height: 1px;
    background: var(--border);
    margin: 6px 0;
    opacity: 0.5;
}

.popup-section-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.history-grid {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.history-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.history-dot:hover {
    transform: scale(1.1);
}

.pin-icon {
    font-size: 10px;
    opacity: 0;
    transition: opacity 0.2s;
    background: rgba(255, 255, 255, 0.9);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: -4px;
    right: -4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.history-dot:hover .pin-icon,
.history-dot.pinned .pin-icon {
    opacity: 1;
}

.history-dot.pinned .pin-icon {
    color: var(--primary);
    background: white;
}

.history-dot.active {
    box-shadow: 0 0 0 2px var(--primary);
}

.history-dot.add-custom {
    background: transparent;
    border: 2px dashed #cbd5e1;
    color: #94a3b8;
    box-shadow: none;
}

.history-dot.add-custom:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--highlight);
    transform: scale(1.1);
}

.add-icon {
    font-size: 18px;
    font-weight: 600;
}

.opacity-control {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 2px 0;
}

.control-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.theme-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.theme-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.theme-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

[data-theme='dark'] .theme-slider {
    background: #334155;
}

.custom-color-btn {
    width: 100%;
    padding: 6px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #f8fafc;
    color: #475569;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.custom-color-btn span.icon {
    font-size: 1rem;
}

.custom-color-btn:hover {
    background: #ffffff;
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.custom-color-btn.reset {
    background: transparent;
    border: 1px dashed var(--border);
}

.custom-color-btn.reset:hover {
    background: #fffafa;
    border-color: #ef4444;
    border-style: solid;
    color: #ef4444;
}

/* Dark Mode Support */
[data-theme='dark'] .view-toggle-btn {
    background: #1e293b;
    border-color: #334155;
}

[data-theme='dark'] .view-toggle-btn:hover {
    background: #334155;
    color: #f1f5f9;
}

[data-theme='dark'] .theme-popup {
    background: rgba(15, 23, 42, 0.95);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

[data-theme='dark'] .popup-header h4 {
    color: #f1f5f9;
}

[data-theme='dark'] .popup-header p {
    color: #94a3b8;
}

[data-theme='dark'] .popup-divider {
    background: #334155;
}

[data-theme='dark'] .custom-color-btn {
    background: #0f172a;
    border-color: #334155;
    color: #cbd5e1;
}

[data-theme='dark'] .custom-color-btn:hover {
    background: #1e293b;
    color: #f1f5f9;
}

[data-theme='dark'] .theme-controls {
    border-color: #334155;
}

/* Navbar Finger Guidance (When Keyboard is Hidden) */
.finger-guidance-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(var(--primary-rgb), 0.08);
    border-radius: 12px;
    border: 1px solid rgba(var(--primary-rgb), 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.finger-guidance-item.hidden {
    display: none !important;
}

.finger-guidance-item .finger-label {
    font-size: 18px;
    opacity: 0.8;
}

.finger-guidance-item .finger-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    font-family: 'Tiro Devanagari Hindi', serif;
    letter-spacing: 0.3px;
    min-width: 80px;
    text-align: center;
}

.finger-guidance-item.active {
    background: rgba(var(--primary-rgb), 0.15);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.2);
    transform: scale(1.02);
}

[data-theme='dark'] .finger-guidance-item {
    background: rgba(var(--primary-rgb), 0.12);
    border-color: rgba(var(--primary-rgb), 0.25);
}

/* Live Performance Graph Styles */
.live-graph-container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 20px 30px;
    background: var(--surface);
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    overflow: hidden;
}

.live-graph-container.hidden {
    display: none;
}

.live-graph-header {
    display: none;
}

.live-graph-header p {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 500;
}

#livePerformanceChart {
    width: 100% !important;
    height: 320px !important;
    max-height: 320px;
}

[data-theme='dark'] .live-graph-container {
    background: rgba(var(--surface-rgb), 0.6);
    border-color: rgba(var(--primary-rgb), 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Animation when graph appears */
.live-graph-container:not(.hidden) {
    animation: liveGraphSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes liveGraphSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }

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

@media (max-width: 768px) {
    .live-graph-container {
        padding: 15px 20px;
    }

    .live-graph-header h3 {
        font-size: 16px;
    }

    .live-graph-header p {
        font-size: 11px;
    }

    #livePerformanceChart {
        height: 250px !important;
    }
}

/* Modal Button Styles */

/* Secondary Button (Keep Progress, Cancel, etc.) */
.btn-secondary {
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
    border: 2px solid var(--border);
    background: transparent;
    color: var(--text-primary);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Inter', sans-serif;
    min-width: 140px;
}

.btn-secondary:hover {
    background: var(--surface);
    border-color: var(--text-secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

[data-theme='dark'] .btn-secondary {
    border-color: rgba(255, 255, 255, 0.2);
}

[data-theme='dark'] .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.4);
}

/* Danger Button (Confirm Reset) */
.btn-danger-locked {
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    background: #ef4444;
    color: #fff;
    border-radius: 10px;
    cursor: not-allowed;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Inter', sans-serif;
    opacity: 0.5;
    min-width: 160px;
}

.btn-danger-locked:not(:disabled) {
    cursor: pointer;
    opacity: 1;
    background: #dc2626;
}

.btn-danger-locked:not(:disabled):hover {
    background: #b91c1c;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4);
}

.btn-danger-locked:not(:disabled):active {
    transform: translateY(0);
}

/* Modal Footer */
.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    align-items: center;
}

.modal-footer.reset-footer {
    justify-content: space-between;
}

/* Security Modal Specific */
.security-modal {
    text-align: center;
    max-width: 480px;
}

.security-warning-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.security-modal h3 {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 12px 0;
    color: var(--text-primary);
}

.security-modal p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* Stats Button in Top Nav */
.stats-nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.stats-nav-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(var(--primary-rgb), 0.3);
}

.stats-nav-btn .stats-icon {
    width: 20px;
    height: 20px;
}

/* Stats Modal - Full Screen Immersive */
.stats-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: transparent;
    z-index: 10000;
    display: none;
    flex-direction: column;
    padding: 0;
    margin: 0;
    overflow-y: auto;
    /* Allow scrolling if keyboard is too big */
    animation: statsFadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* The Professional "Full Blur" Look */
/* This blurs the actual background elements of the page */
body.stats-active .app-container {
    filter: blur(12px) saturate(150%);
    /* Lowered blur for better visibility */
    transition: filter 0.6s ease;
    pointer-events: none;
}

@keyframes statsFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.stats-modal.active {
    display: flex !important;
}

.stats-modal-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100%;
    margin: 0;
    padding: 40px 0;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.stats-modal-header {
    margin-bottom: 20px;
    padding: 0 40px;
    /* Use internal padding for header text if desired, or 0 for edge-to-edge */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stats-modal-header h2 {
    font-family: 'Inter', sans-serif;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    margin: 0;
    font-size: 32px;
    font-weight: 900;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    /* Move closer to edge */
    width: 50px;
    height: 50px;
    border-radius: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: 24px;
    z-index: 10;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #ef4444;
    color: white;
    transform: rotate(90deg);
}

/* Stats Overview */
/* Compact Stats Row */
.stats-compact-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 60px;
    /* Space from the top of modal */
    margin-bottom: 40px;
    /* Space from the heatmap */
    padding: 10px 40px;
    background: transparent;
    border: none !important;
}

.compact-stat {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    flex: 1;
}

.compact-stat:last-child {
    border-right: none;
}

.compact-stat .icon {
    font-size: 24px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.compact-stat .info {
    display: flex;
    flex-direction: column;
}

.compact-stat .label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.compact-stat .value {
    font-size: 18px;
    font-weight: 900;
    color: var(--primary);
}

.compact-stat .value small {
    font-size: 10px;
    font-weight: 700;
    margin-left: 2px;
}

/* Heatmap Section Overrides */
.heatmap-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: transparent;
    padding: 30px;
}

.heatmap-header {
    margin-bottom: 25px;
}

.heatmap-keyboard-container {
    background: transparent;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
}

.heatmap-keyboard {
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* Slightly more gap for larger keys */
    align-items: center;
    transform: scale(1.25);
    /* Scale up the entire keyboard */
    transform-origin: center;
    margin: 40px 0;
    /* Add margin to account for scaled overflow */
}

/* Use global .key class but override for mastery */
.heatmap-keyboard .key {
    cursor: help;
    transition: transform 0.2s, box-shadow 0.2s;
}

.heatmap-keyboard .key:hover {
    transform: translateY(-4px) scale(1.05);
    z-index: 10;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

/* Correcting Mastery Colors to be more vibrant and theme-consistent */
.heatmap-keyboard .key.mastery-0,
.heatmap-keyboard .key.mastery-10 {
    background: linear-gradient(135deg, #f43f5e, #e11d48) !important;
    border-bottom-color: #9f1239 !important;
    box-shadow: 0 4px 12px rgba(244, 63, 94, 0.3);
}

.heatmap-keyboard .key.mastery-20,
.heatmap-keyboard .key.mastery-30 {
    background: linear-gradient(135deg, #fb7185, #f43f5e) !important;
    border-bottom-color: #be123c !important;
}

.heatmap-keyboard .key.mastery-40,
.heatmap-keyboard .key.mastery-50 {
    background: linear-gradient(135deg, #fb923c, #f97316) !important;
    border-bottom-color: #c2410c !important;
}

.heatmap-keyboard .key.mastery-60 {
    background: linear-gradient(135deg, #facc15, #eab308) !important;
    border-bottom-color: #a16207 !important;
}

.heatmap-keyboard .key.mastery-70,
.heatmap-keyboard .key.mastery-80 {
    background: linear-gradient(135deg, #4ade80, #22c55e) !important;
    border-bottom-color: #15803d !important;
}

.heatmap-keyboard .key.mastery-90,
.heatmap-keyboard .key.mastery-100 {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    border-bottom-color: #047857 !important;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

/* Ensure labels are white on heatmapped keys for readability */
.heatmap-keyboard .key[class*="mastery-"] .key-label,
.heatmap-keyboard .key[class*="mastery-"] .key-nepali,
.heatmap-keyboard .key[class*="mastery-"] .key-shift,
.heatmap-keyboard .key[class*="mastery-"] .key-bg-label {
    color: white !important;
    opacity: 0.9;
}

.heatmap-keyboard .key[class*="mastery-"] .key-bg-label {
    opacity: 0.2;
}

/* Special Keys fallback if needed */
.heatmap-keyboard .key.special {
    background: var(--surface) !important;
    border-color: var(--border) !important;
    color: var(--text-secondary) !important;
}

/* Heatmap Legend */
.heatmap-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 16px;
    background: transparent;
    flex-wrap: wrap;
}

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

.legend-items {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-primary);
}

.legend-color {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 2px solid rgba(0, 0, 0, 0.2);
}

.legend-color.mastery-high {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.8), rgba(34, 197, 94, 0.6));
}

.legend-color.mastery-medium {
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.6), rgba(234, 179, 8, 0.4));
}

.legend-color.mastery-low {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.7), rgba(220, 38, 38, 0.5));
}

/* Dark Theme Adjustments - Cleaned up to avoid 'white box' effect */
[data-theme='dark'] .stats-modal-content {
    background: transparent !important;
    border: none !important;
}

[data-theme='dark'] .stat-card,
[data-theme='dark'] .heatmap-section {
    background: transparent !important;
    border: none !important;
}

[data-theme='dark'] .heatmap-keyboard-container {
    background: transparent !important;
}

[data-theme='dark'] .stats-modal-header h2,
[data-theme='dark'] .compact-stat .value {
    color: #ffffff;
}

[data-theme='dark'] .compact-stat .label {
    color: rgba(255, 255, 255, 0.6);
}

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

    .heatmap-keyboard .key {
        min-width: 40px;
        height: 40px;
        font-size: 10px;
    }

    .heatmap-keyboard .key.key-space {
        min-width: 150px;
    }
}

/* Floating Contact Developer FAB */
.contact-fab-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
}

.contact-fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 5px 20px var(--primary-glow), 0 0 0 4px rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.contact-fab:hover {
    transform: scale(1.1) translateY(-5px) rotate(10deg);
}

.contact-fab .chat-icon {
    width: 24px;
    height: 24px;
}

.pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid var(--primary);
    opacity: 0;
    animation: fab-pulse 2s infinite;
    pointer-events: none;
}

@keyframes fab-pulse {
    0% {
        width: 100%;
        height: 100%;
        opacity: 0.8;
    }

    100% {
        width: 180%;
        height: 180%;
        opacity: 0;
    }
}

/* Contact Card */
.contact-card {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 320px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    transform: translateY(20px) scale(0.9);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: bottom right;
}

@media (max-width: 400px) {
    .contact-card {
        width: calc(100vw - 40px);
        right: -10px;
    }
}

.contact-card.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.card-header {
    background: var(--primary);
    color: white;
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.close-card {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 0.2s;
}

.close-card:hover {
    background: rgba(255, 255, 255, 0.3);
}

.card-body {
    padding: 20px;
}

.card-body p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}

.contact-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.contact-opt {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.contact-opt .emoji {
    font-size: 1.5rem;
}

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

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

.opt-text small {
    font-size: 0.75rem;
    color: #94a3b8;
}

.contact-opt:hover {
    transform: translateX(5px);
    background: white;
}

.contact-opt.bug:hover {
    border-color: #ef4444;
}

.contact-opt.suggestion:hover {
    border-color: #f59e0b;
}

.contact-opt.business:hover {
    border-color: var(--primary);
}

.card-footer {
    padding: 12px 20px;
    background: #f1f5f9;
    text-align: center;
    border-top: 1px solid #e2e8f0;
}

.card-footer small {
    font-size: 0.7rem;
    color: #94a3b8;
    font-style: italic;
}

/* Dark Mode Adjustments */
[data-theme='dark'] .contact-card {
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme='dark'] .contact-opt {
    background: #0f172a;
    border-color: #1e293b;
}

[data-theme='dark'] .contact-opt:hover {
    background: #1e293b;
}

[data-theme='dark'] .opt-text strong {
    color: #f1f5f9;
}

[data-theme='dark'] .card-footer {
    background: #0f172a;
    border-color: #1e293b;
}

/* Development Status Bar - Inside Typing Box */
.dev-status-bar {
    position: absolute;
    bottom: 8px;
    right: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.7;
    z-index: 10;
    pointer-events: auto;
    width: auto;
    padding: 0;
}

.dev-status-bar:hover {
    opacity: 1;
}

[data-theme='dark'] .dev-status-bar {
    color: #64748b;
}


.dev-status-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
}

.status-dot::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: #10b981;
    border-radius: 50%;
    animation: pulse-ring 2s cubic-bezier(0.455, 0.03, 0.515, 0.955) infinite;
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.7);
        opacity: 1;
    }

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

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

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

.dev-status-bar p {
    margin: 0;
}

.dev-status-bar strong {
    color: var(--primary-readable);
    font-weight: 700;
}

#report-link {
    background: none;
    border: none;
    padding: 0;
    color: var(--primary);
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.85rem;
    font-family: inherit;
    transition: opacity 0.2s;
}

#report-link:hover {
    opacity: 0.7;
}

/* Close Button */
.close-status-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-left: 10px;
    transition: all 0.2s;
    opacity: 0.6;
}

.close-status-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    opacity: 1;
    transform: scale(1.1);
}

[data-theme='dark'] .close-status-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Menu Dropdown Styles (Three-Dot Menu) */
.nav-section-group.right-align {
    margin-left: auto;
}

.menu-dropdown .dropdown-trigger.icon-only {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
}

.menu-dropdown .dropdown-trigger.icon-only:hover {
    background: var(--highlight);
    border-color: var(--primary);
    transform: scale(1.05);
}

.menu-dropdown {
    position: relative;
}

.dropdown-content {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 220px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    padding: 8px 0;
    backdrop-filter: blur(10px);
}

.dropdown-content.right-anchored {
    left: auto;
    right: 0;
}

.menu-dropdown:hover .dropdown-content,
.dropdown-content:hover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.9rem;
    cursor: pointer;
}

.menu-item:hover {
    background: var(--highlight);
    color: var(--primary);
}

.menu-divider {
    height: 1px;
    background: var(--border);
    margin: 6px 12px;
}

/* Dark mode adjustments */
[data-theme='dark'] .dropdown-content {
    background: rgba(30, 41, 59, 0.95);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

[data-theme='dark'] .menu-item:hover {
    background: rgba(100, 116, 139, 0.2);
}

/* See More Button Specific Styles */
.see-more-btn {
    text-decoration: none;
    padding: 0 12px !important;
    gap: 6px !important;
}

.see-more-btn .see-more-text {
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
}

.see-more-btn:hover {
    background: var(--highlight);
    color: var(--primary);
}

.see-more-btn .toggle-icon {
    width: 18px;
    height: 18px;
}

/* Remove active state styling for See More (it's a link, not a toggle) */
.see-more-btn.active::after {
    display: none;
}

/* Dark mode adjustments */
[data-theme='dark'] .see-more-btn:hover {
    background: rgba(100, 116, 139, 0.2);
}

/* Mobile responsiveness - hide text on small screens */
@media (max-width: 768px) {
    .see-more-text {
        display: none;
    }
}

/* ============================================
   SEO CONTENT SECTION
   Visible after scrolling past 100vh app area
   ============================================ */

.seo-content-section {
    background: var(--surface);
    padding: 5rem 2rem 4rem;
    border-top: 1px solid var(--border);
    position: relative;
}

.seo-content-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--primary-glow));
    opacity: 0.7;
}

.seo-article {
    max-width: 900px;
    margin: 0 auto;
    line-height: 1.85;
    color: var(--text-primary);
}

.seo-article h1 {
    font-size: 2.4rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    line-height: 1.3;
}

.seo-article h2 {
    font-size: 1.7rem;
    font-weight: 700;
    margin: 2.5rem 0 1rem;
    color: var(--primary);
    position: relative;
    padding-left: 1rem;
    border-left: 4px solid var(--primary);
}

.seo-article h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 2rem 0 0.8rem;
    color: var(--text-primary);
}

.seo-article p {
    margin-bottom: 1.3rem;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.seo-article ul,
.seo-article ol {
    margin: 1rem 0 1.5rem 1.5rem;
    color: var(--text-secondary);
}

.seo-article li {
    margin-bottom: 0.7rem;
    font-size: 1.05rem;
}

.seo-article a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: opacity 0.2s;
}

.seo-article a:hover {
    opacity: 0.8;
}

.seo-article strong {
    font-weight: 600;
    color: var(--text-primary);
}

.seo-quick-links {
    background: var(--highlight);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem 2rem;
    margin-top: 2rem;
}

.seo-quick-links h3 {
    margin-top: 0;
    margin-bottom: 1rem;
}

.seo-quick-links ul {
    margin: 0;
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.seo-quick-links li {
    margin: 0;
}

.seo-quick-links a {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.seo-quick-links a:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

@media (max-width: 768px) {
    .seo-content-section {
        padding: 3rem 1.5rem;
    }

    .seo-article h1 {
        font-size: 1.8rem;
    }

    .seo-article h2 {
        font-size: 1.4rem;
    }

    .seo-article p,
    .seo-article li {
        font-size: 1rem;
    }

    .seo-quick-links ul {
        flex-direction: column;
    }
}

/* ============================================
   PRO FOOTER
   Theme-aware footer for the landing page
   ============================================ */

.pro-footer {
    background: var(--surface);
    color: var(--text-primary);
    padding: 5rem 2rem 3rem;
    border-top: 1px solid var(--border);
    font-family: 'Inter', sans-serif;
    position: relative;
    z-index: 10;
    transition: background 0.3s ease, color 0.3s ease;
}

.pro-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--primary-glow));
    opacity: 0.9;
}

.footer-content {
    max-width: 1240px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.5fr repeat(3, 1fr);
    gap: 4rem;
    margin-bottom: 4rem;
}

.footer-logo {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease;
}

.footer-logo:hover {
    transform: translateY(-2px);
}

.footer-logo span {
    color: var(--primary);
    font-family: 'Tiro Devanagari Hindi', serif;
    filter: drop-shadow(0 2px 4px var(--primary-glow));
}

.footer-desc {
    color: var(--text-secondary);
    max-width: 300px;
    line-height: 1.7;
    font-size: 0.95rem;
    opacity: 0.85;
}

.footer-col h5 {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    position: relative;
    display: inline-block;
}

.footer-col h5::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 20px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    align-items: flex-start;
}

.footer-links li {
    width: auto;
    margin-bottom: 0 !important;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
}

.footer-links a:hover {
    color: var(--primary);
    transform: translateX(8px);
}

.footer-links svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.3s ease;
}

.footer-links a:hover svg {
    transform: rotate(-10deg) scale(1.1);
}

.footer-bottom {
    max-width: 1240px;
    margin: 0 auto;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    opacity: 0.8;
}

@media (max-width: 1100px) {
    .footer-content {
        gap: 2.5rem;
    }
}

@media (max-width: 968px) {
    .pro-footer {
        padding: 4rem 2rem 2rem;
    }

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

@media (max-width: 640px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        text-align: center;
    }

    .footer-logo,
    .footer-desc {
        margin-left: auto;
        margin-right: auto;
    }

    .footer-links {
        align-items: center;
    }

    .footer-links a {
        justify-content: center;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }
}