/* 
   AI Abituriyent - Design System & UI Styling
   Author: Professional Senior UI/UX & Product Designer
*/

/* --- THEME CUSTOM PROPERTIES --- */
:root {
    /* Main Constants */
    --primary: #2563EB;
    --primary-hover: #3B82F6;
    --secondary: #1F2937;
    --secondary-hover: #0F172A;
    --accent: #22C55E;
    --error: #EF4444;
    --warning: #F59E0B;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 1px rgba(15, 23, 42, 0.02);
    --shadow-md: 0 8px 20px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.08);
    --font-main: 'Inter', sans-serif;
    --font-heading: 'Inter', sans-serif;
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;
    
    /* Subject Colors */
    --math-color: #7C3AED;
    --lang-color: #0066cc;
    --hist-color: #F59E0B;
}

/* Dark Mode Variables */
.dark-theme {
    --bg-primary: #0B0F19;
    --bg-secondary: #131A2C;
    --bg-glass: rgba(20, 26, 46, 0.65);
    --bg-glass-hover: rgba(30, 39, 68, 0.8);
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-glass-glowing: rgba(0, 102, 204, 0.4);
    --text-main: #F8FAFC;
    --text-muted: #94A3B8;
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --scroll-bar-color: rgba(255, 255, 255, 0.1);
}

/* Light Mode Variables (CyberBilim Style) */
.light-theme {
    --bg-primary: #F8FAFC;
    --bg-secondary: #FFFFFF;
    --bg-glass: rgba(255, 255, 255, 0.72);
    --bg-glass-hover: rgba(248, 250, 252, 0.82);
    --border-glass: rgba(229, 231, 235, 0.8);
    --border-glass-glowing: rgba(37, 99, 235, 0.18);
    --text-main: #1F2937;
    --text-muted: #64748B;
    --glass-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
    --scroll-bar-color: rgba(0, 0, 0, 0.1);
}

/* --- CORE RESET & BASE STYLING --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    font-family: var(--font-main);
}

body {
    background:
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.08), transparent 28%),
        radial-gradient(circle at bottom right, rgba(37, 99, 235, 0.06), transparent 24%),
        #F8FAFC;
    display: flex;
    justify-content: flex-start;
    align-items: stretch;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: hidden;
    color: var(--text-main);
    transition: background-color 0.4s ease;
}

/* Hide scrollbars globally */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--scroll-bar-color);
    border-radius: 10px;
}

/* --- RESPONSIVE LAYOUT & CONTAINER SYSTEM --- */

/* App Root Container */
.app-root-container {
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: var(--bg-primary);
    position: relative;
    transition: background-color 0.4s ease;
    max-width: none;
    margin: 0;
    box-shadow: none;
    border-left: none;
    border-right: none;
}

/* Main Container: wraps sidebar and content wrapper */
.main-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: row;
    overflow: hidden;
    position: relative;
}

/* Main Content Area */
.main-content-wrapper {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* --- DESKTOP SIDEBAR --- */
/* --- DESKTOP SIDEBAR (RE-PURPOSED AS SUBJECT MODULES SIDEBAR) --- */
.desktop-sidebar {
    width: 320px;
    height: 100%;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    padding: 20px;
    z-index: 100;
}

.sidebar-header {
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-glass);
    margin-bottom: 20px;
}

.sidebar-title {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 800;
    color: var(--text-main);
}

.sidebar-modules-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
}

.module-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-md);
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.module-item:hover {
    background: var(--bg-glass-hover);
    border-color: var(--border-glass);
}

.module-item.active {
    background: rgba(0, 102, 204, 0.06);
    border-color: rgba(0, 102, 204, 0.2);
}

.module-badge {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.module-item.active .module-badge {
    background: var(--primary);
    color: #ffffff;
}

.module-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: left;
}

.module-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
}

.module-subtitle {
    font-size: 11px;
    color: var(--text-muted);
}

.sidebar-progress-card {
    margin-top: auto;
    padding: 16px;
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    border: 1px solid var(--border-glass);
}

.spc-title {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.spc-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.spc-lbl {
    font-size: 13px;
    color: var(--text-main);
}

.spc-val {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
}

/* --- SIMPLE BRAND WORDMARK --- */
.brand-wordmark {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 900;
    color: #2563eb;
    letter-spacing: 0.02em;
    margin: 0 auto 14px;
    width: 100%;
}

.brand-wordmark-icon {
    flex-shrink: 0;
}

.header-nav-center {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 100%;
}

.header-nav-item {
    background: transparent;
    border: none;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

.header-nav-item:hover {
    color: var(--text-main);
    background: var(--bg-glass-hover);
}

.header-nav-item.active {
    color: var(--primary);
    background: rgba(0, 102, 204, 0.08);
}

.btn-sidebar-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    background: transparent;
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    color: var(--error);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-sidebar-logout:hover {
    background: rgba(239, 68, 68, 0.08);
}

.app-header-nav {
    display: none !important;
}

.page-scroll-container {
    padding-top: 16px;
}

/* Responsiveness Settings */
@media (max-width: 768px) {
    .desktop-sidebar {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .main-container {
        flex-direction: row !important;
    }
    .bottom-nav {
        display: none !important;
    }
    
    /* Layout grid extension on desktop */
    .quick-actions-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
    .progress-stats-row {
        gap: 16px !important;
    }
    .page-scroll-container {
        padding: 16px 40px 40px 40px !important;
    }
}

@media (min-width: 1200px) {
    .app-root-container {
        background:
            radial-gradient(circle at top left, rgba(59, 130, 246, 0.10), transparent 22%),
            radial-gradient(circle at bottom right, rgba(34, 197, 94, 0.06), transparent 20%),
            var(--bg-primary);
    }

    .main-content-wrapper {
        background:
            linear-gradient(180deg, rgba(255,255,255,0.52), rgba(255,255,255,0.18)),
            var(--bg-primary);
    }

    .app-header-nav {
        height: 72px;
        padding: 0 32px;
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
        border-bottom: 1px solid var(--border-glass);
    }

    .header-brand {
        font-size: 18px;
        letter-spacing: 0.02em;
    }

    .page-scroll-container {
        width: min(100%, 1240px);
        margin: 0 auto;
        padding: 28px 32px 44px;
    }

    .page-title {
        font-size: 28px;
        line-height: 1.1;
    }

    .page-desc {
        font-size: 14px;
        max-width: 72ch;
    }

    .home-shortcuts-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
        gap: 14px;
        margin-top: 22px;
        margin-bottom: 28px;
    }

    .shortcut-box-card {
        min-height: 118px;
        border-radius: 18px;
        padding: 16px 12px;
        gap: 10px;
    }

    .shortcut-icon-wrap {
        width: 44px;
        height: 44px;
        border-radius: 14px;
    }

    .shortcut-box-card .shortcut-lbl {
        font-size: 11px;
    }

    .home-stats-grid {
        padding: 20px 16px;
        gap: 14px;
        border-radius: 24px;
        box-shadow: var(--shadow-lg);
    }

    .stat-item-card {
        min-height: 152px !important;
        padding: 10px !important;
    }

    .stat-number {
        font-size: 20px;
    }

    .stat-lbl {
        font-size: 11px;
    }

    .home-challenge-container {
        padding: 24px 26px;
        border-radius: 24px;
        margin-top: 22px;
    }

    .challenge-title-text {
        font-size: 18px;
    }

    .challenge-desc {
        font-size: 13px;
    }

    .subjects-list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px;
    }

    .subject-card {
        padding: 20px;
        border-radius: 24px;
        box-shadow: var(--shadow-md);
    }

    .subject-name {
        font-size: 17px;
    }

    .subject-quantity {
        font-size: 12px;
    }

    .subject-card-actions {
        gap: 14px;
    }

    .coming-soon-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px;
    }

    .coming-soon-card {
        min-height: 176px;
        border-radius: 24px;
        padding: 18px;
    }

    .practice-header,
    .question-card,
    .summary-top-hero,
    .profile-hero-card,
    .chart-card,
    .premium-pricing-card,
    .mandat-score-card,
    .mandat-results-card {
        border-radius: 26px;
        box-shadow: var(--shadow-md);
    }

    .practice-header {
        padding: 18px 20px;
        margin-bottom: 18px;
    }

    .question-card {
        padding: 28px;
    }

    .question-text {
        font-size: 18px;
        line-height: 1.7;
    }

    .options-container {
        gap: 14px;
        margin-bottom: 24px;
    }

    .option-item {
        padding: 18px 20px;
        border-radius: 18px;
    }

    .option-content {
        font-size: 15px;
    }

    .practice-nav-actions {
        gap: 14px;
    }

    .summary-top-hero {
        padding: 32px 0 20px;
    }

    .summary-congrats {
        font-size: 32px;
    }

    .trophy-glow-container {
        width: 140px;
        height: 140px;
    }

    .trophy-svg {
        width: 92px;
        height: 92px;
    }

    .chart-card,
    .profile-hero-card {
        padding: 24px;
    }

    .profile-main-name {
        font-size: 28px;
    }

    .profile-main-username {
        font-size: 15px;
    }
}

/* --- REUSABLE COMPONENT CLASSES --- */

/* Glassmorphism Cards */
.card,
.glass-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--glass-shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card {
    border-radius: var(--radius-lg);
    padding: 18px;
    margin-bottom: 16px;
}

.card:hover,
.glass-card:hover {
    border-color: var(--border-glass-glowing);
}

/* Glowing outline wrappers */
.glowing-border {
    border: 1px solid var(--border-glass-glowing);
    box-shadow: 0 0 16px rgba(91, 93, 254, 0.15);
}

.glowing-border-accent {
    border: 1px solid rgba(34, 197, 94, 0.35);
    box-shadow: 0 0 16px rgba(34, 197, 94, 0.15);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    text-decoration: none;
    font-family: var(--font-heading);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: #ffffff;
}

.btn-primary:active {
    transform: scale(0.97);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
}

.btn-secondary:active {
    background: var(--bg-glass-hover);
    transform: scale(0.97);
}

.btn-danger {
    background: linear-gradient(135deg, var(--error) 0%, #d32f2f 100%);
    color: #ffffff;
}

.btn-danger:active {
    transform: scale(0.97);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
    border-radius: 10px;
}

.btn-round {
    border-radius: 30px;
}

.btn-full {
    width: 100%;
}

.btn-half {
    width: calc(50% - 6px);
}

/* Micro-animations: Ripple / shrink response */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: "";
    background: rgba(255, 255, 255, 0.18);
    display: block;
    position: absolute;
    border-radius: 50%;
    padding-top: 240%;
    padding-left: 240%;
    margin-top: -120%;
    margin-left: -120%;
    opacity: 0;
    transition: all 0.8s;
}

