/* style.css - The Master Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

:root {
    --primary: #6366f1; /* Indigo */
    --secondary: #a855f7; /* Purple */
    --accent: #ec4899; /* Pink */
    --background: #0f172a; /* Dark Navy */
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --success: #10b981;
    --error: #ef4444;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Poppins', sans-serif; }

/* --- 1. FIXED BACKGROUND (NUCLEAR FIX) --- */
html {
    height: 100%;
    background-color: var(--background);
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(168, 85, 247, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(236, 72, 153, 0.15) 0px, transparent 50%);
    background-attachment: fixed;
    background-size: cover;
    background-repeat: no-repeat;
}

body {
    min-height: 100vh;
    background: transparent !important; /* Critical for background to show */
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 20px;
    overflow-x: hidden;
}

/* --- 2. GLASS CONTAINER --- */
.container {
    width: 100%;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.6s ease-out;
}

/* --- 3. TYPOGRAPHY & FORMS --- */
h2 { font-size: 2rem; font-weight: 700; margin-bottom: 10px; background: linear-gradient(to right, var(--primary), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
label { display: block; margin-top: 20px; margin-bottom: 8px; font-size: 0.9rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
input, select, textarea { width: 100%; padding: 14px 16px; background: rgba(15, 23, 42, 0.6); border: 2px solid var(--glass-border); border-radius: 12px; color: white; font-size: 1rem; transition: all 0.3s ease; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2); background: rgba(15, 23, 42, 0.9); }

/* --- 4. BUTTONS --- */
button { width: 100%; padding: 16px; margin-top: 25px; border: none; border-radius: 12px; font-size: 1rem; font-weight: 600; cursor: pointer; transition: all 0.3s ease; text-transform: uppercase; }
button.primary-btn { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: white; box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.3); }
button.primary-btn:hover { transform: translateY(-2px); box-shadow: 0 20px 25px -5px rgba(99, 102, 241, 0.4); }
button.secondary-btn { background: rgba(255, 255, 255, 0.05); color: var(--text-muted); margin-top: 15px; }
button.secondary-btn:hover { background: rgba(255, 255, 255, 0.1); color: white; }

/* --- 5. CARDS --- */
.question-card { background: rgba(255, 255, 255, 0.03); padding: 35px; border-radius: 20px; border: 1px solid var(--glass-border); transition: transform 0.3s ease, border-color 0.3s ease; height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.question-card:hover { transform: translateY(-10px); border-color: var(--primary); background: rgba(255, 255, 255, 0.06); }
.option-btn { display: block; width: 100%; text-align: left; background: rgba(255, 255, 255, 0.05); margin-top: 10px; padding: 15px 20px; border-radius: 10px; color: var(--text-muted); text-transform: none; border: 1px solid transparent; }
.option-btn:hover { background: rgba(255, 255, 255, 0.1); transform: translateX(5px); }
.option-btn.selected { background: rgba(99, 102, 241, 0.2); border-color: var(--primary); color: white; border: 1px solid var(--primary); }
.option-btn.correct { background: rgba(16, 185, 129, 0.2) !important; border-color: var(--success) !important; color: var(--success) !important; }
.option-btn.wrong { background: rgba(239, 68, 68, 0.2) !important; border-color: var(--error) !important; color: var(--error) !important; }
.explanation { margin-top: 15px; padding: 15px; background: rgba(255, 255, 255, 0.05); border-left: 4px solid var(--secondary); border-radius: 8px; color: #e2e8f0; display: none; animation: slideDown 0.3s ease-out; }

/* --- 6. ANIMATIONS --- */
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes float { 0% { transform: translateY(0px); } 50% { transform: translateY(-10px); } 100% { transform: translateY(0px); } }
.status-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 20px; font-size: 0.85rem; font-weight: 500; }
.status-success { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.status-error { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.status-loading { background: rgba(99, 102, 241, 0.15); color: #818cf8; }

/* --- 7. MOBILE OPTIMIZATION (THE FIX) --- */
@media (max-width: 768px) {
    /* Main Layout */
    body { padding: 10px !important; }
    .container { padding: 20px !important; margin-top: 10px !important; }
    
    /* Header: Stack Logo and Logout Button */
    .mobile-header { flex-direction: column !important; align-items: center !important; text-align: center; }
    .mobile-header button { width: 100% !important; margin-top: 15px !important; }
    
    /* Hero: Stack Welcome Text and Streak Fire */
    .mobile-hero { flex-direction: column !important; align-items: flex-start !important; }
    .mobile-hero-streak { width: 100% !important; margin-top: 20px !important; display: flex !important; justify-content: space-between !important; }
    
    /* Quiz & Menu Grids: Force 1 Column */
    .mobile-grid { grid-template-columns: 1fr !important; gap: 10px !important; }
    .mobile-menu-grid { grid-template-columns: 1fr 1fr !important; gap: 10px !important; } /* 2 cols for menu buttons */
    
    /* Fonts */
    h1 { font-size: 2rem !important; }
    h2 { font-size: 1.5rem !important; }
    h3 { font-size: 1.1rem !important; }
}
@media (min-width: 769px) {
    .mobile-menu-grid {
        /* Force exactly 4 equal columns */
        grid-template-columns: repeat(4, 1fr) !important; 
    }
}
