:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --secondary: #f59e0b;
    --bg-body: #f1f5f9;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius: 12px;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- HEADER --- */
.main-header {
    background: linear-gradient(90deg, #1e3a8a 0%, #2563eb 100%);
    color: white;
    height: 64px; /* Fixed height for consistency */
    padding: 0 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    position: relative;
    z-index: 50;
}

.header-left { display: flex; align-items: center; }
.logo { height: 36px; background: white; padding: 3px; border-radius: 6px; }

.header-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    font-weight: 600;
    font-size: 1.1rem;
    white-space: nowrap;
}

.header-right { display: flex; align-items: center; gap: 12px; }

/* Buttons in Header */
.btn-icon {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    transition: background 0.2s;
}
.btn-icon:hover { background: rgba(255,255,255,0.4); }

.btn-logout {
    background: #dc2626; /* Red for distinct exit action */
    border: none;
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
}

/* User Badge (ID Display) */
.user-badge {
    text-align: right;
    margin-right: 5px;
    line-height: 1.2;
}
.user-badge strong { display: block; font-size: 0.7rem; color: #bfdbfe; text-transform: uppercase; }
.user-badge span { font-size: 0.9rem; font-weight: bold; }

/* --- HELP MODAL --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); z-index: 1000;
    display: none; align-items: center; justify-content: center;
    backdrop-filter: blur(4px);
}
.modal-overlay.show { display: flex; animation: fadeIn 0.2s; }

.modal-card {
    background: white; width: 90%; max-width: 380px;
    border-radius: 16px; padding: 25px; text-align: center;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.whatsapp-btn {
    background: #25D366; color: white; text-decoration: none;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    padding: 12px; border-radius: 8px; font-weight: bold; margin-top: 15px;
    box-shadow: 0 4px 6px rgba(37, 211, 102, 0.3);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* --- RESPONSIVE RULES --- */
@media (max-width: 768px) {
    /* Mobile: Hide Center Title & User ID to save space */
    .header-center { display: none; }
    .user-badge { display: none; }
    
    /* Adjust container spacing */
    .container { padding: 15px; margin-top: 10px; }
    .card { padding: 20px; }
}

/* --- REST OF UI --- */
.container { width: 100%; max-width: 800px; margin: 20px auto; padding: 0 20px; flex: 1; }
.card { background: var(--bg-card); border-radius: var(--radius); padding: 25px; box-shadow: var(--shadow); border: 1px solid var(--border); margin-bottom: 20px; }

/* Buttons & Inputs */
.btn { padding: 12px 24px; border: none; border-radius: 8px; font-size: 1rem; font-weight: 600; cursor: pointer; display: inline-block; text-decoration: none; text-align: center; }
.btn-primary { background: var(--primary); color: white; width: 100%; }
.btn-outline { background: white; border: 2px solid var(--border); color: var(--primary); font-weight:bold; }
.login-input { width: 100%; padding: 14px; border: 2px solid #cbd5e1; border-radius: 8px; font-size: 1.2rem; text-align: center; font-weight: bold; margin: 20px 0; outline: none; }
.login-input:focus { border-color: var(--primary); }

/* Quiz Grid */
.grid-menu { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 12px; }
.grid-menu .btn { padding: 15px 5px; width: 100%; }

/* Quiz Elements */
.timer-badge { background: #fff7ed; color: #c2410c; padding: 5px 12px; border-radius: 20px; font-weight: bold; border: 1px solid #ffedd5; }
.option-btn { width: 100%; text-align: left; padding: 15px; margin-bottom: 10px; background: #fff; border: 2px solid var(--border); border-radius: 10px; cursor: pointer; font-size: 1rem; color: var(--text-main); }
.option-btn.selected { background: #eff6ff; border-color: var(--primary); color: var(--primary-dark); font-weight: bold; }
.nav-buttons { display: flex; gap: 10px; margin-top: 20px; }
.btn-nav { flex: 1; }
.review-card { background: #f8fafc; border: 1px solid var(--border); padding: 15px; margin-bottom: 15px; border-radius: 8px; border-left: 5px solid #cbd5e1; }
.review-card.correct { border-left-color: #16a34a; background: #f0fdf4; }
.review-card.wrong { border-left-color: #dc2626; background: #fef2f2; }
.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; text-align: center; margin-bottom: 15px; }
.info-box h4 { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; }
.info-box p { font-size: 1.1rem; font-weight: bold; color: var(--primary-dark); }

/* --- NEW ADDITIONS FOR WHATSAPP FEATURES --- */

/* WhatsApp Green Share Button */
.btn-whatsapp {
    background: #25D366;
    color: white;
    width: 100%;
    display: inline-block;
    text-decoration: none;
    margin-bottom: 15px;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(37, 211, 102, 0.3);
    transition: background 0.2s;
}
.btn-whatsapp:hover {
    background: #1da851;
    color: white;
}

/* Small Report Icon in Review Cards */
.report-btn {
    text-decoration: none;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s, transform 0.2s;
    flex-shrink: 0; /* Prevent icon from squishing */
    margin-left: 10px;
}
.report-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Adjustment for result button container to stack nicely */
#result-ui .btn {
    margin: 5px 0;
}

/* Append to style.css */
.btn-whatsapp {
    background: #25D366;
    color: white;
    width: 100%;
    display: inline-block;
    text-decoration: none;
    margin-bottom: 15px;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(37, 211, 102, 0.3);
    transition: background 0.2s;
}
.btn-whatsapp:hover {
    background: #1da851;
    color: white;
}

.report-btn {
    text-decoration: none;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s, transform 0.2s;
    flex-shrink: 0;
    margin-left: 10px;
}
.report-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}