.ripple:active::after {
    padding-top: 0;
    padding-left: 0;
    margin-top: 0;
    margin-left: 0;
    opacity: 1;
    transition: 0s;
}

/* Utilities */
.text-green { color: var(--accent) !important; }
.text-red { color: var(--error) !important; }
.text-purple { color: var(--secondary) !important; }
.text-blue { color: var(--primary) !important; }
.text-yellow { color: var(--warning) !important; }
.text-muted { color: var(--text-muted) !important; }
.mt-12 { margin-top: 12px !important; }
.mt-16 { margin-top: 16px !important; }
.mt-24 { margin-top: 24px !important; }
.hide { display: none !important; }

/* Progress Bars */
.progress-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.light-theme .progress-bar-container {
    background: rgba(0, 102, 204, 0.05);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, #60a5fa 100%);
    border-radius: 10px;
    width: 0%;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-bar-container.mini {
    height: 5px;
}

.progress-bar-container.active-test {
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
}
.light-theme .progress-bar-container.active-test {
    background: rgba(0, 102, 204, 0.06);
}

/* Badge tags */
.subject-accuracy-badge {
    padding: 6px 12px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 700;
    font-family: var(--font-heading);
}

/* Background Soft colors */
.bg-blue-soft { background: rgba(91, 93, 254, 0.15); color: #7f81ff; }
.bg-purple-soft { background: rgba(124, 58, 237, 0.15); color: #a78bfa; }
.bg-yellow-soft { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.bg-green-soft { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.bg-orange-soft { background: rgba(249, 115, 22, 0.15); color: #ffedd5; }
.bg-red-soft { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }

.bg-primary-soft { background: rgba(91, 93, 254, 0.1); }
.bg-secondary-soft { background: rgba(124, 58, 237, 0.1); }
.bg-warning-soft { background: rgba(245, 158, 11, 0.1); }
.bg-accent-soft { background: rgba(34, 197, 94, 0.1); }

/* --- VIEW MANAGER --- */
.view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    transform: translateY(15px);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.view.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    z-index: 2;
}

/* --- SPLASH SCREEN --- */
#view-splash {
    background: #050816;
    position: fixed;
    inset: 0;
    width: 100vw;
    top: 0;
    height: 100dvh;
    min-height: 100svh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.splash-content {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding: 28px 24px calc(20px + env(safe-area-inset-bottom, 0px));
}

.splash-logo-container {
    position: absolute;
    inset: 0;
    margin: 0;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: #050816;
    z-index: 0;
}

.splash-glow {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(4, 8, 20, 0.04) 0%, rgba(4, 8, 20, 0.18) 58%, rgba(4, 8, 20, 0.68) 100%);
    z-index: 1;
    animation: none;
    pointer-events: none;
}

.splash-video-frame {
    width: 100%;
    height: 100%;
    border-radius: 0;
    overflow: hidden;
    position: absolute;
    inset: 0;
    background: #050816;
    border: 0;
    box-shadow: none;
    animation: none;
    z-index: 0;
}

.splash-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
    border-radius: 0;
    filter: saturate(1.08) contrast(1.03);
}

.splash-title {
    font-family: var(--font-heading);
    font-size: clamp(30px, 6vw, 42px);
    font-weight: 900;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff 30%, #dbeafe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 6px;
    position: relative;
    z-index: 2;
}

.splash-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.82);
    font-weight: 500;
    margin-bottom: 32px;
    letter-spacing: 0.3px;
    position: relative;
    z-index: 2;
}

.splash-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    width: 100%;
    max-width: none;
    padding: 52px 18px 18px;
    border-radius: 0;
    background: linear-gradient(180deg, rgba(4, 8, 20, 0) 0%, rgba(4, 8, 20, 0.42) 28%, rgba(4, 8, 20, 0.82) 100%);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.splash-loader-bar {
    width: 180px;
    height: 5px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 12px;
}

.splash-loader-progress {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 20px;
    animation: loadBar 2.5s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

.splash-loading-text {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.76);
    opacity: 1;
}

/* --- LOGIN SCREEN --- */
#view-login {
    background: radial-gradient(circle at bottom right, #2E1065 0%, var(--bg-primary) 80%);
    display: flex;
    flex-direction: column;
    padding: 40px 24px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.login-container {
    min-height: 100%;
    height: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 18px;
    padding-bottom: 28px;
}

.login-container > .login-card-glass {
    margin: 0;
}

.login-container > #btn-login {
    margin-top: auto;
}

.login-header {
    text-align: center;
    margin-top: 30px;
}

.login-logo {
    display: inline-block;
    margin-bottom: 20px;
}

.login-header h2 {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 12px;
}

.login-header p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
}

.login-card-glass {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    padding: 22px;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    margin: 40px 0;
}

.avatar-stack {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}

.mock-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    font-family: var(--font-heading);
    box-shadow: 0 4px 10px rgba(91,93,254,0.3);
}

.avatar-details {
    display: flex;
    flex-direction: column;
}

.profile-name {
    font-size: 16px;
    font-weight: 700;
}

.profile-username {
    font-size: 13px;
    color: var(--text-muted);
}

.tg-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 136, 204, 0.15);
    border: 1.5px solid rgba(0, 136, 204, 0.25);
    color: #38bdf8;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    width: 100%;
    justify-content: center;
}

.login-footer {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 0;
    opacity: 0.6;
}

/* --- MAIN CONTAINER LAYOUT --- */
.main-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.app-header-nav {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    padding: 0 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom: 1px solid var(--border-glass);
    z-index: 50;
    background: var(--bg-glass);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    transition: background-color 0.4s ease;
}

.user-greeting-sec {
    display: flex;
    align-items: center;
    gap: 12px;
}

.greeting-text {
    display: flex;
    flex-direction: column;
}

.user-greet {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
}

.today-date {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 1px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.premium-header-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 30px;
    cursor: pointer;
    animation: premiumGlowPulse 2s infinite alternate;
}

.header-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

/* Profile page is hand-tuned to fit one screen without scrolling (see navigateToPage in
   app.js, which toggles this class on/off when entering/leaving the profile page). */
.page-scroll-container.no-scroll {
    overflow: hidden;
}

/* SCROLLABLE WORKSPACE */
.page-scroll-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    /* --tg-content-safe-area-top is set from Telegram's real fullscreen inset (JS,
       syncTelegramSafeArea) -- the old fixed 64px here was sized for a .app-header-nav
       bar that isn't actually used in index.html anymore, so it was just dead space. */
    padding-top: calc(var(--tg-content-safe-area-top, 16px) + env(safe-area-inset-top, 0px));
    scroll-padding-top: calc(var(--tg-content-safe-area-top, 16px) + env(safe-area-inset-top, 0px));
    padding-bottom: 84px; /* space for float bottom nav */
    position: relative;
    width: 100%;
}

/* PAGE SECTION MANAGEMENT */
.page-section {
    display: none;
    width: 100%;
    animation: pageFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.page-section.active {
    display: block;
}

.page-header-info {
    margin-bottom: 20px;
}

.page-title {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 6px;
}

.page-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

.section-title-wrap {
    margin: 20px 0 12px 0;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.2px;
}

/* --- BOSH SAHIFA (HOME PAGE) --- */
/* --- APP HEADER STYLING (DESKTOP & MOBILE RESPONSIVE) --- */
.app-header-nav {
    height: 70px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.header-logo-section {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-cap-icon {
    width: 22px;
    height: 22px;
    color: #2563eb;
    filter: drop-shadow(0 2px 8px rgba(37, 99, 235, 0.45));
    animation: capPulse 3s infinite ease-in-out;
}

@keyframes capPulse {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    50% {
        transform: scale(1.08) rotate(-3deg);
    }
}

.header-brand {
    font-family: var(--font-heading);
    font-size: 21px;
    font-weight: 900;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    background: linear-gradient(135deg, #00d2ff 0%, #0066cc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

.header-nav-center {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-nav-item {
    font-family: var(--font-main);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    background: transparent;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

.header-nav-item:hover {
    background: var(--bg-glass-hover);
    color: var(--text-main);
}

.header-nav-item.active {
    background: #e0f2fe;
    color: #0066cc;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Mobile responsive app header */
@media (max-width: 768px) {
    .app-header-nav {
        display: grid !important;
        grid-template-columns: 40px 1fr 40px !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 0 16px !important;
        height: 56px !important;
    }
    
    .mobile-menu-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        grid-column: 1;
        background: transparent;
        border: none;
        cursor: pointer;
        color: var(--text-main);
        outline: none;
        padding: 4px;
    }
    
    .header-logo-section {
        grid-column: 2;
        justify-self: center;
        margin: 0 !important;
        gap: 6px !important;
    }
    
    .header-logo-section svg {
        width: 24px;
        height: 24px;
    }
    
    .header-brand-wrap h2 {
        font-size: 14px !important;
    }
    
    .header-brand-wrap span {
        font-size: 7px !important;
    }
    
    .header-nav-center {
        display: none !important;
    }
    
    .header-right {
        grid-column: 3;
        justify-self: end;
        gap: 0 !important;
    }
    
    .header-right .theme-toggle-btn,
    .header-right .premium-header-badge,
    .header-right .header-avatar {
        display: none !important;
    }
    
    .header-right .notif-btn {
        margin-right: 0 !important;
    }
}

/* --- BOSH SAHIFA (HOME PAGE - MYMANDAT DESIGN) --- */
.home-welcome-card {
    background: linear-gradient(135deg, #f0f7ff 0%, #e0f2fe 100%);
    border: 1px solid rgba(0, 102, 204, 0.1);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.dark-theme .home-welcome-card {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-color: rgba(255, 255, 255, 0.08);
}

.welcome-text-container {
    flex: 1;
    z-index: 2;
}

.welcome-greeting {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 6px;
}

.dark-theme .welcome-greeting {
    color: #ffffff;
}

.welcome-subtitle {
    font-size: 13px;
    color: #475569;
    margin-bottom: 16px;
    line-height: 1.4;
}

.dark-theme .welcome-subtitle {
    color: #94a3b8;
}

.promo-video-card {
    position: relative;
    width: min(100%, 360px);
    margin-bottom: 16px;
    border-radius: 22px;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.08), rgba(37, 99, 235, 0.08)),
        #0f172a;
    border: 1px solid rgba(59, 130, 246, 0.18);
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.12);
    isolation: isolate;
}

.promo-video-card,
.promo-video-frame,
.promo-video-badge {
    cursor: pointer;
}

.promo-video-card::before {
    content: "";
    position: absolute;
    inset: -40% auto auto -20%;
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, rgba(96, 165, 250, 0.35) 0%, transparent 70%);
    filter: blur(6px);
    pointer-events: none;
    z-index: 1;
}

.promo-video-card::after {
    content: "";
    position: absolute;
    inset: auto -30% -35% auto;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(91, 93, 254, 0.22) 0%, transparent 70%);
    filter: blur(8px);
    pointer-events: none;
    z-index: 1;
}

.promo-video-badge {
    position: absolute;
    bottom: 12px;
    right: 12px;
    z-index: 3;
    border: 0;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    color: rgba(255, 255, 255, 0.88);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: background 0.2s ease, color 0.2s ease;
}

.promo-video-badge:hover {
    background: rgba(255, 255, 255, 0.28);
    color: #fff;
}

.promo-video-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.promo-video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center center;
    transform: scale(1.02);
}

.promo-video-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    padding: 14px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.05) 0%, rgba(15, 23, 42, 0.22) 40%, rgba(15, 23, 42, 0.78) 100%);
    z-index: 2;
}

