/* === THEME VARIABLES & DESIGN TOKENS === */
:root {
    --bg: #f8f9fc;
    --text: #0f172a; --text-muted: #64748b; --accent: #003366;
    --accent-glow: rgba(0, 51, 102, 0.15);
    --card-bg: rgba(255, 255, 255, 0.60);
    --border: rgba(255, 255, 255, 0.8);
    --btn-text: #fff; --btn-bg: #003366;
    --shadow-sm: 0 4px 6px rgba(0, 51, 102, 0.05);
    --shadow-md: 0 10px 25px rgba(0, 51, 102, 0.08);
    --shadow-lg: 0 20px 40px rgba(0, 51, 102, 0.12);
    --glass-blur: blur(20px) saturate(180%);
    --glass-border: 1px solid rgba(255, 255, 255, 0.6);
}
[data-theme="dark"] {
    --bg: #050608;
    --text: #e2e8f0; --text-muted: #94a3b8; --accent: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.2);
    --card-bg: rgba(255, 255, 255, 0.03);
    --border: rgba(255, 255, 255, 0.08);
    --btn-text: #000; --btn-bg: #fff;
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.5);
    --glass-blur: blur(20px) saturate(180%);
    --glass-border: 1px solid rgba(255, 255, 255, 0.08);
}

/* === GLOBAL === */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: transparent; height: 100%; }
body { 
    font-family: 'Outfit', sans-serif; 
    background: var(--bg); 
    color: var(--text); line-height: 1.6; overflow-x: hidden; 
    transition: background 0.3s ease, color 0.3s ease; 
    padding-bottom: 120px; 
    -webkit-font-smoothing: antialiased; 
    min-height: 100%;
}
/* Canvas sits ABOVE the solid body background, but BELOW the content */
#particle-canvas { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.navbar, .app-container, .hero, .section, .footer, .login-container, .modal-overlay, .bottom-nav { position: relative; z-index: 1; }
/* Ensure all content sits above the canvas */
.navbar, .app-container, .hero, .section, .footer, .login-container, .modal-overlay, .bottom-nav { position: relative; z-index: 1; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
h1, h2, h3, h4 { font-family: 'Sora', sans-serif; letter-spacing: -0.02em; }
input, select, textarea { font-size: 16px !important; }

/* === NAVBAR === */
.navbar { display: flex; justify-content: space-between; align-items: center; padding: 15px 30px; background: var(--card-bg); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border-bottom: var(--glass-border); position: sticky; top: 0; z-index: 1000; box-shadow: var(--shadow-sm); }
.navbar .nav-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.navbar .nav-logo { width: 35px; height: 35px; object-fit: contain; }
.navbar .logo-text { font-size: clamp(16px, 2vw, 18px); font-weight: 600; color: var(--text); white-space: nowrap; }
.nav-actions { display: flex; align-items: center; gap: 15px; }
.btn-login { background: var(--btn-bg); color: var(--btn-text); padding: 8px 18px; border-radius: 8px; text-decoration: none; font-weight: 500; font-size: 14px; white-space: nowrap; border: none; cursor: pointer; font-family: 'Outfit', sans-serif; box-shadow: var(--shadow-sm); transition: transform 0.2s ease, box-shadow 0.2s ease; }
.btn-login:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }

