/* ==========================================================================
   JoyFera Official Design System & App Stylesheet
   Theme: Midnight Dark Navy + Vibrant Amber & Emerald (Exact Match)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
    --bg-main: #0B111E;
    --bg-sidebar: #070B14;
    --bg-topbar: #0B111E;
    --bg-card: #111A2E;
    --bg-card-hover: #16223B;
    --bg-input: #152037;
    
    --primary: #FF8A00;
    --primary-gradient: linear-gradient(135deg, #FF8A00 0%, #FF5100 100%);
    --gold: #F59E0B;
    --emerald: #10B981;
    --emerald-gradient: linear-gradient(135deg, #10B981 0%, #059669 100%);
    --blue: #2563EB;
    --blue-gradient: linear-gradient(135deg, #3B82F6 0%, #1D4ED8 100%);
    --red: #EF4444;
    
    --text-primary: #FFFFFF;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    
    --border-color: rgba(255, 255, 255, 0.08);
    --border-active: rgba(255, 138, 0, 0.4);
    
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.45);
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    
    --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* App Shell Layout */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ==========================================================================
   Left Sidebar Navigation (Exact Match to Live App)
   ========================================================================== */
.sidebar {
    width: 90px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.2rem 0;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 100;
    flex-shrink: 0;
    overflow-y: auto;
}

.sidebar-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    padding: 12px 0;
    margin-bottom: 1.2rem;
    cursor: pointer;
}

.sidebar-logo-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 14px rgba(255, 138, 0, 0.35);
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    width: 100%;
    padding: 0 0.5rem;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 0.2rem;
    border-radius: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    font-size: 0.72rem;
    font-weight: 600;
    gap: 0.3rem;
    user-select: none;
}

.nav-item .nav-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: var(--transition);
}