.promo-video-copy {
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-width: 78%;
}

.promo-video-kicker {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    opacity: 0.85;
}

.promo-video-title {
    font-size: 15px;
    line-height: 1.15;
    font-weight: 800;
}

.promo-video-subtitle {
    font-size: 11px;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.82);
}

/* Animated Streak Fire */
.animated-streak-fire {
    display: inline-block;
    filter: drop-shadow(0 0 4px rgba(239, 68, 68, 0.6));
    animation: flame-flicker 1.8s infinite alternate ease-in-out;
}

@keyframes flame-flicker {
    0% {
        transform: rotate(-2deg) scale(1);
        filter: drop-shadow(0 0 3px rgba(245, 158, 11, 0.5));
    }
    100% {
        transform: rotate(3deg) scale(1.12);
        filter: drop-shadow(0 0 7px rgba(239, 68, 68, 0.9));
    }
}

.ad-info-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(2, 6, 23, 0.58);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
    z-index: 9999;
}

.ad-info-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.ad-info-modal-panel {
    position: relative;
    width: min(100%, 540px);
    border-radius: 28px;
    padding: 22px;
    background:
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.22), transparent 30%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.94));
    color: #fff;
    box-shadow: 0 30px 80px rgba(2, 6, 23, 0.45);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

/* --- PRACTICE MODE MODAL --- */
/* .modal had no layout rules at all, so removing .hide just dropped it into normal document
   flow instead of centering it as a fixed overlay (matching .ad-info-modal's pattern below). */
.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(2, 6, 23, 0.58);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 9999;
}

.practice-mode-panel {
    position: relative;
    width: min(100%, 430px);
    border-radius: 28px;
    padding: 30px 16px 16px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(250, 250, 252, 0.97));
    color: var(--text-main);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
    border: 1px solid rgba(37, 99, 235, 0.10);
    overflow: visible;
}

.practice-mode-top-icon {
    position: absolute;
    left: 50%;
    top: -30px;
    transform: translateX(-50%);
    width: 62px;
    height: 62px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #ffffff, #eef4ff);
    border: 1px solid rgba(37, 99, 235, 0.18);
    color: #2563EB;
    box-shadow: 0 14px 34px rgba(37, 99, 235, 0.16);
}

.practice-mode-top-icon svg {
    width: 30px;
    height: 30px;
}

.practice-mode-kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.10);
    color: #2563EB;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.practice-mode-title {
    font-family: var(--font-heading);
    font-size: 20px;
    line-height: 1.15;
    margin-top: 0;
    text-align: center;
}

.practice-mode-subtitle {
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
}

/* Scrolls internally on short viewports so the top icon badge (which deliberately overflows
   above .practice-mode-panel) never has to sit inside a clipped/scrollable ancestor. */
.practice-mode-scroll {
    overflow-y: visible;
}

.practice-mode-hero {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-top: 18px;
}

.mode-choice-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 16px;
}

.mode-choice-card {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 78px;
    padding: 12px 14px 12px 12px;
    border-radius: 18px;
    border: 1px solid var(--border-glass);
    background: #fff;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
    text-align: left;
}

.mode-choice-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(37, 99, 235, 0.22);
}

.mode-choice-card.primary {
    background: linear-gradient(180deg, rgba(239, 246, 255, 0.98), rgba(255, 255, 255, 0.98));
    border-color: rgba(59, 130, 246, 0.16);
}

.mode-choice-card.secondary {
    background: linear-gradient(180deg, rgba(255, 251, 235, 0.98), rgba(255, 255, 255, 0.98));
    border-color: rgba(245, 158, 11, 0.16);
}

.mode-choice-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.mode-choice-icon.primary {
    background: rgba(37, 99, 235, 0.11);
    color: #2563EB;
}

.mode-choice-icon.secondary {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
}

.mode-choice-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.mode-choice-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.2;
}

.mode-choice-text {
    font-size: 10px;
    line-height: 1.35;
    color: var(--text-muted);
}

.mode-choice-arrow {
    width: 16px;
    height: 16px;
    justify-self: end;
    color: #cbd5e1;
}

.coming-soon-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.coming-soon-card {
    position: relative;
    overflow: hidden;
    min-height: 152px;
    border-radius: 20px;
    padding: 16px;
    border: 1px solid var(--border-glass);
    background: var(--bg-secondary);
    box-shadow: var(--shadow-sm);
}

.coming-soon-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.coming-soon-icon {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}

.coming-soon-icon.hist { background: rgba(245, 158, 11, 0.14); color: #f59e0b; }
.coming-soon-icon.law { background: rgba(37, 99, 235, 0.12); color: #2563EB; }
.coming-soon-icon.lang { background: rgba(124, 58, 237, 0.12); color: #7c3aed; }
.coming-soon-icon.red { background: rgba(239, 68, 68, 0.12); color: #ef4444; }
.coming-soon-icon.green { background: rgba(16, 185, 129, 0.12); color: #10b981; }
.coming-soon-icon.indigo { background: rgba(99, 102, 241, 0.12); color: #6366f1; }

.coming-soon-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.2;
}

.coming-soon-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(37, 99, 235, 0.08);
    color: #2563EB;
}

.coming-soon-desc {
    font-size: 11px;
    line-height: 1.45;
    color: var(--text-muted);
    margin-top: 10px;
}

.coming-soon-footer {
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.coming-soon-footer .btn {
    min-width: 92px;
}

@media (max-width: 480px) {
    .coming-soon-grid {
        display: flex;
    }

    .practice-mode-panel {
        padding: 18px;
    }
}

.coming-soon-progress {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
}

.ad-info-close {
    position: absolute;
    right: 14px;
    top: 14px;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.ad-info-hero {
    padding-right: 52px;
}

.ad-info-kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    margin-bottom: 12px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.18);
    color: #bfdbfe;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.ad-info-hero h3 {
    font-family: var(--font-heading);
    font-size: 24px;
    line-height: 1.15;
    margin-bottom: 10px;
}

.ad-info-hero p {
    color: rgba(226, 232, 240, 0.86);
    line-height: 1.55;
    font-size: 14px;
}

.ad-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 18px;
}

.ad-info-block {
    padding: 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.ad-info-label {
    display: block;
    margin-bottom: 8px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    color: #93c5fd;
}

.ad-info-block p {
    font-size: 13px;
    line-height: 1.5;
    color: rgba(241, 245, 249, 0.84);
}

.ad-info-block a {
    display: inline-flex;
    margin-top: 10px;
    color: #93c5fd;
    font-size: 13px;
    font-weight: 700;
}

.ad-info-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 18px;
}

.btn-welcome-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary);
    color: #ffffff;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 13px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.2);
    transition: all 0.2s ease;
}

.btn-welcome-action:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.welcome-img-container {
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.welcome-hero-illustration {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* --- 5-COLUMN UNIFORM GRID SHORTCUTS --- */
.home-shortcuts-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr) !important;
    grid-gap: 8px;
    margin-top: 18px;
    margin-bottom: 24px;
}

.shortcut-box-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 12px 2px;
    gap: 8px;
    background: var(--bg-secondary);
    border-radius: 16px;
    border: 1px solid var(--border-glass);
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 92px;
    width: 100%;
}

.shortcut-box-card:hover {
    background: var(--bg-glass-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    border-color: var(--border-glass-glowing);
}

.shortcut-icon-wrap {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.shortcut-box-card .shortcut-lbl {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.15;
    word-break: break-word;
    display: block;
    width: 100%;
}

.shortcut-icon-wrap {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.shortcut-lbl {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.3;
}

.home-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 24px 0 12px 0;
}

.home-sec-title {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 800;
    color: var(--text-main);
}

.btn-home-link {
    background: transparent;
    border: none;
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.home-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr) !important;
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 16px 8px;
    gap: 4px;
    margin-top: 12px;
}

.stat-item-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    padding: 4px !important;
    min-height: auto !important;
    width: 100% !important;
    transition: transform 0.2s ease;
}

.stat-item-card:hover {
    transform: translateY(-1px);
}

.stat-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-number {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.1;
}

.stat-lbl {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
}

.home-challenge-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
    transition: all 0.2s ease;
}

.home-challenge-container:hover {
    box-shadow: var(--shadow-sm);
}

.challenge-left {
    flex: 1;
}

.challenge-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.challenge-fire-icon {
    font-size: 18px;
}

.challenge-title-text {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 800;
    color: var(--text-main);
}

.challenge-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
    line-height: 1.4;
    text-align: left;
}

.challenge-progress-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.challenge-ratio {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
}

.challenge-progress-track {
    width: 100%;
    height: 6px;
    background: rgba(0, 102, 204, 0.05);
    border-radius: 10px;
    overflow: hidden;
}

.challenge-progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 10px;
    transition: width 0.6s ease;
}

.challenge-right {
    display: flex;
    align-items: center;
    justify-content: center;
}

.reward-box {
    background: rgba(0, 102, 204, 0.03);
    border: 1px dashed rgba(0, 102, 204, 0.2);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
    min-width: 100px;
}

.reward-gift-icon {
    font-size: 22px;
}

.reward-title {
    font-size: 9px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.reward-xp {
    font-size: 11px;
    font-weight: 800;
    color: var(--primary);
}

.recent-test-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.recent-test-row {
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.recent-test-row:hover {
    background: var(--bg-glass-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.recent-subject-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 16px;
    font-weight: 800;
    font-family: var(--font-heading);
}

.recent-subject-meta {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: left;
}

.recent-subj-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
}

.recent-subj-time {
    font-size: 11px;
    color: var(--text-muted);
}

.recent-score-badge {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.recent-score-val {
    font-size: 11px;
    font-weight: 800;
    color: var(--accent);
    background: rgba(34, 197, 94, 0.08);
    padding: 2px 8px;
    border-radius: 30px;
}

.recent-score-percent {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}

.chevron-right {
    color: var(--text-muted);
}
}

/* --- SUBJECTS PAGE --- */
.subjects-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.subject-card {
    padding: 16px;
    margin-bottom: 0;
}

.subject-card-top {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.subject-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    font-weight: 800;
    font-family: var(--font-heading);
}

.subject-details {
    flex: 1;
    margin-left: 12px;
    min-width: 0;
}

.subject-name {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 2px;
}

.subject-quantity {
    font-size: 11px;
    color: var(--text-muted);
}

.subject-card-progress {
    margin-bottom: 12px;
}

.sub-prog-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.subject-card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-glass);
    padding-top: 12px;
    gap: 10px;
}

