        :root {
            --primary: #6366f1;
            --primary-dark: #4f46e5;
            --primary-light: #a5b4fc;
            --secondary: #f472b6;
            --accent: #22d3ee;
            --success: #34d399;
            --success-dark: #10b981;
            --warning: #fbbf24;
            --warning-dark: #f59e0b;
            --danger: #f87171;
            --danger-dark: #ef4444;
            --info: #0ea5e9;
            --info-dark: #0284c7;
            --purple: #a78bfa;
            --orange: #fb923c;
            --teal: #2dd4bf;
            --gray-50: #f9fafb;
            --gray-100: #f3f4f6;
            --gray-200: #e5e7eb;
            --gray-300: #d1d5db;
            --gray-400: #9ca3af;
            --gray-500: #6b7280;
            --gray-600: #4b5563;
            --gray-700: #374151;
            --gray-800: #1f2937;
            --gray-900: #111827;
            --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
            --card-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
            --card-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
            --card-shadow-glow: 0 0 40px rgba(99, 102, 241, 0.15);
            --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
            --radius: 16px;
            --radius-lg: 24px;
        }
        
        * { margin: 0; padding: 0; box-sizing: border-box; }
        
        body {
            font-family: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
            background: linear-gradient(135deg, #faf5ff 0%, #ede9fe 50%, #ddd6fe 100%);
            min-height: 100vh;
            color: var(--gray-800);
            transition: var(--transition);
        }
        
        body.dark-mode {
            background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #1e1b4b 100%);
            color: var(--gray-100);
        }
        
        /* Decorative Background Elements */
        body::before {
            content: '';
            position: fixed;
            top: -50%;
            right: -20%;
            width: 80%;
            height: 80%;
            background: radial-gradient(circle, rgba(167, 139, 250, 0.1) 0%, transparent 70%);
            pointer-events: none;
            z-index: 0;
        }
        
        body::after {
            content: '';
            position: fixed;
            bottom: -30%;
            left: -10%;
            width: 60%;
            height: 60%;
            background: radial-gradient(circle, rgba(34, 211, 238, 0.08) 0%, transparent 70%);
            pointer-events: none;
            z-index: 0;
        }
        
        /* Top Navigation */
        .top-nav {
            background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
            padding: 0 24px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            height: 70px;
            position: sticky;
            top: 0;
            z-index: 100;
            box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
        }
        
        body.dark-mode .top-nav {
            background: linear-gradient(135deg, #312e81 0%, #1e1b4b 100%);
        }
        
        /* Mobile Menu Button */
        .mobile-menu-btn {
            display: none;
            background: rgba(255,255,255,0.2);
            border: none;
            width: 40px;
            height: 40px;
            border-radius: 10px;
            cursor: pointer;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            gap: 5px;
            padding: 8px;
            transition: var(--transition);
        }
        
        .mobile-menu-btn:hover {
            background: rgba(255,255,255,0.3);
        }
        
        .mobile-menu-btn span {
            display: block;
            width: 20px;
            height: 2px;
            background: white;
            border-radius: 2px;
            transition: var(--transition);
        }
        
        .mobile-menu-btn.active span:nth-child(1) {
            transform: rotate(45deg) translate(5px, 5px);
        }
        
        .mobile-menu-btn.active span:nth-child(2) {
            opacity: 0;
        }
        
        .mobile-menu-btn.active span:nth-child(3) {
            transform: rotate(-45deg) translate(6px, -6px);
        }
        
        /* Mobile Sidebar Overlay */
        .mobile-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.5);
            z-index: 100;
            opacity: 0;
            visibility: hidden;
            transition: opacity 0.3s ease, visibility 0.3s ease;
            pointer-events: none;
        }
        
        .mobile-overlay.visible {
            opacity: 1;
            visibility: visible;
            pointer-events: auto;
        }
        
        /* On mobile, make overlay not block sidebar */
        @media (max-width: 900px) {
            .mobile-overlay {
                display: block;
            }
            
            .mobile-overlay.visible {
                /* Overlay positioned to not cover sidebar */
                left: 280px;
                width: calc(100% - 280px);
            }
        }
        
        .logo {
            display: flex;
            align-items: center;
            gap: 10px;
            font-size: 1.4rem;
            font-weight: 800;
            color: white;
            margin-right: 32px;
        }
        
        .logo-icon {
            font-size: 1.8rem;
            filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
        }
        
        .logo-text {
            display: flex;
            flex-direction: column;
            line-height: 1.1;
        }
        
        .logo-title { font-size: 1.2rem; }
        .logo-subtitle { font-size: 0.7rem; font-weight: 500; opacity: 0.85; }
        
        .nav-tabs {
            display: flex;
            gap: 6px;
            flex: 1;
        }
        
        .nav-tab {
            padding: 10px 18px;
            border: none;
            background: rgba(255,255,255,0.1);
            font-size: 14px;
            font-weight: 600;
            color: rgba(255,255,255,0.8);
            cursor: pointer;
            border-radius: 12px;
            transition: var(--transition);
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        .nav-tab:hover { background: rgba(255,255,255,0.2); color: white; }
        .nav-tab.active { background: white; color: var(--primary-dark); }
        
        .nav-tab-icon { font-size: 16px; }
        
        .nav-actions {
            display: flex;
            gap: 10px;
            align-items: center;
        }
        
        .nav-btn {
            width: 42px;
            height: 42px;
            border: none;
            background: rgba(255,255,255,0.15);
            border-radius: 12px;
            cursor: pointer;
            font-size: 18px;
            transition: var(--transition);
            color: white;
        }
        
        .nav-btn:hover { background: rgba(255,255,255,0.25); transform: scale(1.05); }
        
        .info-dropdown {
            position: relative;
        }
        
        .info-dropdown-btn {
            width: 42px;
            height: 42px;
            border: none;
            background: rgba(255,255,255,0.15);
            border-radius: 12px;
            cursor: pointer;
            font-size: 18px;
            transition: var(--transition);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .info-dropdown-btn:hover { background: rgba(255,255,255,0.25); transform: scale(1.05); }
        .info-dropdown-btn.active { background: white; color: var(--primary-dark); }
        
        .info-dropdown-menu {
            position: absolute;
            top: 100%;
            right: 0;
            margin-top: 8px;
            background: white;
            border-radius: 12px;
            box-shadow: 0 8px 32px rgba(0,0,0,0.15);
            min-width: 180px;
            opacity: 0;
            visibility: hidden;
            transform: translateY(-10px);
            transition: all 0.2s ease;
            z-index: 200;
            overflow: hidden;
        }
        
        .info-dropdown.open .info-dropdown-menu {
            opacity: 1;
            visibility: visible;
            transform: translateY(0);
        }
        
        body.dark-mode .info-dropdown-menu {
            background: rgba(30, 27, 75, 0.98);
            box-shadow: 0 8px 32px rgba(0,0,0,0.4);
        }
        
        .info-dropdown-item {
            display: flex;
            align-items: center;
            gap: 10px;
            width: 100%;
            padding: 12px 16px;
            border: none;
            background: none;
            font-size: 14px;
            font-weight: 500;
            color: var(--gray-600);
            cursor: pointer;
            text-align: left;
            transition: var(--transition);
        }
        
        .info-dropdown-item:hover {
            background: var(--gray-100);
            color: var(--primary);
        }
        
        body.dark-mode .info-dropdown-item {
            color: var(--gray-300);
        }
        
        body.dark-mode .info-dropdown-item:hover {
            background: rgba(255,255,255,0.1);
            color: var(--purple);
        }
        
        /* Main Layout */
        .main-layout {
            display: flex;
            min-height: calc(100vh - 70px);
            position: relative;
            z-index: 1;
        }
        
        /* Sidebar */
        .sidebar {
            width: 300px;
            background: #fafbff;
            border-right: 1px solid var(--gray-200);
            padding: 24px;
            overflow-y: auto;
            flex-shrink: 0;
            box-shadow: 2px 0 12px rgba(99, 102, 241, 0.06);
            transition: width 0.3s ease, padding 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
        }
        
        body.dark-mode .sidebar {
            background: rgba(30, 27, 75, 0.98);
            border-color: rgba(167, 139, 250, 0.2);
            box-shadow: 2px 0 12px rgba(0, 0, 0, 0.2);
        }
        
        /* Desktop collapsed sidebar state */
        .sidebar.hidden {
            width: 0;
            padding: 0;
            overflow: hidden;
            border-right: none;
        }
        
        /* Mobile Sidebar Styles */
        @media (max-width: 900px) {
            .sidebar {
                position: fixed !important;
                top: 0;
                left: 0;
                height: 100vh;
                height: 100dvh; /* Dynamic viewport height for mobile */
                z-index: 102;
                transform: translateX(-100%);
                width: 280px !important;
                padding: 24px !important;
                overflow-y: auto !important;
                overflow-x: hidden !important;
                border-right: 1px solid var(--gray-200) !important;
                box-shadow: 4px 0 20px rgba(0,0,0,0.2);
                transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
                pointer-events: auto !important;
                visibility: visible !important;
                -webkit-overflow-scrolling: touch;
                background: #fafbff !important;
            }
            
            body.dark-mode .sidebar {
                border-right: 1px solid rgba(167, 139, 250, 0.2) !important;
                background: rgba(30, 27, 75, 0.98) !important;
            }
            
            /* Override desktop hidden state completely on mobile */
            .sidebar.hidden {
                width: 280px !important;
                padding: 24px !important;
                overflow-y: auto !important;
                overflow-x: hidden !important;
                border-right: 1px solid var(--gray-200) !important;
                visibility: visible !important;
                pointer-events: auto !important;
            }
            
            .sidebar.mobile-open {
                transform: translateX(0);
                box-shadow: 8px 0 32px rgba(0,0,0,0.3);
                opacity: 1 !important;
                filter: none !important;
            }
            
            /* Add visual debugging for mobile sidebar */
            .sidebar.mobile-open::before {
                content: '';
                position: absolute;
                top: 0;
                left: 0;
                right: 0;
                height: 4px;
                background: linear-gradient(90deg, var(--primary), var(--purple));
                z-index: 1000;
            }
            
            /* Ensure all sidebar interactive elements work on mobile */
            .sidebar * {
                pointer-events: auto;
            }
        }
        
        /* Prevent body scroll when mobile menu open */
        body.mobile-menu-open {
            overflow: hidden;
        }
        
        .sidebar-toggle {
            position: fixed;
            left: 312px;
            top: 50%;
            transform: translateY(-50%);
            z-index: 100;
            width: 32px;
            height: 32px;
            border: none;
            background: var(--primary);
            color: white;
            border-radius: 8px;
            cursor: pointer;
            font-size: 14px;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
            transition: all 0.3s ease;
        }
        
        .sidebar-toggle:hover {
            background: var(--primary-dark);
            transform: translateY(-50%) scale(1.1);
        }
        
        .sidebar-toggle.collapsed {
            left: 12px;
        }
        
        body.dark-mode .sidebar-toggle {
            background: var(--purple);
        }
        
        /* Hide desktop toggle on mobile */
        @media (max-width: 900px) {
            .sidebar-toggle {
                display: none;
            }
        }
        
        .sidebar-section {
            margin-bottom: 20px;
        }
        
        .sidebar-title {
            font-size: 12px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            color: var(--primary);
            margin-bottom: 12px;
            display: flex;
            align-items: center;
            gap: 8px;
            cursor: pointer;
            user-select: none;
            -webkit-user-select: none;
            transition: var(--transition);
            padding: 6px 0;
            -webkit-tap-highlight-color: rgba(99, 102, 241, 0.2);
            touch-action: manipulation;
        }
        
        .sidebar-title:hover { 
            color: var(--primary-dark); 
        }
        body.dark-mode .sidebar-title { 
            color: var(--purple);
        }
        body.dark-mode .sidebar-title:hover { 
            color: #c4b5fd; 
        }
        
        .sidebar-title-icon { font-size: 12px; }
        
        .sidebar-title-toggle {
            margin-left: auto;
            font-size: 10px;
            transition: transform 0.2s ease;
        }
        
        .sidebar-section.collapsed .sidebar-title-toggle {
            transform: rotate(-90deg);
        }
        
        .sidebar-section-content {
            overflow: hidden;
            transition: max-height 0.25s ease, opacity 0.2s ease;
            max-height: 500px;
            opacity: 1;
        }
        
        .sidebar-section.collapsed .sidebar-section-content {
            max-height: 0;
            opacity: 0;
        }
        
        .filter-group { display: flex; flex-direction: column; gap: 6px; }
        
        .filter-btn {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 12px;
            border: none;
            background: white;
            font-size: 14px;
            font-weight: 500;
            color: var(--gray-600);
            cursor: pointer;
            border-radius: 10px;
            text-align: left;
            transition: var(--transition);
            box-shadow: 0 1px 3px rgba(0,0,0,0.06);
            -webkit-tap-highlight-color: rgba(99, 102, 241, 0.2);
            user-select: none;
            -webkit-user-select: none;
        }
        
        body.dark-mode .filter-btn { 
            color: var(--gray-300); 
            background: rgba(255,255,255,0.08);
        }
        .filter-btn:hover { 
            background: var(--gray-100);
            box-shadow: 0 2px 6px rgba(99, 102, 241, 0.12);
        }
        
        /* Mobile touch feedback */
        @media (max-width: 900px) {
            .filter-btn:active {
                transform: scale(0.98);
                background: var(--gray-200);
            }
            
            .deploy-btn:active {
                transform: scale(0.98);
            }
        }
        
        body.dark-mode .filter-btn:hover { 
            background: rgba(255,255,255,0.12); 
        }
        .filter-btn.active { 
            background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); 
            color: white;
            box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
        }
        
        .filter-icon { font-size: 16px; }
        
        .filter-count {
            margin-left: auto;
            background: var(--gray-200);
            padding: 2px 8px;
            border-radius: 10px;
            font-size: 11px;
            font-weight: 700;
        }
        
        body.dark-mode .filter-count { background: rgba(255,255,255,0.15); }
        .filter-btn.active .filter-count { background: rgba(255,255,255,0.25); }
        
        /* Deployment Mode Cards */
        .deploy-modes {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }
        
        .deploy-btn {
            display: flex;
            align-items: center;
            gap: 14px;
            padding: 16px;
            border: 2px solid var(--gray-200);
            background: white;
            border-radius: var(--radius);
            cursor: pointer;
            transition: var(--transition);
            -webkit-tap-highlight-color: rgba(99, 102, 241, 0.2);
            user-select: none;
            -webkit-user-select: none;
            touch-action: manipulation;
        }
        
        body.dark-mode .deploy-btn {
            background: rgba(255,255,255,0.05);
            border-color: rgba(255,255,255,0.1);
        }
        
        .deploy-btn:hover {
            border-color: var(--primary);
            transform: translateX(4px);
        }
        
        .deploy-btn.active {
            border-color: var(--primary);
            background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(167, 139, 250, 0.08) 100%);
            box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
        }
        
        .deploy-icon {
            width: 44px;
            height: 44px;
            background: var(--gray-100);
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 22px;
        }
        
        .deploy-btn.active .deploy-icon {
            background: linear-gradient(135deg, var(--primary) 0%, var(--purple) 100%);
        }
        
        body.dark-mode .deploy-icon { background: rgba(255,255,255,0.1); }
        
        .deploy-info { flex: 1; }
        
        .deploy-title {
            font-size: 14px;
            font-weight: 700;
            color: var(--gray-800);
        }
        
        body.dark-mode .deploy-title { color: white; }
        
        .deploy-desc {
            font-size: 12px;
            color: var(--gray-500);
            margin-top: 2px;
        }
        
        .deploy-badge {
            background: var(--warning);
            color: var(--gray-900);
            padding: 3px 8px;
            border-radius: 6px;
            font-size: 10px;
            font-weight: 700;
        }
        
        /* Content Area */
        .content {
            flex: 1;
            padding: 28px;
            overflow-y: auto;
        }
        
        .view { display: none; }
        .view.active { display: block; }
        
        /* Welcome Banner */
        .welcome-banner {
            background: linear-gradient(135deg, var(--primary) 0%, var(--purple) 50%, var(--secondary) 100%);
            border-radius: var(--radius-lg);
            padding: 28px 32px;
            margin-bottom: 28px;
            color: white;
            display: flex;
            align-items: center;
            justify-content: space-between;
            box-shadow: 0 8px 30px rgba(99, 102, 241, 0.3);
            position: relative;
            overflow: hidden;
        }
        
        .welcome-banner::before {
            content: '🧩';
            position: absolute;
            right: 40px;
            top: 50%;
            transform: translateY(-50%);
            font-size: 100px;
            opacity: 0.15;
        }
        
        .welcome-content h2 {
            font-size: 1.5rem;
            font-weight: 800;
            margin-bottom: 6px;
        }
        
        .welcome-content p {
            opacity: 0.9;
            font-size: 15px;
        }
        
        .welcome-stats {
            display: flex;
            gap: 20px;
        }
        
        .welcome-stat {
            text-align: center;
            background: rgba(255,255,255,0.15);
            padding: 14px 20px;
            border-radius: 14px;
            backdrop-filter: blur(10px);
        }
        
        .welcome-stat-value {
            font-size: 1.75rem;
            font-weight: 800;
        }
        
        .welcome-stat-label {
            font-size: 11px;
            opacity: 0.85;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }
        
        /* Card Header */
        .card-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
        }
        
        .card-counter {
            font-size: 15px;
            font-weight: 600;
            color: var(--gray-600);
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        .card-counter-icon { font-size: 18px; }
        
        .card-actions { display: flex; gap: 10px; }
        
        .action-btn {
            padding: 10px 18px;
            border: none;
            background: white;
            border-radius: 12px;
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            box-shadow: var(--card-shadow);
            transition: var(--transition);
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        body.dark-mode .action-btn { background: rgba(255,255,255,0.1); color: white; }
        .action-btn:hover { transform: translateY(-2px); box-shadow: var(--card-shadow-lg); }
        .action-btn.primary { 
            background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); 
            color: white;
            box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
        }
        .action-btn.primary:hover { box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45); }
        
        .action-icon { font-size: 15px; }
        
        /* Flashcard */
        .card-stage { perspective: 1200px; margin-bottom: 28px; }
        
        .card-actions-float {
            display: flex;
            gap: 8px;
            flex-shrink: 0;
        }
        
        .card-action-btn {
            width: 40px;
            height: 40px;
            border: none;
            background: white;
            color: var(--gray-600);
            border-radius: 50%;
            cursor: pointer;
            font-size: 18px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.15);
            transition: var(--transition);
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        body.dark-mode .card-action-btn {
            background: rgba(255,255,255,0.1);
            color: var(--gray-300);
        }
        
        .card-action-btn:hover {
            transform: scale(1.15);
            box-shadow: 0 4px 15px rgba(0,0,0,0.2);
        }
        
        .card-action-btn.hint:hover { background: var(--warning); color: white; }
        .card-action-btn.extension:hover { background: var(--success); color: white; }
        .card-action-btn.discussion:hover { background: var(--purple); color: white; }
        .card-action-btn.share:hover { background: var(--primary); color: white; }
        
        .flashcard {
            width: 100%;
            max-width: 850px;
            height: 580px;
            position: relative;
            transform-style: preserve-3d;
            transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
            cursor: pointer;
            margin: 0 auto;
        }
        
        .flashcard.flipped { transform: rotateY(180deg); }
        
        .card-face {
            position: absolute;
            width: 100%;
            height: 100%;
            backface-visibility: hidden;
            border-radius: var(--radius-lg);
            padding: 0;
            display: flex;
            flex-direction: column;
            box-shadow: var(--card-shadow-xl), var(--card-shadow-glow);
            overflow: hidden;
        }
        
        .card-front { 
            background: white;
            border: 3px solid transparent;
            background-image: linear-gradient(white, white), linear-gradient(135deg, var(--primary-light), var(--purple), var(--secondary));
            background-origin: border-box;
            background-clip: padding-box, border-box;
        }
        
        body.dark-mode .card-front { 
            background: linear-gradient(135deg, rgba(30, 27, 75, 0.98) 0%, rgba(49, 46, 129, 0.98) 100%);
            background-image: none;
            border-color: rgba(255,255,255,0.2);
        }
        
        .card-back {
            background: linear-gradient(135deg, #312e81 0%, #1e1b4b 50%, #0f172a 100%);
            color: white;
            transform: rotateY(180deg);
            border: 3px solid rgba(255,255,255,0.1);
        }
        
        .card-top {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 0;
            gap: 12px;
            padding: 24px 36px 16px 36px;
            flex-shrink: 0;
            background: inherit;
            position: relative;
        }
        
        .card-top-left {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }
        
        .card-top-right {
            display: flex;
            gap: 8px;
            flex-shrink: 0;
        }
        
        .card-id-wrapper {
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .card-id {
            font-size: 13px;
            font-weight: 700;
            color: var(--primary);
            text-transform: uppercase;
            letter-spacing: 0.05em;
            background: rgba(99, 102, 241, 0.1);
            padding: 6px 12px;
            border-radius: 8px;
        }
        
        body.dark-mode .card-front .card-id { 
            background: rgba(167, 139, 250, 0.2);
            color: var(--purple);
        }
        
        .card-back .card-id {
            background: rgba(255,255,255,0.1);
            color: var(--primary-light);
        }
        
        .card-badges { display: flex; gap: 8px; flex-wrap: wrap; }
        
        .badge {
            padding: 6px 12px;
            border-radius: 10px;
            font-size: 12px;
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 5px;
        }
        
        .badge.beginner { 
            background: linear-gradient(135deg, rgba(52, 211, 153, 0.15) 0%, rgba(16, 185, 129, 0.15) 100%);
            color: var(--success-dark);
        }
        .badge.intermediate { 
            background: linear-gradient(135deg, rgba(251, 191, 36, 0.15) 0%, rgba(245, 158, 11, 0.15) 100%);
            color: var(--warning-dark);
        }
        .badge.advanced { 
            background: linear-gradient(135deg, rgba(248, 113, 113, 0.15) 0%, rgba(239, 68, 68, 0.15) 100%);
            color: var(--danger-dark);
        }
        .badge.type { 
            background: var(--gray-100); 
            color: var(--gray-600); 
        }
        body.dark-mode .badge.type { background: rgba(255,255,255,0.1); color: var(--gray-300); }
        .card-back .badge { background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.9); }
        
        .card-title {
            font-family: 'Crimson Pro', Georgia, serif;
            font-size: 2rem;
            font-weight: 600;
            margin-bottom: 24px;
            margin-top: 0;
            padding-top: 4px;
            color: var(--gray-900);
            line-height: 1.3;
            display: flex;
            align-items: flex-start;
            gap: 12px;
        }
        
        .card-title-icon {
            font-size: 1.5rem;
            flex-shrink: 0;
        }
        
        body.dark-mode .card-front .card-title { color: white; }
        .card-back .card-title { color: white; }
        
        /* Scrollable content container */
        .card-content-scroll {
            flex: 1;
            overflow-y: auto;
            overflow-x: hidden;
            padding: 0 36px 20px 36px;
            -webkit-overflow-scrolling: touch;
            scrollbar-width: thin;
            scrollbar-color: rgba(99, 102, 241, 0.3) transparent;
            position: relative;
        }
        
        /* Scroll indicator shadow at bottom when there's more content */
        .card-content-scroll::after {
            content: '';
            position: sticky;
            bottom: 0;
            left: 0;
            right: 0;
            height: 30px;
            background: linear-gradient(to top, rgba(0,0,0,0.05), transparent);
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.3s ease;
        }
        
        .card-back .card-content-scroll::after {
            background: linear-gradient(to top, rgba(0,0,0,0.2), transparent);
        }
        
        .card-content-scroll::-webkit-scrollbar {
            width: 6px;
        }
        
        .card-content-scroll::-webkit-scrollbar-track {
            background: transparent;
        }
        
        .card-content-scroll::-webkit-scrollbar-thumb {
            background: rgba(99, 102, 241, 0.3);
            border-radius: 3px;
        }
        
        .card-content-scroll::-webkit-scrollbar-thumb:hover {
            background: rgba(99, 102, 241, 0.5);
        }
        
        .card-back .card-content-scroll::-webkit-scrollbar-thumb {
            background: rgba(255, 255, 255, 0.3);
        }
        
        .card-back .card-content-scroll::-webkit-scrollbar-thumb:hover {
            background: rgba(255, 255, 255, 0.5);
        }
        
        .card-body {
            font-size: 1.15rem;
            line-height: 1.9;
            color: var(--gray-700);
            margin-bottom: 16px;
        }
        
        body.dark-mode .card-front .card-body { color: var(--gray-300); }
        .card-back .card-body { color: var(--gray-200); }
        
        .answer-section {
            background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(167, 139, 250, 0.1) 100%);
            border-radius: 16px;
            padding: 20px;
            margin-bottom: 20px;
            border: 1px solid rgba(99, 102, 241, 0.2);
        }
        
        .section-label {
            font-size: 11px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            margin-bottom: 10px;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        
        .section-label.answer { color: var(--primary-light); }
        .section-label.hint { color: var(--warning); }
        .section-label.extension { color: var(--success); }
        .section-label.discussion { color: var(--purple); }
        .section-label.explanation { color: var(--gray-400); }
        
        .section-label-icon { font-size: 14px; }
        
        .card-section {
            padding: 16px 20px;
            background: rgba(255,255,255,0.05);
            border-radius: 12px;
            margin-top: 16px;
            border-left: 3px solid;
        }
        
        .card-section.hint { border-color: var(--warning); }
        .card-section.extension { border-color: var(--success); }
        .card-section.discussion { border-color: var(--purple); }
        
        .card-section p {
            font-size: 0.95rem;
            color: var(--gray-300);
            line-height: 1.7;
        }
        
        .card-bottom {
            display: flex;
            justify-content: space-between;
            align-items: flex-end;
            margin-top: 0;
            padding: 16px 36px 24px 36px;
            gap: 16px;
            flex-shrink: 0;
            background: inherit;
            position: relative;
            border-top: 1px solid rgba(0,0,0,0.05);
        }
        
        body.dark-mode .card-front .card-bottom {
            border-top-color: rgba(255,255,255,0.05);
        }
        
        .card-back .card-top,
        .card-back .card-bottom {
            z-index: 1;
        }
        
        .card-back .card-bottom {
            border-top-color: rgba(255,255,255,0.1);
        }
        
        .card-footer {
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
            flex: 1;
        }
        
        .tag {
            padding: 8px 14px;
            border-radius: 10px;
            font-size: 13px;
            font-weight: 600;
            background: var(--gray-100);
            color: var(--gray-600);
            display: flex;
            align-items: center;
            gap: 6px;
        }
        
        .tag-icon { font-size: 14px; }
        
        body.dark-mode .card-front .tag { background: rgba(255,255,255,0.08); color: var(--gray-300); }
        .card-back .tag { background: rgba(255,255,255,0.08); color: var(--gray-300); }
        
        /* Navigation */
        .nav-controls {
            display: flex;
            justify-content: center;
            gap: 14px;
            margin-bottom: 20px;
        }
        
        .nav-btn-card {
            padding: 14px 28px;
            border: none;
            border-radius: 14px;
            font-size: 15px;
            font-weight: 600;
            cursor: pointer;
            transition: var(--transition);
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .nav-btn-card.secondary {
            background: white;
            color: var(--gray-700);
            box-shadow: var(--card-shadow);
        }
        
        body.dark-mode .nav-btn-card.secondary { background: rgba(255,255,255,0.1); color: white; }
        .nav-btn-card.secondary:hover { transform: translateY(-2px); box-shadow: var(--card-shadow-lg); }
        .nav-btn-card.primary { 
            background: linear-gradient(135deg, var(--primary) 0%, var(--purple) 100%); 
            color: white;
            box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
        }
        .nav-btn-card.primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45); }
        
        .nav-btn-icon { font-size: 16px; }
        
        /* Keyboard Hint */
        .keyboard-hint {
            text-align: center;
            font-size: 13px;
            color: var(--gray-400);
            margin-top: 16px;
            display: flex;
            justify-content: center;
            gap: 20px;
            flex-wrap: wrap;
        }
        
        .keyboard-hint-item {
            display: flex;
            align-items: center;
            gap: 6px;
        }
        
        .keyboard-hint kbd {
            display: inline-block;
            padding: 4px 8px;
            background: white;
            border-radius: 6px;
            font-size: 12px;
            font-family: inherit;
            font-weight: 600;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }
        
        body.dark-mode .keyboard-hint kbd { background: rgba(255,255,255,0.15); }
        
        /* Teacher Tools Panel */
        .teacher-panel {
            background: white;
            border-radius: var(--radius-lg);
            padding: 24px 28px;
            margin-bottom: 24px;
            box-shadow: var(--card-shadow-lg);
            border: 2px solid var(--gray-100);
        }
        
        body.dark-mode .teacher-panel { 
            background: rgba(30, 27, 75, 0.95);
            border-color: rgba(255,255,255,0.1);
        }
        
        .teacher-panel h3 {
            font-size: 1.1rem;
            font-weight: 700;
            margin-bottom: 20px;
            color: var(--gray-800);
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .teacher-panel-icon { font-size: 24px; }
        
        body.dark-mode .teacher-panel h3 { color: white; }
        
        .teacher-tools { 
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            justify-content: center;
        }
        
        .teacher-tool-btn {
            padding: 10px 16px;
            border: 2px solid var(--gray-200);
            background: var(--gray-50);
            border-radius: 12px;
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            transition: var(--transition);
            color: var(--gray-700);
            display: flex;
            flex-direction: row;
            align-items: center;
            gap: 8px;
            text-align: center;
            white-space: nowrap;
        }
        
        .teacher-tool-icon { font-size: 18px; }
        
        body.dark-mode .teacher-tool-btn {
            border-color: rgba(255,255,255,0.15);
            background: rgba(255,255,255,0.05);
            color: var(--gray-300);
        }
        
        .teacher-tool-btn:hover { 
            border-color: var(--primary); 
            background: rgba(99, 102, 241, 0.05);
            transform: translateY(-2px);
        }
        
        .teacher-tool-btn.success:hover { border-color: var(--success); background: rgba(52, 211, 153, 0.05); }
        .teacher-tool-btn.warning:hover { border-color: var(--warning); background: rgba(251, 191, 36, 0.05); }
        
        .teacher-tool-btn.timer-active {
            border-color: var(--success);
            background: rgba(52, 211, 153, 0.15);
            animation: pulse-timer 2s ease-in-out infinite;
        }
        
        @keyframes pulse-timer {
            0%, 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.4); }
            50% { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
        }
        
        /* Modal */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(4px);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 1000;
            opacity: 0;
            visibility: hidden;
            transition: all 0.25s ease;
        }
        
        .modal-overlay.visible {
            opacity: 1;
            visibility: visible;
        }
        
        .modal {
            background: white;
            border-radius: var(--radius-lg);
            padding: 32px;
            max-width: 500px;
            width: 90%;
            box-shadow: var(--card-shadow-xl);
            transform: scale(0.9) translateY(20px);
            transition: all 0.25s ease;
        }
        
        .modal-overlay.visible .modal {
            transform: scale(1) translateY(0);
        }
        
        body.dark-mode .modal {
            background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
            border: 1px solid rgba(255,255,255,0.1);
        }
        
        .modal-header {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 16px;
        }
        
        .modal-icon {
            font-size: 32px;
        }
        
        .modal-title {
            font-size: 1.25rem;
            font-weight: 700;
            color: var(--gray-800);
        }
        
        body.dark-mode .modal-title { color: white; }
        
        .modal-body {
            font-size: 15px;
            line-height: 1.8;
            color: var(--gray-600);
            margin-bottom: 24px;
        }
        
        body.dark-mode .modal-body { color: var(--gray-300); }
        
        .modal-close {
            width: 100%;
            padding: 12px 24px;
            border: none;
            background: linear-gradient(135deg, var(--primary) 0%, var(--purple) 100%);
            color: white;
            border-radius: 12px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: var(--transition);
        }
        
        .modal-close:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
        }
        
        /* Share Menu Buttons */
        .share-menu-buttons {
            display: flex;
            flex-direction: column;
            gap: 12px;
            margin-bottom: 20px;
        }
        
        .share-menu-btn {
            padding: 14px 20px;
            border: none;
            border-radius: 12px;
            font-size: 15px;
            font-weight: 600;
            cursor: pointer;
            transition: var(--transition);
            display: flex;
            align-items: center;
            gap: 12px;
            background: white;
            color: var(--gray-700);
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        }
        
        body.dark-mode .share-menu-btn {
            background: rgba(255,255,255,0.1);
            color: white;
        }
        
        .share-menu-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        }
        
        .share-menu-btn.copy:hover { background: var(--primary); color: white; }
        .share-menu-btn.email:hover { background: var(--success); color: white; }
        .share-menu-btn.print:hover { background: var(--gray-700); color: white; }
        
        .share-menu-icon {
            font-size: 20px;
        }
        
        /* Card Counter */
        .unified-toolbar {
            display: flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 12px;
        }
        
        .toolbar-counter {
            font-size: 13px;
            font-weight: 600;
            color: var(--gray-500);
        }
        
        body.dark-mode .toolbar-counter { color: var(--gray-400); }
        
        .toolbar-center {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
            justify-content: center;
        }
        
        .toolbar-divider {
            width: 1px;
            height: 24px;
            background: var(--gray-200);
            margin: 0 4px;
        }
        
        body.dark-mode .toolbar-divider { background: rgba(255,255,255,0.15); }
        
        .toolbar-btn {
            padding: 8px 14px;
            border: 1px solid var(--gray-200);
            background: var(--gray-50);
            border-radius: 10px;
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            transition: var(--transition);
            color: var(--gray-700);
            white-space: nowrap;
        }
        
        body.dark-mode .toolbar-btn {
            border-color: rgba(255,255,255,0.15);
            background: rgba(255,255,255,0.05);
            color: var(--gray-300);
        }
        
        .toolbar-btn:hover {
            border-color: var(--primary);
            background: rgba(99, 102, 241, 0.08);
            transform: translateY(-1px);
        }
        
        .toolbar-btn.timer-active {
            border-color: var(--success);
            background: rgba(52, 211, 153, 0.15);
            animation: pulse-timer 2s ease-in-out infinite;
        }
        
        @keyframes pulse-timer {
            0%, 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.4); }
            50% { box-shadow: 0 0 0 6px rgba(52, 211, 153, 0); }
        }
        
        /* Timer */
        .timer-display {
            display: none;
            align-items: center;
            justify-content: center;
            gap: 16px;
            background: linear-gradient(135deg, var(--gray-800) 0%, var(--gray-900) 100%);
            color: white;
            padding: 20px 36px;
            border-radius: var(--radius);
            margin: 20px auto 0;
            max-width: 320px;
            box-shadow: 0 8px 30px rgba(0,0,0,0.2);
        }
        
        .timer-display.visible { display: flex; }
        
        .timer-icon { font-size: 28px; }
        
        .timer-time {
            font-size: 2.75rem;
            font-weight: 800;
            font-family: 'SF Mono', Monaco, monospace;
            letter-spacing: 2px;
        }
        
        .timer-controls { display: flex; gap: 10px; }
        
        .timer-btn {
            width: 40px;
            height: 40px;
            border: none;
            background: rgba(255,255,255,0.1);
            border-radius: 10px;
            cursor: pointer;
            font-size: 18px;
            transition: var(--transition);
        }
        
        .timer-btn:hover { background: rgba(255,255,255,0.2); }
        
        /* Stats Bar */
        .stats-bar {
            display: flex;
            justify-content: center;
            gap: 28px;
            margin-bottom: 24px;
            flex-wrap: wrap;
        }
        
        .stat-item {
            display: flex;
            align-items: center;
            gap: 10px;
            font-size: 14px;
            font-weight: 600;
            color: var(--gray-600);
            background: white;
            padding: 10px 18px;
            border-radius: 12px;
            box-shadow: var(--card-shadow);
        }
        
        body.dark-mode .stat-item { 
            background: rgba(255,255,255,0.08);
            color: var(--gray-300);
        }
        
        .stat-icon { font-size: 18px; }
        
        .stat-value { 
            font-weight: 800;
            color: var(--gray-800);
        }
        
        body.dark-mode .stat-value { color: white; }
        
        /* Presentation Mode */
        body.presentation-mode .top-nav,
        body.presentation-mode .sidebar,
        body.presentation-mode .sidebar-toggle,
        body.presentation-mode .mobile-overlay {
            display: none !important;
        }
        
        body.presentation-mode .main-layout {
            min-height: 100vh;
        }
        
        body.presentation-mode .content {
            display: flex;
            flex-direction: column;
            justify-content: center;
            padding: 48px;
        }
        
        body.presentation-mode .welcome-banner { display: none; }
        
        body.presentation-mode .flashcard {
            max-width: 1100px;
            height: 700px;
        }
        
        body.presentation-mode .card-top {
            padding: 32px 52px 20px 52px;
        }
        
        body.presentation-mode .card-content-scroll {
            padding: 0 52px 20px 52px;
        }
        
        body.presentation-mode .card-bottom {
            padding: 20px 52px 32px 52px;
        }
        
        body.presentation-mode .card-title {
            font-size: 2.5rem;
        }
        
        body.presentation-mode .card-body {
            font-size: 1.5rem;
        }
        
        .exit-presentation {
            position: fixed;
            top: 24px;
            right: 24px;
            padding: 10px 20px;
            background: var(--gray-800);
            color: white;
            border: none;
            border-radius: 12px;
            cursor: pointer;
            font-size: 14px;
            font-weight: 600;
            z-index: 1000;
            display: none;
            gap: 8px;
            align-items: center;
            box-shadow: 0 4px 15px rgba(0,0,0,0.2);
        }
        
        body.presentation-mode .exit-presentation { display: flex; }
        
        /* Guide View */
        .guide-content {
            max-width: 850px;
            margin: 0 auto;
        }
        
        .guide-section {
            background: white;
            border-radius: var(--radius-lg);
            padding: 36px;
            margin-bottom: 28px;
            box-shadow: var(--card-shadow-lg);
            border: 2px solid var(--gray-100);
        }
        
        body.dark-mode .guide-section { 
            background: rgba(30, 27, 75, 0.95);
            border-color: rgba(255,255,255,0.1);
        }
        
        .guide-section h2 {
            font-family: 'Nunito', sans-serif;
            font-size: 1.5rem;
            font-weight: 800;
            margin-bottom: 20px;
            color: var(--gray-900);
            display: flex;
            align-items: center;
            gap: 12px;
        }
        
        .guide-section-icon { font-size: 1.5rem; }
        
        body.dark-mode .guide-section h2 { color: white; }
        
        .guide-section h3 {
            font-size: 1.15rem;
            font-weight: 700;
            margin-top: 28px;
            margin-bottom: 14px;
            color: var(--gray-800);
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        .guide-h3-icon { font-size: 1rem; }
        
        body.dark-mode .guide-section h3 { color: var(--gray-200); }
        
        .guide-section p {
            font-size: 15px;
            line-height: 1.8;
            color: var(--gray-600);
            margin-bottom: 14px;
        }
        
        body.dark-mode .guide-section p { color: var(--gray-400); }
        
        .guide-section ul, .guide-section ol {
            margin-left: 24px;
            margin-bottom: 14px;
        }
        
        .guide-section li {
            font-size: 15px;
            line-height: 1.8;
            color: var(--gray-600);
            margin-bottom: 10px;
        }
        
        body.dark-mode .guide-section li { color: var(--gray-400); }
        
        .guide-table {
            width: 100%;
            border-collapse: collapse;
            margin: 20px 0;
            font-size: 14px;
            border-radius: 12px;
            overflow: hidden;
        }
        
        .guide-table th, .guide-table td {
            padding: 14px 16px;
            text-align: left;
            border-bottom: 1px solid var(--gray-200);
        }
        
        body.dark-mode .guide-table th,
        body.dark-mode .guide-table td {
            border-color: rgba(255,255,255,0.1);
        }
        
        .guide-table th {
            font-weight: 700;
            color: var(--gray-700);
            background: var(--gray-100);
        }
        
        body.dark-mode .guide-table th {
            background: rgba(255,255,255,0.1);
            color: var(--gray-200);
        }
        
        .guide-table td { color: var(--gray-600); }
        body.dark-mode .guide-table td { color: var(--gray-400); }
        
        /* Quick navigation cards */
        .guide-nav {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 16px;
            margin-bottom: 32px;
        }
        
        .guide-nav-card {
            background: white;
            border: 2px solid var(--gray-200);
            border-radius: 12px;
            padding: 20px;
            cursor: pointer;
            transition: var(--transition);
            display: flex;
            align-items: center;
            gap: 14px;
        }
        
        body.dark-mode .guide-nav-card {
            background: rgba(30, 27, 75, 0.6);
            border-color: rgba(255,255,255,0.1);
        }
        
        .guide-nav-card:hover {
            transform: translateY(-3px);
            border-color: var(--primary);
            box-shadow: 0 6px 20px rgba(99, 102, 241, 0.2);
        }
        
        .guide-nav-icon {
            font-size: 32px;
            flex-shrink: 0;
        }
        
        .guide-nav-content h3 {
            margin: 0 0 4px 0;
            font-size: 1rem;
            font-weight: 700;
            color: var(--gray-800);
        }
        
        body.dark-mode .guide-nav-content h3 {
            color: white;
        }
        
        .guide-nav-content p {
            margin: 0;
            font-size: 13px;
            color: var(--gray-500);
            line-height: 1.4;
        }
        
        body.dark-mode .guide-nav-content p {
            color: var(--gray-400);
        }
        
        /* Section dividers */
        .section-divider {
            height: 2px;
            background: linear-gradient(90deg, transparent 0%, var(--primary) 50%, transparent 100%);
            margin: 48px 0 32px 0;
            opacity: 0.3;
        }
        
        .section-header {
            text-align: center;
            margin: 48px 0 32px 0;
        }
        
        .section-header h2 {
            display: inline-block;
            font-size: 1.8rem;
            font-weight: 800;
            background: linear-gradient(135deg, var(--primary) 0%, var(--purple) 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            margin: 0;
        }
        
        .section-header p {
            color: var(--gray-500);
            font-size: 14px;
            margin: 8px 0 0 0;
        }
        
        body.dark-mode .section-header p {
            color: var(--gray-400);
        }
        
        .callout {
            background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(167, 139, 250, 0.05) 100%);
            border-left: 4px solid var(--primary);
            padding: 20px 24px;
            border-radius: 0 14px 14px 0;
            margin: 20px 0;
            display: flex;
            gap: 14px;
            align-items: flex-start;
        }
        
        .callout-icon { font-size: 24px; flex-shrink: 0; }
        
        .callout p {
            margin: 0;
            font-size: 14px;
        }
        
        .callout.warning {
            background: linear-gradient(135deg, rgba(251, 191, 36, 0.1) 0%, rgba(245, 158, 11, 0.05) 100%);
            border-color: var(--warning);
        }
        
        .callout.success {
            background: linear-gradient(135deg, rgba(52, 211, 153, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
            border-color: var(--success);
        }
        
        /* Search */
        .search-box {
            position: relative;
            margin-bottom: 20px;
        }
        
        .search-input {
            width: 100%;
            padding: 14px 18px 14px 44px;
            border: 2px solid var(--gray-200);
            border-radius: 14px;
            font-size: 14px;
            font-family: inherit;
            background: white;
            transition: var(--transition);
            -webkit-appearance: none;
            appearance: none;
        }
        
        /* Mobile search input optimization */
        @media (max-width: 900px) {
            .search-input {
                font-size: 16px; /* Prevents zoom on iOS */
                padding: 12px 18px 12px 44px;
            }
        }
        
        .search-icon {
            position: absolute;
            left: 16px;
            top: 50%;
            transform: translateY(-50%);
            font-size: 16px;
            color: var(--gray-400);
        }
        
        .search-clear {
            position: absolute;
            right: 12px;
            top: 50%;
            transform: translateY(-50%);
            background: var(--gray-300);
            color: white;
            width: 24px;
            height: 24px;
            border-radius: 50%;
            border: none;
            cursor: pointer;
            font-size: 12px;
            display: none;
            align-items: center;
            justify-content: center;
            transition: var(--transition);
            padding: 0;
            font-weight: 600;
        }
        
        .search-clear:hover {
            background: var(--gray-400);
            transform: translateY(-50%) scale(1.1);
        }
        
        .search-clear.visible {
            display: flex;
        }
        
        body.dark-mode .search-clear {
            background: rgba(255,255,255,0.2);
        }
        
        body.dark-mode .search-clear:hover {
            background: rgba(255,255,255,0.3);
        }
        
        body.dark-mode .search-input {
            background: rgba(255,255,255,0.05);
            border-color: rgba(255,255,255,0.15);
            color: white;
        }
        
        .search-input:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
        }
        
        .clear-filters-btn {
            width: 100%;
            padding: 12px 18px;
            background: linear-gradient(135deg, var(--danger) 0%, var(--danger-dark) 100%);
            color: white;
            border: none;
            border-radius: 12px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: var(--transition);
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            margin-top: 16px;
        }
        
        .clear-filters-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
        }
        
        .clear-filters-btn:active {
            transform: translateY(0);
        }
        
        .search-results-badge {
            display: none;
            align-items: center;
            justify-content: center;
            gap: 6px;
            padding: 8px 12px;
            margin-top: 8px;
            background: var(--primary);
            color: white;
            border-radius: 8px;
            font-size: 13px;
            font-weight: 600;
            text-align: center;
            animation: slideDown 0.3s ease-out;
        }
        
        .search-results-badge.visible {
            display: flex;
        }
        
        .search-results-badge.no-results {
            background: var(--danger);
        }
        
        body.dark-mode .search-results-badge {
            background: var(--primary-dark);
        }
        
        body.dark-mode .search-results-badge.no-results {
            background: var(--danger-dark);
        }
        
        @keyframes slideDown {
            from {
                opacity: 0;
                transform: translateY(-10px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
        
        @keyframes pulse {
            0%, 100% {
                transform: scale(1);
            }
            50% {
                transform: scale(1.05);
            }
        }
        
        .toolbar-counter.updated {
            animation: pulse 0.4s ease-out;
        }
        
        /* Responsive */
        @media (max-width: 1024px) {
            .sidebar { width: 260px; }
            .welcome-banner::before { display: none; }
            .welcome-stats { gap: 12px; }
        }
        
        @media (max-width: 900px) {
            .mobile-menu-btn { display: flex; }
            .content { padding: 20px; }
            .main-layout { display: block; }
        }
        
        /* Tablet optimizations */
        @media (max-width: 768px) {
            .flashcard { height: 540px; }
            
            .card-top {
                padding: 20px 28px 12px 28px;
            }
            
            .card-content-scroll {
                padding: 0 28px 16px 28px;
            }
            
            .card-bottom {
                padding: 12px 28px 20px 28px;
            }
            
            .badge {
                font-size: 11px;
                padding: 5px 10px;
            }
            
            .card-title {
                font-size: 1.6rem;
            }
            
            .card-body {
                font-size: 1.05rem;
            }
        }
        
        @media (max-width: 640px) {
            .top-nav { padding: 0 16px; height: 60px; }
            .logo { margin-right: 16px; }
            .logo-text { display: none; }
            .nav-tab { padding: 8px 12px; font-size: 13px; }
            .nav-tab span:not(.nav-tab-icon) { display: none; }
            .flashcard { height: 520px; }
            .card-face { min-height: auto; }
            
            /* Compact card header on mobile */
            .card-top { 
                padding: 16px 20px 8px 20px; 
                flex-direction: column;
                gap: 8px;
            }
            
            .card-top-left {
                width: 100%;
                gap: 8px;
            }
            
            .card-top-right {
                width: 100%;
                justify-content: space-between;
                gap: 6px;
            }
            
            /* Smaller card ID */
            .card-id {
                font-size: 11px;
                padding: 4px 8px;
            }
            
            /* More compact badges */
            .card-badges {
                gap: 6px;
            }
            
            .badge {
                padding: 4px 8px;
                font-size: 10px;
                gap: 4px;
            }
            
            /* Hide type badges on mobile to save space */
            .badge.type {
                display: none;
            }
            
            /* Smaller action buttons */
            .card-action-btn {
                width: 36px;
                height: 36px;
                font-size: 16px;
            }
            
            /* More content space */
            .card-content-scroll { 
                padding: 0 20px 12px 20px; 
            }
            
            /* Compact bottom section */
            .card-bottom { 
                padding: 10px 20px 16px 20px;
                flex-direction: column;
                gap: 10px;
            }
            
            .card-footer {
                width: 100%;
                flex-wrap: wrap;
                gap: 6px;
            }
            
            .card-actions-float {
                width: 100%;
                justify-content: flex-end;
            }
            
            /* Smaller tags */
            .tag {
                padding: 4px 8px;
                font-size: 10px;
                gap: 4px;
            }
            
            .tag-icon {
                font-size: 11px;
            }
            
            /* Typography adjustments */
            .card-title { 
                font-size: 1.4rem;
                margin-bottom: 16px;
            }
            
            .card-title-icon {
                font-size: 1.2rem;
            }
            
            .card-body { 
                font-size: 0.95rem;
                line-height: 1.6;
            }
            
            /* Back card sections more compact */
            .answer-section {
                padding: 14px;
                margin-bottom: 12px;
            }
            
            .card-section {
                padding: 12px 14px;
                margin-top: 12px;
            }
            
            .section-label {
                font-size: 10px;
                margin-bottom: 8px;
            }
            
            /* More compact navigation buttons */
            .nav-controls {
                gap: 10px;
                margin-bottom: 16px;
                justify-content: center;
                width: 100%;
            }
            
            .nav-btn-card { 
                padding: 10px 16px; 
                font-size: 13px;
                border-radius: 12px;
            }
            
            .nav-btn-icon {
                font-size: 14px;
            }
            
            /* Guide section mobile optimization */
            .guide-content {
                padding: 0 16px;
            }
            
            .guide-section { 
                padding: 20px; 
                margin-bottom: 20px;
            }
            
            .guide-section h2 {
                font-size: 1.3rem;
                gap: 8px;
            }
            
            .guide-section-icon {
                font-size: 1.3rem;
            }
            
            .guide-section h3 {
                font-size: 1rem;
                margin-top: 20px;
                margin-bottom: 10px;
            }
            
            .guide-section p,
            .guide-section li {
                font-size: 14px;
                line-height: 1.7;
            }
            
            .guide-table {
                font-size: 12px;
                display: block;
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
            }
            
            .guide-table th,
            .guide-table td {
                padding: 10px 12px;
            }
            
            /* Allow text wrapping in table cells on mobile */
            .guide-table td:last-child {
                white-space: normal;
                min-width: 150px;
            }
            
            .callout {
                padding: 16px 18px;
            }
            
            .callout p {
                font-size: 13px;
            }
            
            .sidebar { width: 85vw !important; max-width: 320px !important; }
            
            /* Adjust overlay for narrower screens */
            .mobile-overlay.visible {
                left: 85vw;
                width: calc(100% - 85vw);
            }
        }
        
        /* Extra small screens (iPhone SE, small phones) */
        @media (max-width: 400px) {
            .flashcard { height: 480px; }
            
            .card-top {
                padding: 12px 16px 6px 16px;
            }
            
            .card-content-scroll {
                padding: 0 16px 10px 16px;
            }
            
            .card-bottom {
                padding: 8px 16px 12px 16px;
            }
            
            .card-title {
                font-size: 1.25rem;
                margin-bottom: 12px;
            }
            
            .card-body {
                font-size: 0.9rem;
            }
            
            .badge {
                font-size: 9px;
                padding: 3px 6px;
            }
            
            .card-id {
                font-size: 10px;
                padding: 3px 6px;
            }
            
            .card-action-btn {
                width: 32px;
                height: 32px;
                font-size: 14px;
            }
            
            .tag {
                font-size: 9px;
                padding: 3px 6px;
            }
            
            /* Extra compact navigation buttons */
            .nav-controls {
                gap: 8px;
                margin-bottom: 12px;
                justify-content: center;
                width: 100%;
            }
            
            .nav-btn-card { 
                padding: 8px 12px; 
                font-size: 12px;
                border-radius: 10px;
                gap: 6px;
            }
            
            .nav-btn-icon {
                font-size: 13px;
            }
            
            /* Extra compact guide sections */
            .guide-content {
                padding: 0 12px;
            }
            
            .guide-section {
                padding: 16px;
                margin-bottom: 16px;
            }
            
            .guide-section h2 {
                font-size: 1.2rem;
            }
            
            .guide-section h3 {
                font-size: 0.95rem;
            }
            
            .guide-section p,
            .guide-section li {
                font-size: 13px;
            }
            
            .guide-table {
                font-size: 11px;
            }
            
            .guide-table th,
            .guide-table td {
                padding: 8px 10px;
            }
            
            /* Compact navigation cards on mobile */
            .guide-nav {
                grid-template-columns: 1fr;
                gap: 12px;
                margin-bottom: 24px;
            }
            
            .guide-nav-card {
                padding: 14px;
            }
            
            .guide-nav-icon {
                font-size: 26px;
            }
            
            /* About page mobile optimization */
            .guide-section[style*="padding: 60px 40px"] {
                padding: 32px 20px !important;
            }
            
            .guide-section h1[style*="font-size"] {
                font-size: 1.75rem !important;
            }
            
            .guide-section div[style*="font-size: 72px"],
            .guide-section div[style*="font-size: 56px"] {
                font-size: 48px !important;
            }
        }

/* ========================================
   DEMO BANNER STYLES
   ======================================== */

.demo-banner {
    position: sticky;
    top: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 10px 24px;
    background: linear-gradient(135deg, #6366f1 0%, #a78bfa 50%, #818cf8 100%);
    color: white;
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 2px 12px rgba(99, 102, 241, 0.3);
    flex-wrap: wrap;
}

.demo-banner-text {
    display: inline;
}

.demo-banner-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 18px;
    background: white;
    color: #6366f1;
    border-radius: 20px;
    font-weight: 700;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.demo-banner-cta:hover {
    background: #f0f0ff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

/* Dark mode adjustments */
body.dark-mode .demo-banner {
    background: linear-gradient(135deg, #4338ca 0%, #7c3aed 50%, #6366f1 100%);
    box-shadow: 0 2px 12px rgba(99, 102, 241, 0.5);
}

body.dark-mode .demo-banner-cta {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

body.dark-mode .demo-banner-cta:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Hide banner in presentation mode */
body.presentation-mode .demo-banner {
    display: none;
}

/* Mobile responsiveness */
@media (max-width: 640px) {
    .demo-banner {
        font-size: 12px;
        padding: 8px 16px;
        gap: 8px;
        flex-direction: column;
    }

    .demo-banner-cta {
        font-size: 12px;
        padding: 5px 14px;
    }
}