/* === THEME SWITCH === */
.theme-switch { position: relative; display: inline-block; width: 50px; height: 26px; margin-right: 5px; flex-shrink: 0; }
.theme-switch input { opacity: 0; width: 0; height: 0; }
.slider-track { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(255, 255, 255, 0.1); border: 1px solid var(--border); transition: 0.4s; border-radius: 34px; }
.slider-thumb { position: absolute; height: 18px; width: 18px; left: 4px; bottom: 3px; background-color: #3b82f6; transition: 0.4s cubic-bezier(0.165, 0.84, 0.44, 1); border-radius: 50%; box-shadow: 0 0 8px rgba(59, 130, 246, 0.6); }
input:not(:checked) + .slider-track { background-color: #e2e8f0; }
input:not(:checked) + .slider-track .slider-thumb { transform: translateX(24px); background-color: #fbbf24; box-shadow: 0 0 8px rgba(251, 191, 36, 0.6); }

/* === HERO === */
.hero { display: flex; justify-content: space-between; align-items: center; padding: 60px 30px; min-height: 70vh; gap: 40px; max-width: 1200px; margin: 0 auto; width: 100%; }
.hero-text { flex: 1; }
.hero-text h1 { font-size: clamp(28px, 4vw, 42px); line-height: 1.2; margin-bottom: 20px; min-height: 100px; color: var(--text); font-weight: 700; }
.hero-text p { font-size: clamp(15px, 1.5vw, 18px); color: var(--text-muted); max-width: 500px; margin-bottom: 30px; }
.btn-cta { background: var(--btn-bg); color: var(--btn-text); padding: 14px 32px; border-radius: 10px; text-decoration: none; font-weight: 600; font-size: 15px; display: inline-block; border: none; cursor: pointer; font-family: 'Outfit', sans-serif; box-shadow: var(--shadow-md); transition: transform 0.2s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.2s ease; }
.btn-cta:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.hero-logo { flex: 1; display: flex; justify-content: center; align-items: center; }
.hero-logo img { max-width: 80%; filter: drop-shadow(0 20px 30px rgba(59, 130, 246, 0.2)); animation: floatLogo 4s ease-in-out infinite; }
@keyframes floatLogo { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-20px); } }

/* === REVEAL === */
.reveal { opacity: 0; transform: translateY(30px); transition: all 1s cubic-bezier(0.165, 0.84, 0.44, 1); }
.reveal.active { opacity: 1; transform: translateY(0); }

/* === LANDING ELEMENTS === */
.section { padding: 60px 30px; max-width: 1200px; margin: 0 auto; }
.section-title { font-size: clamp(24px, 3vw, 28px); color: var(--text); text-align: center; margin-bottom: 15px; font-weight: 700; }
.section-subtitle { color: var(--text-muted); text-align: center; margin-bottom: 40px; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.feature-card { background: var(--card-bg); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border: var(--glass-border); padding: 25px; border-radius: 16px; transition: all 0.3s ease; box-shadow: var(--shadow-md); }
.feature-card:hover { transform: translateY(-5px); border-color: var(--accent); box-shadow: var(--shadow-lg); }
.feature-icon { width: 40px; height: 40px; background: var(--accent-glow); border-radius: 10px; display: flex; align-items: center; justify-content: center; color: var(--accent); margin-bottom: 15px; }
.feature-card h3 { color: var(--text); margin-bottom: 8px; font-size: 18px; }
.feature-card p { font-size: 14px; color: var(--text-muted); }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; }
.gallery-item { height: 150px; border-radius: 12px; overflow: hidden; cursor: pointer; border: var(--glass-border); box-shadow: var(--shadow-sm); background: var(--border); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; opacity: 0; }
.gallery-item img.loaded { opacity: 1; }
.gallery-item:hover img { transform: scale(1.05); }

/* === FAQ === */
.faq-item { background: var(--card-bg); backdrop-filter: var(--glass-blur); border: var(--glass-border); border-radius: 12px; margin-bottom: 10px; overflow: hidden; box-shadow: var(--shadow-sm); }
.faq-header { padding: 15px 20px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; font-family: 'Sora', sans-serif; font-weight: 500; font-size: 15px; }
.faq-body { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; padding: 0 20px; color: var(--text-muted); font-size: 14px; }
.faq-item.active .faq-body { max-height: 200px; padding: 0 20px 15px 20px; }

/* === FOOTER === */
.footer { background: var(--card-bg); backdrop-filter: var(--glass-blur); border-top: var(--glass-border); padding: 40px 30px 20px 30px; margin-top: 40px; }
.footer-grid { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 30px; }
.footer-col h4 { margin-bottom: 15px; font-size: 16px; }
.footer-col a { display: block; color: var(--text-muted); text-decoration: none; font-size: 14px; margin-bottom: 8px; transition: color 0.3s; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { max-width: 1200px; margin: 20px auto 0 auto; text-align: center; padding-top: 20px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 13px; }

/* === LOGIN BOX === */
.login-container { display: flex; justify-content: center; align-items: center; min-height: 80vh; padding: 40px 20px; }
.login-box { background: var(--card-bg); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border: var(--glass-border); padding: 40px; border-radius: 20px; max-width: 400px; width: 100%; box-shadow: var(--shadow-lg); }
.login-box h2 { color: var(--text); text-align: center; margin-bottom: 5px; font-size: 26px; }
.login-box .subtitle { color: var(--text-muted); text-align: center; margin-bottom: 25px; font-size: 14px; }
.input-group { margin-bottom: 15px; }
.input-group label { display: block; color: var(--text-muted); font-size: 13px; margin-bottom: 6px; }
.input-group input, .input-group select, .input-group textarea { width: 100%; padding: 12px 14px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-family: 'Outfit', sans-serif; transition: all 0.3s ease; }
.input-group input:focus, .input-group select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-glow); }
.login-msg { background: rgba(230, 57, 70, 0.1); color: #e63946; border: 1px solid rgba(230, 57, 70, 0.3); padding: 10px; border-radius: 8px; margin-bottom: 15px; font-size: 13px; text-align: center; display: none; }
.login-msg.show { display: block; }

/* === APP LAYOUT === */
.app-container { max-width: 1000px; margin: 0 auto; padding: 20px; padding-bottom: 120px; }
.welcome-banner { background: linear-gradient(135deg, var(--accent), #1e40af); color: white; padding: 25px; border-radius: 20px; margin-bottom: 25px; box-shadow: 0 15px 35px rgba(0, 51, 102, 0.3); position: relative; overflow: hidden; border: 1px solid rgba(255,255,255,0.1); }
.welcome-banner h2 { font-size: 22px; margin-bottom: 5px; position: relative; z-index: 1; }
.welcome-banner p { opacity: 0.9; font-size: 14px; position: relative; z-index: 1; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 15px; margin-bottom: 25px; }
.stat-card { background: var(--card-bg); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border: var(--glass-border); padding: 20px; border-radius: 16px; box-shadow: var(--shadow-md); transition: transform 0.3s ease; }
.stat-card:hover { transform: translateY(-2px); }
.stat-card h3 { font-size: 24px; color: var(--accent); margin-bottom: 5px; }
.stat-card p { font-size: 12px; color: var(--text-muted); }
.dash-card { background: var(--card-bg); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border: var(--glass-border); padding: 25px; border-radius: 20px; box-shadow: var(--shadow-lg); margin-bottom: 20px; }
.dash-card h2 { color: var(--text); margin-bottom: 15px; font-size: 18px; display: flex; align-items: center; gap: 10px; }
.list-item { display: flex; justify-content: space-between; align-items: center; background: var(--bg); border: 1px solid var(--border); padding: 18px; border-radius: 14px; margin-bottom: 12px; gap: 15px; transition: all 0.3s ease; }
.list-item:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.list-item-info { flex: 1; }
.list-item-info h4 { color: var(--text); margin: 0; font-size: 15px; font-weight: 600; }
.list-item-info p { color: var(--text-muted); margin: 0; font-size: 12px; }
.list-actions { display: flex; gap: 10px; align-items: center; }
.btn-small { background: transparent; color: var(--text-muted); border: 1px solid var(--border); padding: 8px 16px; border-radius: 8px; cursor: pointer; font-weight: 500; font-size: 12px; font-family: 'Outfit', sans-serif; white-space: nowrap; transition: all 0.3s ease; }
.btn-small:hover { border-color: var(--accent); color: var(--accent); }
.btn-small.danger:hover { border-color: #e63946; color: #e63946; }
.icon-btn { background: transparent; border: 1px solid transparent; color: var(--text-muted); width: 34px; height: 34px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.3s ease; }
.icon-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }
.custom-select { background-color: var(--bg); color: var(--text); border: 1px solid var(--border); padding: 12px 14px; border-radius: 8px; font-family: 'Outfit', sans-serif; width: 100%; margin-top: 5px; cursor: pointer; -webkit-appearance: none; appearance: none; background-image: url('data:image/svg+xml;utf8,<svg fill="%2364748b" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>'); background-repeat: no-repeat; background-position: right 10px center; }
.custom-select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-glow); }

/* === BOTTOM NAV === */
.bottom-nav { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); width: calc(100% - 40px); max-width: 450px; background: var(--card-bg); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border: var(--glass-border); border-radius: 24px; padding: 10px; display: flex; justify-content: space-around; box-shadow: var(--shadow-lg); z-index: 1000; }
.nav-item { background: transparent; border: none; color: var(--text-muted); padding: 8px 15px; border-radius: 16px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; font-family: 'Sora', sans-serif; transition: all 0.3s ease; flex: 1; }
.nav-item.active { color: var(--accent); background: var(--accent-glow); box-shadow: 0 0 15px var(--accent-glow); }
.nav-item svg { width: 20px; height: 20px; transition: transform 0.3s ease; }
.nav-item.active svg { transform: scale(1.1); }