.last-result-text {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.35;
    min-width: 0;
    flex: 1;
}

.subject-card-actions .btn {
    min-width: 92px;
    flex-shrink: 0;
}

/* --- ACTIVE PRACTICE PAGE --- */
.practice-header {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    margin-bottom: 16px;
}

.practice-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.practice-subject-title {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 800;
    color: var(--primary);
}

.practice-timer {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    padding: 4px 10px;
    border-radius: 30px;
}

.practice-progress-sec {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.practice-q-num {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

/* Question Container */
.question-card {
    padding: 22px;
}

.question-text {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.6;
    color: var(--text-main);
}

/* Options */
.options-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.option-item {
    display: flex;
    align-items: center;
    padding: 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 0;
    position: relative;
    border: 1.5px solid var(--border-glass);
}

.option-prefix {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    margin-right: 12px;
    color: var(--text-muted);
    transition: all 0.2s ease;
}
.light-theme .option-prefix {
    background: rgba(0, 0, 0, 0.05);
}

.option-content {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--text-main);
}

.option-indicator {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.15);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.25s ease;
}
.light-theme .option-indicator {
    border-color: rgba(0,0,0,0.15);
}

/* Active State Interactions */
.option-item.selected {
    border-color: var(--primary);
    background: rgba(91, 93, 254, 0.08);
}

.option-item.selected .option-prefix {
    background: var(--primary);
    color: #ffffff;
}

.option-item.selected .option-indicator {
    border-color: var(--primary);
    background: var(--primary);
}

.option-item.selected .option-indicator::after {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ffffff;
}

/* Correct/Incorrect animations on submission (Optional review mode) */
.option-item.correct {
    border-color: var(--accent) !important;
    background: rgba(34, 197, 94, 0.08) !important;
}
.option-item.correct .option-prefix {
    background: var(--accent) !important;
    color: #ffffff !important;
}
.option-item.correct .option-indicator {
    border-color: var(--accent) !important;
    background: var(--accent) !important;
}
.option-item.correct .option-indicator::after {
    content: "✔";
    color: #ffffff;
    font-size: 10px;
    font-weight: bold;
}

.option-item.incorrect {
    border-color: var(--error) !important;
    background: rgba(239, 68, 68, 0.08) !important;
}
.option-item.incorrect .option-prefix {
    background: var(--error) !important;
    color: #ffffff !important;
}
.option-item.incorrect .option-indicator {
    border-color: var(--error) !important;
    background: var(--error) !important;
}
.option-item.incorrect .option-indicator::after {
    content: "✖";
    color: #ffffff;
    font-size: 10px;
    font-weight: bold;
}

.practice-nav-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

/* --- SUMMARY PAGE (TEST TUGAGANDAN KEYIN) --- */
.summary-top-hero {
    text-align: center;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.trophy-glow-container {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 12px;
}

.trophy-glow {
    position: absolute;
    width: 160px;
    height: 160px;
    background: radial-gradient(circle, #F59E0B 0%, transparent 65%);
    opacity: 0.35;
    filter: blur(15px);
}

.trophy-svg {
    width: 80px;
    height: 80px;
    z-index: 2;
}

.summary-congrats {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 18px;
}

.summary-score-circle {
    background: var(--bg-glass);
    border: 2px solid var(--border-glass-glowing);
    width: 110px;
    height: 110px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 20px rgba(91,93,254,0.25);
    margin-bottom: 24px;
}

.summary-percent-num {
    font-family: var(--font-heading);
    font-size: 32px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.summary-percent-lbl {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 4px;
}

.score-breakdown-card {
    display: flex;
    justify-content: space-around;
    padding: 14px;
    text-align: center;
}

.score-breakdown-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sb-val {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 800;
}

.sb-lbl {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

/* AI Tahlili section styling */
.ai-analysis-card {
    padding: 20px;
}

.ai-header {
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.ai-spark-icon {
    font-size: 24px;
    animation: pulseGlow 1.5s infinite alternate;
}

.ai-title {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
}

.ai-status {
    font-size: 10px;
    color: var(--accent);
    font-weight: 600;
}

.ai-content-sections {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ai-sub-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ai-sec-title {
    font-size: 12px;
    font-weight: 700;
}

.ai-sec-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-left: 4px;
}

.ai-sec-list li {
    font-size: 12px;
    line-height: 1.5;
    position: relative;
    padding-left: 14px;
}

.ai-sec-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--text-muted);
}

.ai-sec-text {
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-muted);
}

.summary-actions {
    display: flex;
    flex-direction: column;
    margin-top: 24px;
}

/* --- STATISTIKA & CHART PAGE --- */
.chart-tab-container {
    display: flex;
    padding: 5px;
    border-radius: 12px;
    margin-bottom: 16px;
}

.chart-tab {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
    padding: 8px 0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-heading);
}

.chart-tab.active {
    background: var(--primary);
    color: #ffffff;
}

.chart-card {
    padding: 16px;
}

.chart-header {
    display: flex;
    flex-direction: column;
    margin-bottom: 16px;
}

.chart-title {
    font-size: 14px;
    font-weight: 700;
}

.chart-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.chart-canvas-container {
    width: 100%;
    height: 160px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Dynamic Subject analytics */
.subject-analytics-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sub-analytic-card {
    padding: 14px;
    margin-bottom: 0;
}

.sub-an-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.subject-icon.sm {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    font-size: 13px;
}

.sub-an-name {
    flex: 1;
    font-size: 14px;
    font-weight: 700;
}

.sub-an-percent {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 800;
}

.sub-an-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--border-glass);
    padding-top: 10px;
    text-align: center;
}

.metric-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.met-val {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 800;
}

.met-lbl {
    font-size: 10px;
    color: var(--text-muted);
}

/* --- REYTING (LEADERBOARD) --- */
.my-rating-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: rgba(34, 197, 94, 0.04);
}

.my-rating-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.my-rank-badge {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 800;
    color: var(--accent);
}

.my-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent);
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.my-details {
    display: flex;
    flex-direction: column;
}

.my-name {
    font-size: 13px;
    font-weight: 700;
}

.my-xp {
    font-size: 10px;
    color: var(--text-muted);
}

.my-medals {
    font-size: 20px;
}

/* Leaderboard List */
.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.leader-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    margin-bottom: 0;
}

.leader-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.leader-rank {
    width: 24px;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 800;
    color: var(--text-muted);
    text-align: center;
}

.rank-1 { color: #f59e0b; font-size: 16px; }
.rank-2 { color: #94a3b8; font-size: 16px; }
.rank-3 { color: #b45309; font-size: 16px; }

.leader-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #ffffff;
}
.light-theme .leader-avatar {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-main);
}

.leader-details {
    display: flex;
    flex-direction: column;
}

.leader-name {
    font-size: 13px;
    font-weight: 600;
}

.leader-meta {
    font-size: 10px;
    color: var(--text-muted);
}

.leader-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.leader-xp {
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 800;
    color: var(--primary);
}

.leader-medal {
    font-size: 16px;
}

/* --- PROFIL PAGE --- */
.profile-hero-card {
    position: relative;
    border-radius: var(--radius-lg);
    background:
        radial-gradient(circle at top, rgba(37, 99, 235, 0.16), transparent 46%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.86));
    border: 1px solid rgba(37, 99, 235, 0.10);
    padding: 8px 18px 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
    margin-bottom: 10px;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.08);
}

.profile-hero-glow {
    position: absolute;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.18) 0%, transparent 68%);
    opacity: 0.75;
    top: -70px;
    filter: blur(18px);
    pointer-events: none;
}

.profile-main-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb 0%, #60a5fa 100%);
    color: #ffffff;
    font-size: 19px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.24);
    margin-bottom: 5px;
    z-index: 2;
    font-family: var(--font-heading);
    border: 3px solid rgba(255, 255, 255, 0.9);
}

.profile-main-name {
    font-family: var(--font-heading);
    font-size: 17px;
    font-weight: 900;
    margin-bottom: 1px;
    z-index: 2;
    color: var(--text-main);
}

.profile-main-username {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
    z-index: 2;
}

.profile-level-card {
    width: 100%;
    margin-top: 2px;
    border-radius: 22px;
    padding: 10px 12px;
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(248, 250, 252, 0.88));
    border: 1px solid rgba(37, 99, 235, 0.12);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.06);
    z-index: 2;
}

.level-rank-glow {
    position: absolute;
    top: -46px;
    right: -34px;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.18) 0%, transparent 70%);
    pointer-events: none;
    animation: levelGlowPulse 4.5s ease-in-out infinite;
}

@keyframes levelGlowPulse {
    0%, 100% { opacity: 0.65; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

.profile-level-top {
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    z-index: 1;
}

.level-ring-wrap {
    position: relative;
    width: 68px;
    height: 68px;
    flex-shrink: 0;
}

.level-ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    overflow: visible;
}

.level-ring-track {
    fill: none;
    stroke: rgba(37, 99, 235, 0.12);
    stroke-width: 7;
}

.level-ring-fill {
    fill: none;
    stroke: url(#levelRingGradient);
    stroke-width: 7;
    stroke-linecap: round;
    stroke-dasharray: 226.19;
    stroke-dashoffset: 226.19;
    transition: stroke-dashoffset 0.9s cubic-bezier(0.4, 0, 0.2, 1);
}

.level-ring-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.level-ring-num {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 900;
    line-height: 1;
    color: var(--text-main);
}

.level-ring-lbl {
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 2px;
}

.profile-level-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
    flex: 1;
}

.profile-level-kicker {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
}

.profile-level-name {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 900;
    line-height: 1.15;
    color: var(--text-main);
}

.profile-level-rank-chip {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 1px;
    padding: 4px 10px 4px 8px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.10);
    color: #2563eb;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.profile-level-rank-chip svg {
    flex-shrink: 0;
}

.profile-level-progress-wrap {
    margin-top: 14px;
    position: relative;
    z-index: 1;
}

.profile-level-progress-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 700;
}

.profile-level-progress-sub {
    color: var(--text-muted);
    font-weight: 600;
}

