/* =========================================
VARIABLES & RESET (YOUR COLORS)
========================================= */
:root {
    --primary-dark: #0f172a;
    --primary-light: #1e293b;
    --accent-gold: #d4af37;
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --accent-green: #10b981;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --shadow-lg: 0 20px 50px -12px rgba(0, 0, 0, 0.5);
    --font-heading: 'Cinzel', serif;
    --font-body: 'Outfit', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; outline: none; }

body {
    font-family: var(--font-body);
    background-color: var(--primary-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Animated Background Orbs */
.bg-orb {
    position: fixed; border-radius: 50%; filter: blur(100px); z-index: -1; opacity: 0.4;
    animation: floatOrb 10s infinite alternate ease-in-out;
}
.orb-1 { width: 400px; height: 400px; background: var(--accent-purple); top: -100px; left: -100px; }
.orb-2 { width: 300px; height: 300px; background: var(--accent-blue); bottom: -50px; right: -50px; animation-delay: 2s; }
@keyframes floatOrb { 0% { transform: translate(0, 0); } 100% { transform: translate(30px, 50px); } }

/* =========================================
AUTH PAGES (LOGIN & CODE ENTRY)
========================================= */
.auth-wrapper {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; padding: 2rem; width: 100%;
}

.auth-container {
    width: 100%; max-width: 420px; padding: 3rem 2.5rem;
    border-radius: 24px; text-align: center;
    box-shadow: var(--shadow-lg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    background: var(--glass-bg); border: 1px solid var(--glass-border);
}

.auth-header { margin-bottom: 2rem; }
.auth-icon {
    font-size: 2.5rem; color: var(--accent-gold); margin-bottom: 1rem;
    display: inline-block; padding: 15px; background: rgba(212, 175, 55, 0.1);
    border-radius: 50%; border: 1px solid rgba(212, 175, 55, 0.3);
}
.auth-header h2 { font-family: var(--font-heading); font-size: 1.8rem; color: #fff; margin-bottom: 0.5rem; letter-spacing: 1px; }
.auth-header .subtitle { color: var(--text-muted); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 1.5px; }
.highlight { color: var(--accent-blue); -webkit-text-fill-color: var(--accent-blue); }

/* Buttons */
.btn-google, .btn-primary {
    width: 100%; padding: 14px; border-radius: 12px; font-size: 1rem; font-weight: 600;
    cursor: pointer; transition: all 0.3s ease; display: flex; align-items: center;
    justify-content: center; gap: 12px; border: 1px solid var(--glass-border);
    margin-top: 1.5rem; font-family: var(--font-body);
}
.btn-google { background: rgba(255, 255, 255, 0.05); color: var(--text-main); }
.btn-google:hover { background: rgba(255, 255, 255, 0.1); border-color: var(--accent-blue); transform: translateY(-2px); }
.btn-google img { width: 20px; height: 20px; }
.btn-primary { background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple)); color: #fff; border: none; box-shadow: 0 10px 20px -10px rgba(59, 130, 246, 0.5); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 15px 30px -10px rgba(59, 130, 246, 0.7); }

/* Input */
.glass-input {
    width: 100%; padding: 14px 20px; background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border); border-radius: 12px; color: var(--text-main);
    font-size: 1rem; text-align: center; letter-spacing: 2px; transition: all 0.3s ease;
}
.glass-input::placeholder { color: var(--text-muted); letter-spacing: 0; }
.glass-input:focus { border-color: var(--accent-gold); background: rgba(0, 0, 0, 0.4); box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2); }

/* Error Message */
.error-msg { color: #ef4444; background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3); padding: 10px; border-radius: 8px; margin-top: 1.5rem; font-size: 0.9rem; font-weight: 500; }
.hidden { display: none !important; }

/* =========================================
MAIN PAGE STYLES (YOUR DASHBOARD CSS)
========================================= */
.app-container { display: flex; flex-direction: column; min-height: 100vh; }
.glass-panel { background: var(--glass-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--glass-border); box-shadow: var(--shadow-lg); }

.top-nav { display: flex; flex-direction: column; position: sticky; top: 0; z-index: 100; border-bottom: 1px solid var(--glass-border); border-radius: 0 0 20px 20px; background: rgba(15, 23, 42, 0.95); padding: 0; }
.nav-row { display: flex; align-items: center; width: 100%; padding: 1rem 2rem; }
.brand-row { justify-content: flex-start; padding-bottom: 0.5rem; }
.nav-brand { display: flex; align-items: center; gap: 10px; }
.brand-icon { font-size: 1.8rem; color: var(--accent-gold); }
.nav-brand h1 { font-family: var(--font-heading); font-size: 1.5rem; letter-spacing: 2px; background: linear-gradient(to right, #fff, var(--accent-gold)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.nav-brand span { color: var(--accent-blue); -webkit-text-fill-color: var(--accent-blue); }

.links-row { justify-content: space-between; padding-top: 0.5rem; border-top: 1px solid rgba(255,255,255,0.05); }
.nav-links { display: flex; gap: 5px; overflow-x: auto; flex: 1; margin-right: 20px; scrollbar-width: none; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-item { display: flex; align-items: center; gap: 8px; padding: 10px 15px; text-decoration: none; color: var(--text-muted); border-radius: 10px; transition: all 0.3s ease; font-weight: 500; white-space: nowrap; font-size: 0.9rem; }
.nav-item i { font-size: 1rem; }
.nav-item:hover, .nav-item.active { background: rgba(255, 255, 255, 0.08); color: #fff; border-bottom: 2px solid var(--accent-gold); }
.nav-item.active { background: linear-gradient(180deg, rgba(212, 175, 55, 0.1), transparent); }

.nav-actions { display: flex; align-items: center; gap: 15px; flex-shrink: 0; }
.live-clock { font-family: monospace; font-size: 1rem; color: var(--accent-blue); background: rgba(0,0,0,0.3); padding: 6px 12px; border-radius: 8px; border: 1px solid rgba(59, 130, 246, 0.3); }
.logout-btn { color: #ef4444; text-decoration: none; border: 1px solid rgba(239, 68, 68, 0.3); padding: 8px 15px; border-radius: 8px; transition: 0.3s; display: flex; align-items: center; gap: 8px; font-size: 0.9rem; }
.logout-btn:hover { background: rgba(239, 68, 68, 0.1); }

.main-content { flex: 1; padding: 2rem; }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.header-text h2 { font-family: var(--font-heading); font-size: 2rem; color: #fff; }
.subtitle { color: var(--accent-gold); font-size: 0.9rem; letter-spacing: 1px; text-transform: uppercase; }
.user-profile { display: flex; align-items: center; gap: 12px; }
.user-profile img { width: 45px; height: 45px; border-radius: 50%; border: 2px solid var(--accent-gold); }
.user-info { display: flex; flex-direction: column; }
.user-info .name { font-weight: 600; font-size: 0.95rem; }
.user-info .role { font-size: 0.75rem; color: var(--text-muted); }

.stats-overview { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.stat-card { display: flex; align-items: center; gap: 1.5rem; padding: 1.5rem; border-radius: 16px; transition: transform 0.3s; }
.stat-card:hover { transform: translateY(-5px); }
.stat-icon { width: 50px; height: 50px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }
.stat-icon.blue { background: rgba(59, 130, 246, 0.2); color: var(--accent-blue); }
.stat-icon.green { background: rgba(16, 185, 129, 0.2); color: var(--accent-green); }
.stat-icon.purple { background: rgba(139, 92, 246, 0.2); color: var(--accent-purple); }
.stat-details { display: flex; flex-direction: column; }
.stat-label { font-size: 0.85rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value { font-size: 1.8rem; font-weight: 700; color: #fff; }

.quick-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.action-card { background: var(--glass-bg); border: 1px solid var(--glass-border); padding: 1.5rem; border-radius: 16px; text-align: center; cursor: pointer; transition: all 0.3s ease; text-decoration: none; color: var(--text-main); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.action-card:hover { transform: translateY(-5px); border-color: var(--accent-gold); background: rgba(255, 255, 255, 0.05); }
.action-icon { font-size: 2rem; color: var(--accent-blue); margin-bottom: 5px; }

.dashboard-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 2rem; }
.activity-feed, .top-performers { padding: 2rem; border-radius: 20px; background: var(--glass-bg); border: 1px solid var(--glass-border); }
.activity-feed h3, .top-performers h3 { font-family: var(--font-heading); color: var(--accent-gold); margin-bottom: 1.5rem; display: flex; align-items: center; gap: 10px; }
#activityList { list-style: none; max-height: 300px; overflow-y: auto; }
#activityList li { display: flex; align-items: center; gap: 15px; padding: 12px 0; border-bottom: 1px solid var(--glass-border); }
.activity-icon { width: 35px; height: 35px; border-radius: 50%; background: rgba(59, 130, 246, 0.2); color: var(--accent-blue); display: flex; align-items: center; justify-content: center; }
.activity-text p { font-size: 0.9rem; color: #fff; margin: 0; }
.activity-text span { font-size: 0.75rem; color: var(--text-muted); }
.top-student-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--glass-border); }
.student-rank { font-weight: bold; color: var(--accent-gold); width: 20px; }
.student-name-small { flex: 1; font-size: 0.9rem; color: #fff; margin-left: 10px; }
.student-score { font-weight: bold; color: var(--accent-green); }

@media (max-width: 1000px) {
    .links-row { flex-wrap: wrap; gap: 1rem; }
    .nav-links { width: 100%; order: 2; margin-right: 0; margin-bottom: 10px; }
    .nav-actions { width: 100%; justify-content: space-between; order: 3; }
    .dashboard-grid { grid-template-columns: 1fr; }
}