
        :root {
            --primary: #2c3e50;
            --accent: #3498db;
            --success: #2ecc71;
            --bg: #f4f7f6;
            --card-bg: #ffffff;
            --text-color: #333333;
        }

        body.dark-theme {
            --primary: #111827;
            --accent: #10b981;
            --bg: #1f2937;
            --card-bg: #374151;
            --text-color: #f3f4f6;
        }

        body {
            font-family: 'Poppins', 'Segoe UI', system-ui, sans-serif;
            margin: 0;
            padding: 0;
            background-color: var(--bg);
            color: var(--text-color);
            transition: background 0.3s, color 0.3s;
        }

        header {
            background-color: var(--primary);
            color: white;
            text-align: center;
            padding: 20px 20px 30px;
            box-shadow: 0 4px 15px rgba(0,0,0,0.1);
        }

        .top-bar {
            display: flex;
            justify-content: space-between;
            max-width: 1200px;
            margin: 0 auto 15px;
            align-items: center;
            flex-wrap: wrap;
            gap: 10px;
        }

        #theme-toggle {
            background: none;
            border: 1px solid rgba(255,255,255,0.4);
            color: white;
            padding: 5px 15px;
            border-radius: 15px;
            cursor: pointer;
            font-weight: bold;
        }

        .stats-container {
            display: flex;
            gap: 10px;
            align-items: center;
        }

        .streak-badge {
            background-color: #e67e22;
            padding: 5px 15px;
            border-radius: 15px;
            font-weight: bold;
            color: white;
        }

        .xp-badge {
            background-color: #f1c40f;
            color: #2c3e50;
            padding: 5px 15px;
            border-radius: 15px;
            font-weight: bold;
        }

        .container { max-width: 1200px; margin: 30px auto; padding: 0 20px; }

        .search-box-container {
            display: flex;
            justify-content: center;
            gap: 15px;
            margin-bottom: 30px;
            flex-wrap: wrap;
        }

        #search-input {
            padding: 12px 20px;
            font-size: 16px;
            border: 1px solid #ddd;
            border-radius: 25px;
            outline: none;
            background: var(--card-bg);
            color: var(--text-color);
            width: 350px;
            max-width: 100%;
            box-shadow: 0 2px 5px rgba(0,0,0,0.05);
        }

        /* CARD FLIP FLOP REPAIR FIX */
        .cards-grid { 
            display: grid; 
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
            gap: 25px; 
        }
        
        .card-box { 
            height: 280px; 
            perspective: 1000px; 
        }
        
        .card-inner {
            position: relative;
            width: 100%;
            height: 100%;
            text-align: center;
            transition: transform 0.6s;
            transform-style: preserve-3d;
            box-shadow: 0 4px 15px rgba(0,0,0,0.1);
            border-radius: 15px;
        }

        .card-box.flipped .card-inner { 
            transform: rotateY(180deg); 
        }
        
        .card-front, .card-back {
            position: absolute;
            width: 100%;
            height: 100%;
            backface-visibility: hidden;
            -webkit-backface-visibility: hidden;
            border-radius: 15px;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            padding: 20px;
            box-sizing: border-box;
            background: var(--card-bg);
        }

        .card-front { 
            border-left: 8px solid var(--success); 
            cursor: pointer; 
        }
        
        .flag { font-size: 2.2em; }
        
        .tag { 
            background: #34495e; 
            color: white; 
            padding: 4px 12px; 
            border-radius: 12px; 
            font-size: 11px; 
            margin-top: 5px; 
            text-transform: uppercase;
        }

        .card-back { 
            transform: rotateY(180deg); 
            justify-content: space-evenly; 
            overflow: hidden;
        }

        .lang-row {
            width: 100%;
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 1px solid rgba(127,143,141,0.2);
            padding: 8px 0;
            font-size: 14px;
        }

        .audio-btn { 
            background: var(--accent); 
            border: none; 
            color: white; 
            border-radius: 50%; 
            width: 34px; 
            height: 34px; 
            cursor: pointer; 
            font-size: 14px; 
            display: flex;
            align-items: center;
            justify-content: center;
            transition: transform 0.2s;
        }
        
        .audio-btn:hover {
            transform: scale(1.1);
        }

        /* QUIZ CSS */
        .quiz-card { background: var(--card-bg); max-width: 600px; margin: 40px auto; padding: 30px; border-radius: 15px; box-shadow: 0 4px 20px rgba(0,0,0,0.1); }
        .quiz-header { display: flex; justify-content: space-between; color: #7f8c8d; font-weight: bold; }
        .quiz-options { display: flex; flex-direction: column; gap: 12px; margin: 25px 0; }
        
        .option-btn { 
            padding: 15px; 
            font-size: 16px; 
            border: 2px solid #eee; 
            border-radius: 10px; 
            background: none; 
            color: var(--text-color); 
            cursor: pointer; 
            text-align: left; 
            transition: 0.2s; 
            width: 100%;
        }
        .option-btn:hover:not([disabled]) { border-color: var(--accent); background: rgba(0,0,0,0.02); }

        .quiz-actions { display: flex; gap: 10px; flex-wrap: wrap; }
        .next-btn { flex: 2; padding: 15px; background-color: var(--accent); color: white; border: none; border-radius: 10px; font-size: 16px; cursor: pointer; }
   