.profile-level-progress-track {
    position: relative;
    height: 8px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.18);
    overflow: hidden;
}

.profile-level-progress-fill {
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2563eb 0%, #60a5fa 100%);
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.06);
    position: relative;
    overflow: hidden;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-level-progress-fill::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
    background-size: 50px 100%;
    background-repeat: no-repeat;
    animation: levelShimmer 2.4s linear infinite;
}

@keyframes levelShimmer {
    0% { background-position: -60px 0; }
    100% { background-position: 220px 0; }
}

.profile-level-milestones {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    padding: 0 25%;
    pointer-events: none;
}

.profile-level-milestones span {
    width: 2px;
    background: rgba(255, 255, 255, 0.55);
}

@media (prefers-reduced-motion: reduce) {
    .level-rank-glow,
    .profile-level-progress-fill::after {
        animation: none;
    }
}

.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 10px;
}

.profile-stat-box {
    margin-bottom: 0;
    padding: 13px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-stat-lbl {
    font-size: 11px;
    color: var(--text-muted);
}

.profile-stat-val {
    font-family: var(--font-heading);
    font-size: 17px;
    font-weight: 800;
}

.profile-premium-cta {
    width: 100%;
    margin-top: 10px;
    border: 0;
    border-radius: 20px;
    padding: 11px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    cursor: pointer;
    color: #ffffff;
    background: linear-gradient(120deg, #F59E0B 0%, #C2410C 45%, #7C3AED 100%);
    box-shadow: 0 16px 30px rgba(124, 58, 237, 0.24);
    position: relative;
    overflow: hidden;
    z-index: 2;
}

.premium-cta-shine {
    position: absolute;
    top: 0;
    left: -60%;
    width: 50%;
    height: 100%;
    background: linear-gradient(115deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    animation: premiumCtaShine 3.2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes premiumCtaShine {
    0% { left: -60%; }
    55%, 100% { left: 130%; }
}

.premium-cta-icon {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.18);
}

.premium-cta-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.premium-cta-kicker {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.85;
}

.premium-cta-title {
    font-size: 13px;
    font-weight: 800;
    line-height: 1.25;
    text-align: left;
}

.premium-cta-pill {
    flex-shrink: 0;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
    position: relative;
    z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
    .premium-cta-shine {
        animation: none;
        display: none;
    }
}

/* Navigation menu lists */
.profile-menu-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.profile-menu-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 13px 14px;
    width: 100%;
    cursor: pointer;
    border: 1px solid var(--border-glass);
    margin-bottom: 0;
    border-radius: 20px;
}

.profile-menu-item:active {
    background: var(--bg-glass-hover);
}

.menu-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.menu-icon-wrap {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.menu-label {
    font-size: 14px;
    font-weight: 600;
}

.chevron {
    color: var(--text-muted);
}

/* --- SETTINGS PAGE --- */
.settings-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    margin-bottom: 0;
}

.set-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    max-width: 70%;
}

.set-title {
    font-size: 14px;
    font-weight: 700;
}

.set-desc {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Switches */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 34px;
    border: 1px solid var(--border-glass);
}
.light-theme .toggle-slider {
    background-color: rgba(0, 0, 0, 0.05);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input:checked + .toggle-slider {
    background-color: var(--accent);
    border-color: var(--accent);
}

input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* Dropdown Select wrapper */
.custom-select-wrap {
    position: relative;
}

.settings-select {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
    padding: 8px 28px 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    font-family: var(--font-heading);
}

.custom-select-wrap::after {
    content: "▼";
    font-size: 8px;
    color: var(--text-muted);
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.settings-status-val {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.premium-btn-arrow {
    font-size: 12px;
    font-weight: 700;
    color: var(--secondary);
    background: rgba(124, 58, 237, 0.1);
    padding: 6px 12px;
    border-radius: 30px;
    cursor: pointer;
}

/* --- PREMIUM PAGE --- */
.premium-hero-header {
    position: relative;
    text-align: center;
    padding: 28px 16px 24px;
    margin-bottom: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: var(--radius-lg);
    background:
        radial-gradient(circle at 18% 18%, rgba(245, 158, 11, 0.22), transparent 45%),
        radial-gradient(circle at 85% 30%, rgba(124, 58, 237, 0.20), transparent 50%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.25));
    border: 1px solid rgba(245, 158, 11, 0.18);
}

.premium-hero-sparkle {
    position: absolute;
    color: rgba(245, 158, 11, 0.55);
    font-size: 13px;
    animation: premiumSparkle 2.8s ease-in-out infinite;
    pointer-events: none;
}

.premium-hero-sparkle.sparkle-1 { top: 20px; left: 16%; }
.premium-hero-sparkle.sparkle-2 { top: 38px; right: 14%; font-size: 9px; color: rgba(124, 58, 237, 0.5); animation-delay: 0.7s; }
.premium-hero-sparkle.sparkle-3 { bottom: 22px; left: 24%; font-size: 8px; animation-delay: 1.4s; }

@keyframes premiumSparkle {
    0%, 100% { opacity: 0.25; transform: scale(0.8) rotate(0deg); }
    50% { opacity: 1; transform: scale(1.15) rotate(18deg); }
}

.premium-crown-container {
    position: relative;
    width: 76px;
    height: 76px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.22), rgba(124, 58, 237, 0.16));
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--warning);
    margin-bottom: 14px;
    box-shadow: 0 10px 24px rgba(245, 158, 11, 0.22);
    z-index: 1;
}

.premium-crown-ring {
    position: absolute;
    inset: -7px;
    border-radius: 50%;
    border: 1.5px dashed rgba(245, 158, 11, 0.38);
    animation: premiumRingSpin 16s linear infinite;
}

@keyframes premiumRingSpin {
    to { transform: rotate(360deg); }
}

.premium-hero-eyebrow {
    position: relative;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--warning);
    margin-bottom: 2px;
    z-index: 1;
}

.premium-hero-title {
    position: relative;
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 900;
    margin-bottom: 6px;
    background: linear-gradient(120deg, #F59E0B, #7C3AED);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    z-index: 1;
}

.premium-hero-subtitle {
    position: relative;
    font-size: 12px;
    color: var(--text-muted);
    max-width: 80%;
    line-height: 1.4;
    z-index: 1;
}

.premium-benefits-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.benefit-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
    margin-bottom: 0;
}

.benefit-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 19px;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.05);
}

.benefit-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.benefit-title {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
}

.benefit-desc {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Bepul vs Premium comparison */
.premium-compare-card {
    padding: 18px;
}

.premium-compare-title {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 10px;
}

.premium-compare-row {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr;
    align-items: center;
    gap: 6px;
    padding: 9px 2px;
    border-top: 1px solid var(--border-glass);
}

.premium-compare-row:first-child {
    border-top: none;
    padding-bottom: 10px;
}

.premium-compare-feature {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-main);
}

.premium-compare-col-lbl {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    text-align: center;
    color: var(--text-muted);
}

.premium-compare-col-lbl.is-gold {
    color: var(--warning);
}

.premium-compare-val {
    font-size: 11.5px;
    font-weight: 700;
    text-align: center;
    color: var(--text-muted);
}

.premium-compare-val.is-no {
    opacity: 0.45;
}

.premium-compare-val.is-premium {
    color: var(--warning);
    font-weight: 800;
}

.premium-pricing-card {
    position: relative;
    padding: 20px;
    text-align: center;
    overflow: hidden;
}

.premium-pricing-ribbon {
    position: absolute;
    top: 14px;
    right: -32px;
    width: 130px;
    transform: rotate(35deg);
    background: linear-gradient(120deg, #F59E0B, #C2410C);
    color: #ffffff;
    font-size: 11px;
    font-weight: 900;
    padding: 4px 0;
    box-shadow: 0 4px 10px rgba(194, 65, 12, 0.3);
}

.pricing-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.price-old {
    font-size: 14px;
    text-decoration: line-through;
    color: var(--text-muted);
}

.price-now-wrap {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.price-now {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 900;
    background: linear-gradient(120deg, #F59E0B, #7C3AED);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.price-period {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
}

.pricing-badge {
    display: inline-block;
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 30px;
    margin-top: 8px;
}

.premium-pricing-checklist {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
}

.premium-pricing-checklist span {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--text-main);
    background: rgba(34, 197, 94, 0.1);
    padding: 5px 10px;
    border-radius: 999px;
}

.premium-purchase-btn {
    position: relative;
    overflow: hidden;
    background: linear-gradient(120deg, #F59E0B 0%, #C2410C 45%, #7C3AED 100%);
    box-shadow: 0 16px 32px rgba(124, 58, 237, 0.28);
}

.premium-purchase-shine {
    position: absolute;
    top: 0;
    left: -60%;
    width: 45%;
    height: 100%;
    background: linear-gradient(115deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: premiumCtaShine 3.4s ease-in-out infinite;
    pointer-events: none;
}

.premium-purchase-btn-text {
    position: relative;
    z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
    .premium-hero-sparkle,
    .premium-crown-ring,
    .premium-purchase-shine {
        animation: none;
    }
}

/* --- BOTTOM NAVIGATION BAR --- */
.bottom-nav {
    position: absolute;
    bottom: 16px;
    left: 16px;
    width: calc(100% - 32px);
    height: 64px;
    background: rgba(19, 26, 44, 0.7);
    border: 1.5px solid var(--border-glass);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: 20px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 80;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: border-color 0.4s ease;
}

.light-theme .bottom-nav {
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.nav-item {
    background: transparent;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    flex: 1;
    height: 100%;
    color: var(--text-muted);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.nav-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.2s ease;
}

.nav-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-family: var(--font-heading);
}

/* Active bottom nav transitions */
.nav-item.active {
    color: var(--primary);
}

.nav-item.active .nav-icon {
    transform: scale(1.15) translateY(-1px);
}

/* --- ANIMATION DEFINITIONS --- */
@keyframes pulseGlow {
    0% { opacity: 0.45; transform: scale(0.95); }
    100% { opacity: 0.65; transform: scale(1.05); }
}

@keyframes rotateLogo {
    0% { transform: rotate(0deg); }
    30% { transform: rotate(0deg); }
    40% { transform: rotate(8deg); }
    50% { transform: rotate(-8deg); }
    60% { transform: rotate(0deg); }
    100% { transform: rotate(0deg); }
}

@keyframes loadBar {
    0% { width: 0%; }
    20% { width: 25%; }
    55% { width: 60%; }
    80% { width: 90%; }
    100% { width: 100%; }
}

@keyframes pageFadeIn {
    0% {
        opacity: 0;
        transform: translateY(12px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes premiumGlowPulse {
    0% {
        box-shadow: 0 0 4px rgba(245, 158, 11, 0.4);
    }
    100% {
        box-shadow: 0 0 16px rgba(245, 158, 11, 0.7);
    }
}

.animate-bounce {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
        animation-timing-function: cubic-bezier(0.8,0,1,1);
    }
    50% {
        transform: translateY(-8px);
        animation-timing-function: cubic-bezier(0,0,0.2,1);
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .5; }
}

/* --- PDF REPORT DISPLAY PRINT STYLING --- */
.print-report-hide {
    display: none;
}

@media print {
    body * {
        visibility: hidden;
    }
    #print-report-container, #print-report-container * {
        visibility: visible;
    }
    #print-report-container {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        display: block !important;
        background: #ffffff;
        color: #000000;
        padding: 40px;
        font-family: sans-serif;
    }
    .print-header {
        text-align: center;
        margin-bottom: 20px;
    }
    .print-header h1 {
        font-size: 24px;
        margin-bottom: 5px;
    }
    .print-date {
        font-size: 12px;
        color: #555555;
    }
    .print-profile-info {
        margin: 20px 0;
        font-size: 14px;
        line-height: 1.6;
    }
    .print-report-container h3 {
        margin-top: 20px;
        border-bottom: 1px solid #ddd;
        padding-bottom: 5px;
    }
    .print-report-container ul {
        margin-left: 20px;
        margin-top: 10px;
    }
    .print-report-container li {
        font-size: 13px;
        line-height: 1.6;
        margin-bottom: 4px;
    }
    .print-footer {
        margin-top: 40px;
        text-align: center;
        font-size: 11px;
        color: #777;
        border-top: 1px solid #eee;
        padding-top: 15px;
    }
}

/* --- MANDAT PAGE CALCULATOR STYLING --- */
.mandat-score-card {
    padding: 24px;
}

.score-input-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.score-input-header h4 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
}

.score-calc-source {
    font-size: 12px;
    color: var(--text-muted);
}

.input-row {
    display: flex;
    gap: 12px;
    margin-top: 14px;
}

.mandat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    color: var(--text-main);
    font-size: 15px;
    font-weight: 600;
    outline: none;
    transition: all 0.25s ease;
}

.light-theme .mandat-input {
    background: rgba(15, 23, 42, 0.04);
}

.mandat-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(91, 93, 254, 0.15);
}

.input-hint {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
}

.choice-row-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    margin-bottom: 12px;
}