.nav-icon.home-icon { background: #FF5722; color: #FFF; }
.nav-icon.video-icon { background: #10B981; color: #FFF; }
.nav-icon.quiz-icon { background: #0284C7; color: #FFF; }
.nav-icon.spin-icon { background: #64748B; color: #FFF; }
.nav-icon.draw-icon { background: #F59E0B; color: #FFF; }
.nav-icon.about-icon { background: #0D9488; color: #FFF; }
.nav-icon.contact-icon { background: #84CC16; color: #FFF; }
.nav-icon.history-icon { background: #8B5CF6; color: #FFF; }
.nav-icon.announcement-icon { background: #F97316; color: #FFF; }

.nav-item:hover {
    color: #FFF;
    background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    color: #FFF;
    background: rgba(255, 138, 0, 0.12);
    border: 1px solid rgba(255, 138, 0, 0.3);
}

.nav-item.active .nav-icon {
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(255, 138, 0, 0.3);
}

/* ==========================================================================
   Main Content Area & Topbar
   ========================================================================== */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    height: 70px;
    background-color: var(--bg-topbar);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 90;
    backdrop-filter: blur(12px);
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.35rem;
    font-weight: 800;
    font-family: var(--font-heading);
}

.topbar-brand span {
    background: linear-gradient(135deg, #FFFFFF 0%, #FF8A00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.topbar-user-section {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

/* Badges Matching Screenshot */
.badge-level {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: var(--gold);
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.badge-username {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid var(--border-color);
    color: #FFF;
    padding: 0.35rem 0.95rem;
    border-radius: var(--radius-full);
    font-size: 0.88rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.badge-points {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #FFF;
    padding: 0.35rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.badge-points .coin {
    color: var(--gold);
}

.badge-points .verified-tag {
    color: var(--emerald);
    font-size: 0.78rem;
    font-weight: 600;
    background: rgba(16, 185, 129, 0.2);
    padding: 0.15rem 0.45rem;
    border-radius: var(--radius-full);
}

.btn-logout {
    background: #2563EB;
    color: #FFF;
    border: none;
    padding: 0.4rem 1.1rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-logout:hover {
    background: #1D4ED8;
    transform: translateY(-1px);
}

/* User Menu Wrapper & Avatar Button */
.user-menu-wrapper {
    position: relative;
    display: inline-block;
}

.badge-avatar-btn {
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid var(--border-color);
    color: #FFF;
    padding: 3px 10px 3px 4px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    outline: none;
}

.badge-avatar-btn:hover,
.badge-avatar-btn[aria-expanded="true"] {
    background: rgba(45, 60, 85, 0.95);
    border-color: rgba(255, 138, 0, 0.5);
    box-shadow: 0 0 12px rgba(255, 138, 0, 0.2);
}

.avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF8A00 0%, #FF5500 100%);
    color: #FFF;
    font-weight: 800;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(255, 138, 0, 0.35);
    flex-shrink: 0;
}

.username-text {
    font-size: 0.88rem;
    font-weight: 700;
    color: #FFF;
    max-width: 110px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-chevron {
    font-size: 0.75rem;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
}

.badge-avatar-btn[aria-expanded="true"] .dropdown-chevron {
    transform: rotate(180deg);
}

/* User Profile Dropdown Menu Card */
.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 270px;
    background: rgba(15, 23, 42, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 14px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 138, 0, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    display: none;
    flex-direction: column;
    animation: dropdownFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.user-dropdown-menu.active {
    display: flex;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 10px;
}

.dropdown-avatar-large {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF8A00 0%, #FF5500 100%);
    color: #FFF;
    font-weight: 800;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(255, 138, 0, 0.35);
    flex-shrink: 0;
}

.dropdown-user-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.dropdown-user-details strong {
    color: #FFF;
    font-size: 0.95rem;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-email {
    color: var(--text-secondary);
    font-size: 0.76rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

.dropdown-level-tag {
    display: inline-block;
    color: var(--gold);
    font-size: 0.72rem;
    font-weight: 700;
    margin-top: 4px;
}

.dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 8px -14px;
}

.dropdown-stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 4px 0;
}

.dropdown-stat-box {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: all 0.2s;
}

.dropdown-stat-box:hover {
    background: rgba(45, 60, 85, 0.7);
    border-color: rgba(255, 138, 0, 0.4);
}

.dropdown-stat-box .stat-lbl {
    font-size: 0.68rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.dropdown-stat-box .stat-val {
    font-size: 0.95rem;
    color: #FFF;
    font-weight: 800;
    margin-top: 2px;
}

.dropdown-links {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 2px 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    color: #E2E8F0;
    background: transparent;
    border: none;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    width: 100%;
    transition: all 0.15s ease;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #FFF;
    transform: translateX(2px);
}

.dropdown-item .item-icon {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.dropdown-logout-btn {
    color: #F87171 !important;
}

.dropdown-logout-btn:hover {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #EF4444 !important;
}

/* ==========================================================================
   Page Views & Container
   ========================================================================== */
.page-container {
    padding: 2.2rem;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}

.page-view {
    display: none;
    animation: fadeIn 0.25s ease-in-out;
}

.page-view.active {
    display: block;
}

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

.page-title {
    font-size: 1.85rem;
    font-weight: 800;
    font-family: var(--font-heading);
    margin-bottom: 0.4rem;
    color: #FFF;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

/* Cards & Layouts */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.8rem;
    margin-bottom: 1.5rem;
}

/* Question Cards Matching Live App */
.quiz-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.2rem;
    margin-bottom: 2rem;
}

.quiz-question-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.4rem;
    color: #F1F5F9;
}

.quiz-grid-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.quiz-option-btn {
    background: rgba(17, 26, 46, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    padding: 1.1rem 1.4rem;
    color: #CBD5E1;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.quiz-option-btn:hover {
    border-color: var(--primary);
    color: #FFF;
    background: rgba(30, 41, 59, 0.9);
    transform: translateY(-2px);
}

.quiz-option-btn.selected-correct {
    background: rgba(16, 185, 129, 0.2) !important;
    border-color: var(--emerald) !important;
    color: #A7F3D0 !important;
}

.quiz-option-btn.selected-wrong {
    background: rgba(239, 68, 68, 0.2) !important;
    border-color: var(--red) !important;
    color: #FECACA !important;
}

/* Warning / Attempt Alert Notice */
.attempt-notice {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #F87171;
    font-size: 0.95rem;
    font-weight: 600;
    margin-top: 0.8rem;
    animation: fadeIn 0.2s ease;
}

.attempt-notice .icon {
    font-size: 1.2rem;
}

/* Split Hero Layout (2-Column Showcase) */
.hero-split-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    margin-bottom: 3.5rem;
    padding: 1rem 0;
}

.hero-split-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.hero-split-right {
    display: flex;
    justify-content: center;
    position: relative;
}

.hero-video-mockup {
    width: 100%;
    max-width: 520px;
    border-radius: 20px;
    overflow: hidden;
    border: 2px solid rgba(255, 138, 0, 0.4);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7), 0 0 30px rgba(255, 138, 0, 0.2);
    background: #000;
}

.hero-video-inner {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 True Widescreen Aspect Ratio (Zero Cropping) */
    height: 0;
    overflow: hidden;
}

.hero-video-inner iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.hero-feature-tags {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin: 1.5rem 0;
}

.hero-tag {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid var(--border-color);
    padding: 0.45rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    color: #FFF;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    font-family: inherit;
    text-decoration: none;
}

.hero-tag:hover {
    background: rgba(255, 138, 0, 0.18);
    border-color: rgba(255, 138, 0, 0.6);
    color: #FF8A00;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(255, 138, 0, 0.25);
}

.hero-tag:active {
    transform: translateY(0);
}

@media (max-width: 900px) {
    .hero-split-container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .hero-split-left {
        align-items: center;
        text-align: center;
    }
}

/* 45s Watch Timer Box (Under Video) */
.watch-timer-box {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.2rem;
    margin: 1.5rem 0 1.8rem;
}

.timer-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 99px;
    overflow: hidden;
    margin: 0.8rem 0;
}

.timer-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--primary-gradient);
    transition: width 1s linear;
}

.code-unlock-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.8rem;
    border-radius: 99px;
    font-size: 0.82rem;
    font-weight: 700;
}

.code-locked {
    background: rgba(239, 68, 68, 0.15);
    color: #EF4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.code-unlocked {
    background: rgba(16, 185, 129, 0.15);
    color: var(--emerald);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Video Catalog Cards */
.video-catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 1.4rem;
    margin-top: 1.2rem;
}

.video-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
}

.video-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.video-card-thumb {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    background: #000;
    overflow: hidden;
}

.video-card-thumb img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-card-body {
    padding: 1.2rem;
}

.video-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #FFF;
    margin-bottom: 0.4rem;
    line-height: 1.35;
}

.video-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.8rem;
}

/* Inputs & Forms */
.form-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.85rem 1.1rem;
    color: #FFF;
    font-size: 0.95rem;
    font-family: var(--font-body);
    transition: var(--transition);
    margin-bottom: 1rem;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 138, 0, 0.15);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.6rem;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-sm {
    padding: 0.42rem 1.1rem;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1.25;
}

.btn-primary {
    background: var(--primary-gradient);
    color: #FFF;
    box-shadow: 0 4px 16px rgba(255, 138, 0, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 138, 0, 0.45);
}

.btn-emerald {
    background: var(--emerald-gradient);
    color: #FFF;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #FFF;
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.14);
}

/* Points History Table */
.history-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.history-table th {
    text-align: left;
    padding: 0.9rem 1.2rem;
    color: var(--text-muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border-color);
}

.history-table td {
    padding: 1.1rem 1.2rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.92rem;
}

.amount-positive { color: var(--emerald); font-weight: 700; }
.amount-negative { color: var(--red); font-weight: 700; }

/* Page Guide / Info Banner (Clean & Professional) */
.page-guide-banner {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 138, 0, 0.25);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-md);
    padding: 1.1rem 1.4rem;
    margin-bottom: 1.8rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    backdrop-filter: blur(8px);
}

.page-guide-icon {
    font-size: 1.5rem;
    line-height: 1;
    margin-top: 0.1rem;
}

.page-guide-content h4 {
    font-size: 1rem;
    color: var(--primary);
    margin-bottom: 0.3rem;
}

.page-guide-content p, .page-guide-content ul {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.page-guide-content ul {
    list-style: none;
    margin-top: 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.page-guide-content li {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* How It Works Steps Grid (Home Page) */
.how-it-works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.4rem;
    margin: 2.5rem 0;
}

.step-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.8rem;
    position: relative;
    transition: var(--transition);
}

.step-card:hover {
    border-color: rgba(255, 138, 0, 0.4);
    transform: translateY(-3px);
}

.step-number {
    width: 36px;
    height: 36px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    color: #FFF;
    margin-bottom: 1rem;
}

.step-title {
    font-size: 1.15rem;
    margin-bottom: 0.4rem;
    color: #FFF;
}

.step-desc {
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.5;
}

/* Social Icons */
.social-icons-group {
    display: flex;
    gap: 0.85rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.social-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 0.65rem 1.2rem;
    border-radius: var(--radius-md);
    color: #FFF;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
}

.social-btn:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    background: var(--bg-card-hover);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(7, 11, 20, 0.88);
    backdrop-filter: blur(12px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-container {
    background: #0F172A;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2.2rem;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.modal-close {
    position: absolute;
    top: 1.2rem;
    right: 1.2rem;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    background: #0F172A;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-md);
    padding: 0.9rem 1.4rem;
    color: #FFF;
    font-size: 0.9rem;
    box-shadow: var(--shadow-lg);
}

.toast.success { border-left-color: var(--emerald); }
.toast.error { border-left-color: var(--red); }

/* Auth Tabs & OAuth Social Buttons */
.auth-tabs {
    display: flex;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.3rem;
    margin-bottom: 1.5rem;
    gap: 0.3rem;
}

.auth-tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.65rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.9rem;
    font-family: var(--font-heading);
    cursor: pointer;
    transition: var(--transition);
}

.auth-tab-btn.active {
    background: var(--primary-gradient);
    color: #FFF;
    box-shadow: 0 4px 12px rgba(255, 138, 0, 0.3);
}

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.password-input-wrapper .form-input {
    padding-right: 2.8rem;
    margin-bottom: 0;
}

.toggle-password-btn {
    position: absolute;
    right: 0.8rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.toggle-password-btn:hover {
    color: #FFF;
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.4rem 0;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.auth-divider span {
    padding: 0 0.8rem;
}

.oauth-btn {
    width: 100%;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1.2rem;
    color: #FFF;
    font-size: 0.92rem;
    font-weight: 600;
    font-family: var(--font-body);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 0.75rem;
}

.oauth-btn:hover {
    background: rgba(51, 65, 85, 0.9);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.oauth-btn svg {
    width: 20px;
    height: 20px;
}

/* Mobile Hamburger & Sidebar Drawer Controls (Hidden on Desktop) */
.mobile-hamburger-btn {
    display: none;
}

.sidebar-header-mobile,
.sidebar-footer-mobile,
.sidebar-user-card {
    display: none !important;
}

.sidebar-backdrop {
    display: none;
}

/* ==========================================================================
   Mobile Responsive System (Mobile Web App Optimization)
   ========================================================================== */
@media (max-width: 768px) {
    .app-layout { flex-direction: column; }

    /* Show Hamburger button in topbar */
    .mobile-hamburger-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border-radius: 9px;
        background: rgba(255, 255, 255, 0.06);
        border: 1px solid rgba(255, 255, 255, 0.12);
        color: #FFF;
        cursor: pointer;
        flex-shrink: 0;
        transition: all 0.2s ease;
    }
    .mobile-hamburger-btn:active {
        background: rgba(255, 138, 0, 0.2);
        border-color: rgba(255, 138, 0, 0.4);
        transform: scale(0.96);
    }

    /* Backdrop overlay */
    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(4, 7, 13, 0.75);
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
        z-index: 1000;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
    }
    .sidebar-backdrop.active {
        display: block !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    /* Slide-out Sidebar Drawer */
    .sidebar { 
        position: fixed !important; 
        top: 0 !important; 
        left: 0 !important; 
        width: 285px !important; 
        max-width: 85vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        background: #0B111E !important;
        border-right: 1px solid rgba(255, 255, 255, 0.1) !important; 
        border-top: none !important;
        z-index: 2000 !important;
        transform: translateX(-100%) !important;
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
        display: flex !important;
        flex-direction: column !important;
        padding: 14px 14px calc(16px + env(safe-area-inset-bottom, 16px)) !important; 
        overflow-y: auto !important;
        box-shadow: 12px 0 40px rgba(0, 0, 0, 0.7) !important;
    }
    .sidebar.open {
        transform: translateX(0) !important;
    }

    .sidebar-logo { display: none !important; }
    .sidebar-header-mobile {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 12px;
        padding-bottom: 12px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }
    .sidebar-close-btn {
        background: rgba(255, 255, 255, 0.06);
        border: 1px solid rgba(255, 255, 255, 0.1);
        color: #94A3B8;
        width: 32px;
        height: 32px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1rem;
        cursor: pointer;
    }
    .sidebar-close-btn:active {
        background: rgba(239, 68, 68, 0.2);
        color: #EF4444;
    }

    .sidebar-user-card {
        background: rgba(255, 138, 0, 0.08);
        border: 1px solid rgba(255, 138, 0, 0.25);
        border-radius: 12px;
        padding: 10px 12px;
        margin-bottom: 12px;
    }

    .sidebar-menu { 
        display: flex;
        flex-direction: column; 
        width: 100%;
        gap: 3px;
        padding: 0;
        overflow-y: visible;
        align-items: stretch;
    }

    .sidebar-divider {
        height: 1px;
        background: rgba(255, 255, 255, 0.07);
        margin: 6px 8px;
        list-style: none;
    }

    .nav-item {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start !important;
        gap: 14px;
        padding: 9px 12px;
        border-radius: 10px;
        width: 100%;
        box-sizing: border-box;
        text-align: left;
        font-size: 0.9rem;
        font-weight: 600;
        color: #94A3B8;
        border: 1px solid transparent;
        background: transparent;
        transition: all 0.2s ease;
    }
    .nav-item:active,
    .nav-item.active {
        background: rgba(255, 138, 0, 0.12) !important;
        color: #FFF !important;
        border: 1px solid rgba(255, 138, 0, 0.3) !important;
    }
    .nav-item .nav-icon {
        width: 32px;
        height: 32px;
        min-width: 32px;
        font-size: 1.15rem;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        margin: 0;
    }
    .nav-item span {
        font-size: 0.9rem;
        font-weight: 600;
        white-space: nowrap;
        text-align: left;
        flex: 1;
    }

    .sidebar-footer-mobile {
        display: block !important;
        margin-top: auto;
        padding-top: 14px;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    /* Topbar Native Feel */
    .topbar { 
        height: 56px;
        padding: 0 12px;
        background: rgba(11, 17, 30, 0.92);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }
    .topbar-brand {
        gap: 8px;
        font-size: 1.15rem;
    }
    .topbar-brand img {
        width: 30px !important;
        height: 30px !important;
        border-radius: 8px !important;
    }
    .topbar-user-section {
        gap: 6px;
    }
    .desktop-only {
        display: none !important;
    }
    .badge-points {
        padding: 4px 8px;
        font-size: 0.78rem;
        gap: 4px;
    }
    .badge-avatar-btn {
        padding: 2px 4px 2px 2px;
    }
    .badge-avatar-btn .dropdown-chevron {
        display: none;
    }
    .user-dropdown-menu {
        right: -6px;
        width: min(290px, calc(100vw - 24px));
    }
    .topbar-user-section .btn-sm {
        padding: 6px 11px;
        font-size: 0.76rem;
        font-weight: 700;
        white-space: nowrap;
        border-radius: 9999px;
        line-height: 1.2;
    }

    /* Hero Section Polish on Mobile */
    .hero-pill-badge {
        font-size: 0.74rem;
        padding: 0.28rem 0.75rem;
        margin-bottom: 0.75rem;
    }
    .hero-title {
        font-size: 1.85rem;
        line-height: 1.18;
        margin-bottom: 0.65rem;
    }
    .hero-subtitle {
        font-size: 0.9rem;
        line-height: 1.5;
        margin-bottom: 1rem;
    }
    .hero-feature-tags {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        margin-bottom: 1.25rem;
    }
    .hero-tag {
        justify-content: center;
        padding: 8px 6px;
        font-size: 0.78rem;
        border-radius: 10px;
        background: rgba(17, 26, 46, 0.75);
        border: 1px solid rgba(255, 255, 255, 0.08);
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
    }
    .hero-cta-group {
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }
    .hero-cta-group .btn {
        width: 100%;
        padding: 13px 18px;
        font-size: 0.94rem;
        font-weight: 700;
        border-radius: 12px;
    }

    /* Standard content padding on mobile - NO BOTTOM BAR */
    .page-container { padding: 1rem 1rem 2.5rem; }
    .quiz-grid-options { grid-template-columns: 1fr; }
}

@media (max-width: 390px) {
    .topbar { padding: 0 8px; }
    .topbar-brand span { font-size: 1.05rem; }
    .topbar-user-section { gap: 4px; }
    .topbar-user-section .btn-sm {
        padding: 5px 9px;
        font-size: 0.72rem;
    }
}
.hero-pill-badge {
    background: rgba(255, 138, 0, 0.12);
    border: 1px solid rgba(255, 138, 0, 0.35);
    color: var(--primary);
    font-weight: 700;
    font-size: 0.82rem;
    padding: 0.35rem 0.95rem;
    border-radius: 99px;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 1.1rem;
    box-shadow: 0 2px 10px rgba(255, 138, 0, 0.15);
}

.hero-title {
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 0.9rem;
    color: #FFF;
    letter-spacing: -0.5px;
}

.hero-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 1.25rem;
    line-height: 1.6;
}

.hero-cta-group {
    display: flex;
    gap: 0.9rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

/* Mobile Bottom Sheet Drawer */
.mobile-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(4, 7, 13, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    align-items: flex-end;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.mobile-drawer-overlay.active {
    display: flex;
    opacity: 1;
}

.mobile-drawer-sheet {
    width: 100%;
    max-height: 85vh;
    background: #0E1627;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px 24px 0 0;
    padding: 14px 18px calc(18px + env(safe-area-inset-bottom, 16px));
    overflow-y: auto;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-drawer-overlay.active .mobile-drawer-sheet {
    transform: translateY(0);
}

.mobile-drawer-handle {
    width: 36px;
    height: 4px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 auto 14px;
}

.mobile-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

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

.mobile-drawer-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #FFF;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.mobile-drawer-card:active {
    background: rgba(255, 138, 0, 0.15);
    border-color: rgba(255, 138, 0, 0.35);
    transform: scale(0.98);
}

.mobile-drawer-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* ==========================================================================
   Video Lessons Grid Switcher (Latest on Top)
   ========================================================================== */
.video-lessons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.lesson-card {
    background: rgba(17, 26, 46, 0.85);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    position: relative;
}

.lesson-card:hover {
    border-color: rgba(255, 138, 0, 0.5);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.lesson-card.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(255, 138, 0, 0.35), 0 8px 24px rgba(255, 138, 0, 0.15);
    background: rgba(25, 38, 68, 0.95);
}

.lesson-card-thumb-wrap {
    position: relative;
    width: 100%;
    height: 120px;
    background: #000;
    overflow: hidden;
}

.lesson-card-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.lesson-card:hover .lesson-card-thumb {
    transform: scale(1.05);
}

.lesson-card-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    color: #FFF;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.lesson-card-status {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 10px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
}

.lesson-card-status.new-badge {
    background: var(--primary-gradient);
    color: #FFF;
}

.lesson-card-status.playing-badge {
    background: var(--emerald-gradient);
    color: #FFF;
}

.lesson-card-info {
    padding: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1;
}

.lesson-card-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #FFF;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.lesson-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 0.4rem;
    font-size: 0.8rem;
}

.lesson-card-reward {
    color: var(--emerald);
    font-weight: 800;
}