/* === MODAL === */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(8px); z-index: 10000; display: flex; justify-content: center; align-items: center; padding: 20px; overflow-y: auto; }
.modal-box { position: relative; background: var(--bg); border: var(--glass-border); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); max-width: 500px; width: 100%; margin: auto; padding: 30px; border-radius: 20px; max-height: 85vh; overflow-y: auto; }
.modal-close { position: absolute; top: 15px; right: 15px; background: transparent; border: 1px solid var(--border); color: var(--text-muted); width: 32px; height: 32px; border-radius: 8px; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.3s ease; }
.modal-close:hover { border-color: #e63946; color: #e63946; }

/* === STUDENT HUB === */
.hub-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 15px; }
.hub-card { background: var(--card-bg); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border: var(--glass-border); padding: 0; border-radius: 16px; cursor: pointer; transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1); display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow-md); }
.hub-card:hover { border-color: var(--accent); transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.hub-card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
.hub-card h3 { color: var(--text); font-size: 16px; margin: 0 0 8px 0; }
.hub-card p { color: var(--text-muted); font-size: 12px; margin: 0; }
.progress-bar { height: 6px; background: var(--border); border-radius: 5px; margin-top: 10px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent), #3b82f6); border-radius: 5px; transition: width 0.5s ease; box-shadow: 0 0 10px var(--accent-glow); }
.resource-link { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; background: var(--bg); border: 1px solid var(--border); padding: 15px; border-radius: 12px; margin-bottom: 8px; transition: all 0.3s ease; }
.resource-link:hover { border-color: var(--accent); color: var(--accent); transform: translateX(4px); box-shadow: var(--shadow-sm); }

/* === PROFILE === */
.profile-header { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 20px; }
.avatar { width: 80px; height: 80px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), #3b82f6); color: white; display: flex; align-items: center; justify-content: center; font-family: 'Sora', sans-serif; font-size: 32px; font-weight: 600; margin-bottom: 10px; box-shadow: 0 10px 20px var(--accent-glow); border: 2px solid rgba(255,255,255,0.2); }
.profile-info { width: 100%; }
.profile-info-row { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.profile-info-row:last-child { border-bottom: none; }
.profile-info-label { color: var(--text-muted); }
.profile-info-value { color: var(--text); font-weight: 500; text-align: right; }

/* === QR SCANNER === */
#reader { border-radius: 12px; overflow: hidden; border: 1px solid var(--border); }
#reader button { background: var(--accent) !important; color: white !important; border: none !important; padding: 10px !important; border-radius: 8px !important; cursor: pointer !important; width: 100% !important; margin-top: 10px !important; font-family: 'Outfit', sans-serif !important; font-weight: 500 !important; font-size: 14px !important; }
#reader button:hover { opacity: 0.9; }
#reader img[alt="Info icon"] { display: none; }
#reader select { background: var(--bg) !important; color: var(--text) !important; border: 1px solid var(--border) !important; padding: 5px !important; border-radius: 5px !important; margin-bottom: 10px !important; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-state svg { width: 50px; height: 50px; margin-bottom: 15px; opacity: 0.5; }

@media (max-width: 768px) {
    .hero { flex-direction: column-reverse; text-align: center; padding: 40px 20px; min-height: auto; }
    .hero-text p { margin: 0 auto 30px auto; }
    .hero-logo img { max-width: 60%; }
}