.choice-number-badge {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-glass-hover);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    font-family: var(--font-heading);
    border: 1px solid var(--border-glass);
}

.choice-selectors {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.mandat-select {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text-main);
    font-size: 13px;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.light-theme .mandat-select {
    background: rgba(15, 23, 42, 0.03);
}

.mandat-select:focus {
    border-color: var(--primary);
}

.mandat-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Outcome Results styling */
.mandat-results-card {
    padding: 24px;
    margin-top: 24px;
    border: 1px solid rgba(124, 58, 237, 0.25);
    box-shadow: 0 0 24px rgba(124, 58, 237, 0.1);
}

.results-card-title {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 16px;
}

.results-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.result-choice-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-glass);
}

.result-choice-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.result-header {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-width: 60%;
}

.result-otm-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
}

.result-course-name {
    font-size: 11px;
    color: var(--text-muted);
}

.result-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 600;
}

.result-chance-gauge {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chance-bar-container {
    width: 60px;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
}

.light-theme .chance-bar-container {
    background: rgba(0, 102, 204, 0.05);
}

.chance-fill {
    height: 100%;
    border-radius: 10px;
    width: 0%;
    transition: width 0.8s ease-out;
}

.chance-fill.high { background: var(--accent); }
.chance-fill.med { background: var(--warning); }
.chance-fill.low { background: var(--error); }

.chance-badge {
    padding: 4px 10px;
    border-radius: 30px;
    font-size: 11px;
    font-weight: 800;
    font-family: var(--font-heading);
}

.chance-badge.high { background: rgba(34, 197, 94, 0.15); color: var(--accent); }
.chance-badge.med { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.chance-badge.low { background: rgba(239, 68, 68, 0.15); color: var(--error); }

/* --- FLOATING CHAT BUTTON (CYBERBILIM STYLE) --- */
.floating-chat-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 102, 204, 0.25);
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.floating-chat-btn:hover {
    transform: translateY(-4px) scale(1.05);
    background: var(--primary-hover);
    box-shadow: 0 8px 24px rgba(0, 102, 204, 0.4);
}

.floating-chat-btn svg {
    transition: transform 0.3s ease;
}

.floating-chat-btn:hover svg {
    transform: rotate(5deg);
}

@media (max-width: 768px) {
    .floating-chat-btn {
        bottom: 84px; /* Move up to clear floating bottom navigation bar on mobile */
        right: 16px;
        width: 48px;
        height: 48px;
    }
}

/* --- CYBERBILIM LIGHT THEME COLOR ALIGNMENT OVERRIDES --- */
.light-theme .countdown-card {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%) !important;
    border: 1px solid rgba(0, 102, 204, 0.15) !important;
}

.light-theme .countdown-badge {
    background: rgba(0, 102, 204, 0.08) !important;
    border: 1px solid rgba(0, 102, 204, 0.15) !important;
    color: var(--primary) !important;
}

.light-theme .countdown-title {
    color: #334155 !important;
}

.light-theme .countdown-number {
    color: #0f172a !important;
}

.light-theme .countdown-unit {
    color: var(--primary) !important;
}

.light-theme .countdown-progress-val {
    color: #0f172a !important;
}

.light-theme .progress-ring-bg {
    stroke: rgba(0, 102, 204, 0.1) !important;
}

.light-theme .progress-ring-fill {
    stroke: var(--primary) !important;
}

.light-theme .header-nav-item.active {
    color: #0066cc !important;
    background: #e0f2fe !important;
}

.light-theme .module-item.active {
    background: #e8f0fe !important;
    border: 1px solid #0066cc !important;
}

.light-theme .module-item.active .module-badge {
    background: #0066cc !important;
    color: #ffffff !important;
}

.light-theme .module-item.active .module-title {
    color: #0066cc !important;
}

.light-theme .module-item.active .module-subtitle {
    color: #60a5fa !important;
}

/* ------------------------------------------------------------------
   MYMANDAT PREMIUM LIGHT UI SKIN
   Keeps the existing layout, upgrades the visual system only.
------------------------------------------------------------------- */
.light-theme {
    color-scheme: light;
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.82);
    --bg-glass-hover: #f8fbff;
    --border-glass: #e5e7eb;
    --border-glass-glowing: rgba(37, 99, 235, 0.18);
    --text-main: #1f2937;
    --text-muted: #64748b;
    --glass-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    --scroll-bar-color: rgba(148, 163, 184, 0.35);
}

html.light-theme,
body.light-theme {
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 28%),
        radial-gradient(circle at top right, rgba(96, 165, 250, 0.1), transparent 24%),
        linear-gradient(180deg, #f8fafc 0%, #eef5ff 100%);
}

body.light-theme {
    align-items: stretch;
    justify-content: flex-start;
    overflow: hidden;
}

.light-theme .app-root-container {
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.06), transparent 28%),
        linear-gradient(180deg, #f8fafc 0%, #f3f7fc 100%);
    color: #1f2937;
}

.light-theme .main-container,
.light-theme .main-content-wrapper {
    background: transparent;
}

.light-theme .desktop-sidebar {
    display: none;
}

.light-theme .app-header-nav {
    position: sticky;
    top: 0;
    z-index: 90;
    height: 76px;
    margin: 12px 12px 0;
    padding: 0 14px;
    border: 1px solid rgba(229, 231, 235, 0.9);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.light-theme .header-logo-section {
    gap: 10px;
}

.light-theme .header-right {
    gap: 8px;
}

.light-theme .header-nav-center {
    display: none;
}

/* Header simplified for plain background layout */
.app-header-nav {
    height: auto !important;
    margin: 0 !important;
    padding: 14px 16px 6px !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    justify-content: flex-start !important;
}

.header-logo-section {
    gap: 8px !important;
}

.header-brand {
    font-size: 18px !important;
    letter-spacing: -0.02em !important;
}

.header-nav-center,
.header-right,
.mobile-menu-btn,
.header-brand-sub,
.notif-btn,
.theme-toggle-btn,
.premium-header-badge,
.header-avatar {
    display: none !important;
}

.light-theme .app-header-nav {
    height: auto !important;
    margin: 0 !important;
    padding: 14px 16px 6px !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.light-theme .header-logo-section {
    gap: 0 !important;
}

.light-theme .page-scroll-container {
    padding: 16px 12px 108px;
}

.light-theme .page-section {
    animation: none;
}

.light-theme .glass-card,
.light-theme .card,
.light-theme .home-welcome-card,
.light-theme .home-challenge-container,
.light-theme .recent-test-row,
.light-theme .stat-item-card,
.light-theme .subject-card,
.light-theme .mandat-score-card,
.light-theme .choice-row-card,
.light-theme .profile-hero-card,
.light-theme .profile-stat-box,
.light-theme .benefit-card,
.light-theme .premium-pricing-card,
.light-theme .settings-item,
.light-theme .chart-card,
.light-theme .ai-analysis-card,
.light-theme .score-breakdown-card,
.light-theme .my-rating-panel,
.light-theme .module-item,
.light-theme .sidebar-progress-card,
.light-theme .chart-tab-container,
.light-theme .sub-analytic-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    border-radius: 20px;
}

.light-theme .home-welcome-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px;
    background:
        linear-gradient(135deg, rgba(239, 246, 255, 0.98) 0%, rgba(255, 255, 255, 0.98) 45%, rgba(229, 243, 255, 0.94) 100%);
    border: 1px solid rgba(229, 231, 235, 0.95);
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
    min-height: 188px;
}

.light-theme .welcome-text-container {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.light-theme .welcome-greeting,
.light-theme .username-placeholder,
.light-theme .section-title,
.light-theme .home-sec-title,
.light-theme .page-title,
.light-theme .profile-title {
    color: #1f2937;
    letter-spacing: -0.03em;
    font-family: var(--font-main);
    font-weight: 800;
}

/* .premium-hero-title keeps its own gradient-clip fill (set once, near the premium page rules)
   instead of the shared solid heading color above — it needs color: transparent to stay transparent
   in both themes so the background-clip gradient actually shows through. */
.light-theme .premium-hero-title {
    letter-spacing: -0.03em;
    font-family: var(--font-main);
}

.light-theme .welcome-greeting {
    font-size: 19px;
    line-height: 1.12;
}

.light-theme .welcome-subtitle,
.light-theme .section-subtitle,
.light-theme .challenge-desc,
.light-theme .sub-analytic-subtitle,
.light-theme .premium-hero-subtitle,
.light-theme .profile-subtitle,
.light-theme .spc-lbl,
.light-theme .module-subtitle,
.light-theme .text-muted,
.light-theme .nav-label,
.light-theme .login-footer,
.light-theme .pricing-badge {
    color: #64748b;
}

.light-theme .welcome-hero-illustration,
.light-theme .hero-illustration,
.light-theme .profile-hero-illustration {
    width: min(176px, 42vw);
    max-width: 180px;
    filter: drop-shadow(0 10px 18px rgba(37, 99, 235, 0.10));
}

.light-theme .welcome-img-container {
    width: 176px;
    height: 156px;
    margin-right: -10px;
    align-self: flex-end;
}

.light-theme .btn,
.light-theme .btn-primary,
.light-theme .btn-secondary,
.light-theme .btn-welcome-action,
.light-theme .btn-full,
.light-theme .btn-sidebar-logout,
.light-theme .btn-subject-start,
.light-theme .btn-home-link,
.light-theme .btn-mandat-calc,
.light-theme .btn-profile-primary {
    border-radius: 22px;
    font-weight: 700;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.light-theme .btn-primary,
.light-theme .btn-welcome-action,
.light-theme .btn-mandat-calc,
.light-theme .btn-profile-primary {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    color: #ffffff;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.18);
}

.light-theme .btn-primary:hover,
.light-theme .btn-welcome-action:hover,
.light-theme .btn-mandat-calc:hover,
.light-theme .btn-profile-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #60a5fa 100%);
    transform: translateY(-1px);
}

.light-theme .shortcut-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 16px;
}

.light-theme .shortcut-lbl {
    font-size: 10px;
    line-height: 1.15;
    font-weight: 700;
    color: #1f2937;
}

.light-theme .home-stats-grid {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.04);
}

.light-theme .stat-item-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    min-height: auto !important;
    align-items: center !important;
    text-align: center !important;
}

.light-theme .stat-number {
    font-size: 16px;
    line-height: 1.05;
}

.light-theme .stat-lbl {
    font-size: 10px;
    line-height: 1.18;
}

.light-theme .stat-item-card strong,
.light-theme .stat-item-card .stat-value,
.light-theme .spc-val,
.light-theme .challenge-ratio,
.light-theme .score-value,
.light-theme .profile-stat-value {
    color: #1f2937;
    font-weight: 800;
}

.light-theme .home-challenge-container {
    display: grid;
    grid-template-columns: 1.12fr 0.88fr;
    gap: 10px;
    padding: 15px;
    background: linear-gradient(135deg, rgba(239, 246, 255, 0.95) 0%, rgba(255, 255, 255, 0.98) 100%);
}

.light-theme .challenge-right {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid rgba(37, 99, 235, 0.12);
    border-radius: 18px;
    padding: 16px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.light-theme .challenge-progress-track,
.light-theme .progress-bar-container,
.light-theme .practice-progress-track {
    background: #e8eef7;
    border-radius: 999px;
    overflow: hidden;
}

.light-theme .challenge-progress-fill,
.light-theme .progress-bar-fill,
.light-theme .practice-progress-fill {
    background: linear-gradient(90deg, #2563eb 0%, #60a5fa 100%);
}

.light-theme .recent-test-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 14px 12px;
    margin-bottom: 10px;
    border-radius: 18px;
    min-height: 80px;
}

.light-theme .recent-subject-icon {
    width: 42px;
    height: 42px;
    border-radius: 16px;
    font-weight: 800;
}

.light-theme .recent-test-left,
.light-theme .leader-left,
.light-theme .profile-hero-card,
.light-theme .profile-stat-box {
    color: #1f2937;
}

.light-theme .score-badge,
.light-theme .leader-xp,
.light-theme .subject-accuracy-badge,
.light-theme .chance-badge,
.light-theme .my-rating-value {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid rgba(37, 99, 235, 0.12);
    border-radius: 999px;
    font-weight: 800;
}

.light-theme .question-card,
.light-theme .summary-top-hero,
.light-theme .ai-analysis-card,
.light-theme .chart-card,
.light-theme .mandat-score-card,
.light-theme .mandat-results-card,
.light-theme .profile-hero-card,
.light-theme .premium-pricing-card,
.light-theme .settings-item,
.light-theme .score-breakdown-card,
.light-theme .my-rating-panel,
.light-theme .chart-tab-container,
.light-theme .sub-analytic-card {
    padding: 16px;
}

/* .premium-hero-header keeps its own (asymmetric top/bottom) padding set near the premium page
   rules — it's a decorative gradient hero, not a plain content card like the others above. */
.light-theme .premium-hero-header {
    padding: 28px 16px 24px;
}

.light-theme .option-item,
.light-theme .choice-row-card,
.light-theme .subject-card,
.light-theme .card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.light-theme .option-item.selected {
    border-color: rgba(37, 99, 235, 0.35);
    background: #eff6ff;
}

.light-theme .app-header-nav,
.light-theme .home-welcome-card,
.light-theme .home-challenge-container,
.light-theme .profile-hero-card,
.light-theme .premium-hero-header,
.light-theme .summary-top-hero {
    overflow: hidden;
}

.light-theme .app-header-nav {
    background: var(--bg-glass);
    border-bottom: 1px solid var(--border-glass);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: none;
}

.light-theme .page-scroll-container {
    background: #f8fafc;
    padding: calc(64px + env(safe-area-inset-top, 0px)) 12px 132px;
    scroll-padding-top: calc(64px + env(safe-area-inset-top, 0px));
}

.light-theme .bottom-nav {
    position: fixed;
    left: 0 !important;
    transform: none;
    bottom: 0 !important;
    width: 100vw !important;
    height: 88px;
    border-radius: 28px 28px 0 0 !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(229, 231, 235, 0.95);
    border-bottom: none;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
    padding-bottom: env(safe-area-inset-bottom);
    margin: 0 !important;
}

.light-theme .nav-item {
    color: #64748b;
    border-radius: 18px;
    margin: 0 2px;
    padding: 10px 4px 8px;
    gap: 5px;
    transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.light-theme .nav-item.active {
    color: #2563eb;
    transform: translateY(-1px);
}

.light-theme .nav-icon {
    stroke: currentColor;
    width: 24px;
    height: 24px;
}

.light-theme .nav-label {
    font-size: 12px;
    line-height: 1;
    letter-spacing: 0;
    font-weight: 500;
}

.light-theme .practice-nav-actions,
.light-theme .summary-actions,
.light-theme .mandat-actions,
.light-theme .profile-menu-item {
    gap: 10px;
}

.light-theme .header-nav-item.active {
    color: #2563eb;
    background: #eff6ff;
}

.light-theme .header-right .notif-btn,
.light-theme .theme-toggle-btn,
.light-theme .mobile-menu-btn,
.light-theme .profile-menu-item,
.light-theme .shortcut-item,
.light-theme .recent-test-row,
.light-theme .module-item,
.light-theme .btn,
.light-theme .nav-item {
    cursor: pointer;
}

.light-theme .floating-chat-btn {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    box-shadow: 0 16px 36px rgba(37, 99, 235, 0.22);
}

.light-theme .floating-chat-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #60a5fa 100%);
}

.light-theme .hero-illustration {
    border-radius: 24px;
}

.light-theme .login-container,
.light-theme .splash-content {
    background: transparent;
}

.light-theme .login-card-glass {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e5e7eb;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.light-theme .splash-content {
    color: #1f2937;
}

.light-theme .splash-logo-container {
    background: #07111f;
}

.light-theme .splash-video-frame {
    background: #07111f;
    border-color: transparent;
    box-shadow: none;
}

.light-theme .splash-glow {
    background: linear-gradient(180deg, rgba(7, 17, 31, 0.04) 0%, rgba(7, 17, 31, 0.18) 55%, rgba(7, 17, 31, 0.82) 100%);
}

.light-theme .splash-subtitle,
.light-theme .splash-loading-text {
    color: rgba(255, 255, 255, 0.82);
}

.light-theme .challenge-title-text,
.light-theme .recent-subj-name,
.light-theme .subject-name,
.light-theme .module-title,
.light-theme .profile-name,
.light-theme .sidebar-title {
    font-weight: 700;
    color: #1f2937;
}

.light-theme .login-footer {
    color: #64748b;
}

@media (min-width: 768px) {
    .light-theme .desktop-sidebar {
        display: flex;
    }

    .light-theme .header-nav-center {
        display: flex;
    }

    .light-theme .app-header-nav {
        max-width: none;
        margin-inline: 0;
    }

    .light-theme .page-scroll-container {
        padding-inline: 24px;
    }

    .light-theme .home-shortcuts-row {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .light-theme .home-stats-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .light-theme .header-nav-center {
        display: none;
    }

    .light-theme .app-header-nav {
        gap: 10px;
        margin: 0;
        border-radius: 0 0 24px 24px;
        border-top: none;
        border-left: none;
        border-right: none;
    }

    .light-theme .welcome-greeting {
        font-size: 20px;
    }

    .light-theme .home-welcome-card {
        flex-direction: row;
    }

    .light-theme .welcome-img-container {
        width: 146px;
        height: 136px;
        flex-shrink: 0;
    }

    .promo-video-card {
        width: 100%;
        max-width: none;
        border-radius: 18px;
    }

    .promo-video-overlay {
        padding: 12px;
    }

    .promo-video-badge {
        right: 10px;
        bottom: 10px;
    }

    .promo-video-copy {
        max-width: 90%;
    }

    .promo-video-title {
        font-size: 14px;
    }

    .promo-video-subtitle {
        font-size: 10px;
    }

    .ad-info-modal {
        padding: 12px;
        align-items: flex-end;
    }

    .ad-info-modal-panel {
        width: 100%;
        border-radius: 22px;
        padding: 18px;
    }

    .ad-info-grid {
        grid-template-columns: 1fr;
    }

    .ad-info-hero h3 {
        font-size: 20px;
    }
}

@media (max-width: 430px) {
    .light-theme .page-scroll-container {
        padding-inline: 12px;
    }

    .light-theme .home-welcome-card {
        padding: 18px;
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
    }

    .light-theme .home-challenge-container {
        grid-template-columns: 1fr;
    }

    .light-theme .home-shortcuts-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }


    .light-theme .shortcut-item {
        min-height: 100px;
        padding: 10px 5px;
    }

    .light-theme .shortcut-icon-wrap {
        width: 42px;
        height: 42px;
    }

    .light-theme .shortcut-lbl {
        font-size: 9px;
    }

    .light-theme .stat-item-card {
        min-height: 138px;
        padding: 14px 8px;
    }
}

/* subtle premium motion */
.light-theme .ripple::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.18) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.18s ease;
    pointer-events: none;
}

.light-theme .ripple:active::after {
    opacity: 1;
}

/* Telegram WebApp safe spacing */
.telegram-app .app-header-nav {
    padding-left: 64px !important;
}

.telegram-app .page-scroll-container {
    padding-top: calc(64px + env(safe-area-inset-top, 0px)) !important;
    scroll-padding-top: calc(64px + env(safe-area-inset-top, 0px)) !important;
    padding-bottom: calc(140px + env(safe-area-inset-bottom, 0px)) !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
}

.telegram-app .bottom-nav {
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
}

/* --- MOBILE LAYOUT STABILIZER --- */
@media (max-width: 767px) {
    .app-root-container,
    .main-container,
    .main-content-wrapper,
    .page-scroll-container,
    .view {
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
    }

    .page-scroll-container {
        padding-left: 12px !important;
        padding-right: 12px !important;
        padding-top: calc(64px + env(safe-area-inset-top, 0px)) !important;
    }

    #view-login {
        padding: 24px 16px 28px;
    }

    .login-container {
        gap: 14px;
        padding-bottom: 36px;
    }

    .login-header {
        margin-top: 10px;
    }

    .login-card-glass {
        margin: 8px 0 0;
        padding: 18px;
    }

    .card,
    .glass-card,
    .home-welcome-card,
    .home-challenge-container,
    .recent-test-row,
    .subject-card,
    .question-card,
    .profile-hero-card,
    .profile-stat-box,
    .premium-hero-header,
    .premium-pricing-card,
    .settings-item,
    .chart-card,
    .chart-tab-container,
    .my-rating-panel,
    .sub-analytic-card,
    .mandat-score-card,
    .mandat-results-card,
    .choice-row-card,
    .benefit-card {
        width: 100%;
        max-width: none;
        box-sizing: border-box;
    }

    .home-welcome-card {
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        gap: 14px;
    }

    .welcome-text-container,
    .recent-subject-meta,
    .subject-details,
    .menu-item-left,
    .set-info,
    .profile-main-info,
    .premium-hero-copy,
    .practice-meta,
    .challenge-left {
        text-align: left;
        align-items: flex-start;
    }

    .welcome-img-container {
        width: 100%;
        max-width: 220px;
        height: auto;
        margin-right: 0;
        align-self: center;
    }

    .welcome-hero-illustration,
    .hero-illustration,
    .profile-hero-illustration {
        width: 100%;
        max-width: 220px;
        height: auto;
    }

    .welcome-img-container {
        display: none;
    }

    .promo-video-card {
        width: 100%;
        max-width: none;
        border-radius: 18px;
        margin-bottom: 14px;
    }

    .promo-video-overlay {
        padding: 12px;
    }

    .promo-video-copy {
        max-width: 90%;
    }

    .promo-video-title {
        font-size: 14px;
    }

    .promo-video-subtitle {
        font-size: 10px;
    }

    .profile-hero-card {
        padding: 22px 14px;
    }

    .profile-main-avatar {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }

    .profile-stats-grid {
        gap: 10px;
    }

    .profile-menu-item,
    .settings-item {
        padding: 14px 12px;
    }

    .menu-icon-wrap {
        width: 28px;
        height: 28px;
    }

    .subject-icon {
        width: 36px;
        height: 36px;
    }

    .subject-icon.sm {
        width: 24px;
        height: 24px;
    }

    .premium-crown-container {
        width: 68px;
        height: 68px;
    }

    .home-shortcuts-row,
    .profile-stats-grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }


    .sub-an-metrics {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 6px;
    }

    .met-val {
        font-size: 13px;
    }

    .met-lbl {
        font-size: 9px;
    }

    .home-shortcuts-row {
        gap: 8px;
    }

    .shortcut-item,
    .stat-item-card {
        align-items: flex-start;
        text-align: left;
    }

    .shortcut-item {
        min-height: 96px;
        padding: 10px 8px;
    }

    .shortcut-icon-wrap,
    .stat-icon-wrap,
    .menu-icon-wrap,
    .subject-icon,
    .subject-icon.sm,
    .recent-subject-icon {
        flex-shrink: 0;
    }

    .recent-test-row,
    .settings-item,
    .profile-menu-item,
    .practice-meta,
    .subject-card-top,
    .sub-an-header,
    .premium-promo-banner,
    .my-rating-panel {
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
    }

    .home-challenge-container {
        display: grid !important;
        grid-template-columns: 1fr !important;
    }

    .challenge-right {
        width: 100%;
        justify-content: flex-start;
    }

    .chart-tab-container {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .chart-tab {
        width: 100%;
        font-size: 12px;
    }

    .premium-hero-subtitle,
    .chart-subtitle,
    .set-desc,
    .promo-desc,
    .profile-main-username {
        max-width: 100%;
    }

    .subject-card-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .subject-card-actions .btn {
        width: 100%;
    }

    .bottom-nav {
        width: 100vw !important;
        left: 0 !important;
        right: 0 !important;
        transform: none !important;
        height: 60px;
        border-radius: 18px 18px 0 0;
        padding: 0 8px;
    }

    .nav-item {
        gap: 2px;
        padding: 4px 0;
    }

    .nav-icon {
        width: 18px;
        height: 18px;
    }

    .nav-label {
        font-size: 8px;
    }

    /* Mobile Compact Layout Overrides to fit everything on a single screen */
    .page-scroll-container {
        padding-top: calc(60px + env(safe-area-inset-top, 0px)) !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
        padding-bottom: 76px !important;
    }

    .practice-mode-panel {
        width: calc(100vw - 24px);
        max-width: 430px;
        padding: 22px 14px 14px;
        border-radius: 24px;
        max-height: calc(100dvh - 24px);
        display: flex;
        flex-direction: column;
    }

    .practice-mode-scroll {
        overflow-y: auto;
        min-height: 0;
    }

    .mode-choice-card {
        grid-template-columns: 44px minmax(0, 1fr) auto;
        min-height: 76px;
        padding: 12px 12px 12px 10px;
    }

    .mode-choice-icon {
        width: 44px;
        height: 44px;
        border-radius: 14px;
    }

    .practice-mode-top-icon {
        width: 50px;
        height: 50px;
        top: -25px;
    }

    .practice-mode-top-icon svg {
        width: 24px;
        height: 24px;
    }

    .home-section-header {
        margin-top: 10px !important;
        margin-bottom: 4px !important;
    }

    .home-sec-title {
        font-size: 14px !important;
    }

    .btn-home-link {
        font-size: 11px !important;
    }

    .home-shortcuts-grid {
        margin-top: 8px !important;
        margin-bottom: 12px !important;
        grid-gap: 6px !important;
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .shortcut-box-card {
        min-height: 72px !important;
        padding: 6px 2px !important;
        border-radius: 12px !important;
        gap: 4px !important;
    }

    .shortcut-icon-wrap {
        width: 32px !important;
        height: 32px !important;
        border-radius: 10px !important;
    }

    .shortcut-icon-wrap svg {
        width: 16px !important;
        height: 16px !important;
    }

    .shortcut-box-card .shortcut-lbl {
        font-size: 8px !important;
        line-height: 1.1 !important;
    }

    .home-stats-grid {
        padding: 10px 4px !important;
        gap: 4px !important;
        margin-top: 6px !important;
        border-radius: 14px !important;
    }

    .stat-item-card {
        gap: 4px !important;
        padding: 2px !important;
    }

    .stat-icon-wrap {
        width: 28px !important;
        height: 28px !important;
    }

    .stat-icon-wrap svg {
        width: 14px !important;
        height: 14px !important;
    }

    .stat-number {
        font-size: 13px !important;
    }

    .stat-lbl {
        font-size: 7px !important;
    }

    .home-challenge-container {
        padding: 10px 12px !important;
        margin-top: 10px !important;
        border-radius: 14px !important;
        gap: 10px !important;
        display: grid !important;
        grid-template-columns: 1.25fr 0.75fr !important;
    }

    .challenge-desc {
        font-size: 9.5px !important;
        margin-bottom: 6px !important;
        line-height: 1.25 !important;
    }

    .challenge-ratio {
        font-size: 10px !important;
    }

    .challenge-progress-track {
        height: 4px !important;
    }

    .challenge-right {
        width: 100% !important;
        justify-content: center !important;
        padding: 0 !important;
        background: transparent !important;
        border: none !important;
    }

    .reward-box {
        padding: 6px 4px !important;
        min-width: 68px !important;
        border-radius: 10px !important;
        background: rgba(37, 99, 235, 0.04) !important;
        border: 1px dashed rgba(37, 99, 235, 0.15) !important;
        gap: 2px !important;
    }

    .light-theme .reward-box {
        background: rgba(37, 99, 235, 0.08) !important;
        border: 1px solid rgba(37, 99, 235, 0.12) !important;
    }

    .reward-gift-icon-wrap {
        width: 30px !important;
        height: 30px !important;
        border-radius: 8px !important;
        margin-bottom: 2px !important;
    }

    .reward-gift-icon-wrap svg {
        width: 15px !important;
        height: 15px !important;
    }

    .reward-title {
        font-size: 7px !important;
    }

    .reward-xp {
        font-size: 10px !important;
    }

    .recent-test-row {
        padding: 8px 10px !important;
        margin-bottom: 6px !important;
        border-radius: 12px !important;
        gap: 8px !important;
    }

    .recent-subject-icon {
        width: 30px !important;
        height: 30px !important;
        border-radius: 10px !important;
        font-size: 13px !important;
    }

    .recent-subj-name {
        font-size: 12px !important;
    }

    .recent-subj-time {
        font-size: 9px !important;
    }

    .recent-score-val {
        font-size: 11px !important;
    }

    .recent-score-percent {
        font-size: 9px !important;
    }

    .promo-video-card {
        margin-bottom: 8px !important;
    }
}

@media (max-width: 430px) {
    .light-theme .page-scroll-container {
        padding: calc(60px + env(safe-area-inset-top, 0px)) 12px 170px !important;
        scroll-padding-top: calc(60px + env(safe-area-inset-top, 0px)) !important;
    }

    .light-theme .home-welcome-card {
        min-height: 0;
        padding: 16px 14px 14px;
        gap: 10px;
    }

    .light-theme .welcome-greeting {
        font-size: 17px;
        line-height: 1.14;
    }

    .light-theme .welcome-subtitle {
        margin-bottom: 12px;
        font-size: 12px;
    }

    .light-theme .btn-welcome-action {
        width: 100%;
        justify-content: center;
    }

    .light-theme .home-shortcuts-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .light-theme .shortcut-item {
        min-height: 92px;
        padding: 10px 8px;
    }

}


/* Force caret-color for better readability */
input, textarea, .form-input, .mandat-input {
  caret-color: #2563eb !important;
}
