/* StudyHub Prototype — Global styles */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500;700&display=swap');
@import url('./tokens.css');

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: var(--font-body); color: var(--prof-text); background: var(--prof-bg); }
body { min-height: 100vh; -webkit-font-smoothing: antialiased; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }
input, textarea, select { font-family: inherit; }

/* Type utilities */
.t-h1 { font-family: var(--font-display); font-size: 32px; font-weight: 800; line-height: 1.2; letter-spacing: -0.02em; }
.t-h2 { font-family: var(--font-display); font-size: 24px; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; }
.t-h3 { font-family: var(--font-display); font-size: 18px; font-weight: 600; line-height: 1.4; }
.t-body { font-family: var(--font-body); font-size: 15px; font-weight: 400; line-height: 1.6; }
.t-small { font-family: var(--font-body); font-size: 13px; font-weight: 400; line-height: 1.5; }
.t-label { font-family: var(--font-display); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.t-mono { font-family: 'JetBrains Mono', monospace; }

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInRight { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes slideInLeft { from { transform: translateX(-20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
@keyframes pulseRed { 0%, 100% { background: var(--admin-danger); color: white; } 50% { background: #7f1d1d; color: #fca5a5; } }
@keyframes typingBlink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes confetti-fall {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}
.fade-in { animation: fadeIn 0.35s ease-out; }
.slide-right { animation: slideInRight 0.3s ease-out; }
.pulse { animation: pulse 1.8s ease-in-out infinite; }

/* Card primitives */
.card { background: #fff; border: 1px solid var(--prof-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); transition: all 0.2s ease; }
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

/* Button primitives */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 20px; border-radius: 999px; font-family: var(--font-display); font-weight: 600; font-size: 14px; transition: all 0.2s ease; white-space: nowrap; }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-lg { padding: 14px 28px; font-size: 15px; }
.btn-primary-prof { background: linear-gradient(135deg, #6ECFB5, #4DB8A0); color: white; box-shadow: 0 4px 12px rgba(110,207,181,0.3); }
.btn-primary-prof:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(110,207,181,0.4); }
.btn-primary-stud { background: linear-gradient(135deg, #8B7CF6, #7C3AED); color: white; box-shadow: 0 4px 12px rgba(139,124,246,0.3); }
.btn-primary-stud:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(139,124,246,0.4); }
.btn-primary-admin { background: linear-gradient(135deg, #6366F1, #8B5CF6); color: white; box-shadow: 0 4px 12px rgba(99,102,241,0.3); }
.btn-primary-admin:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(99,102,241,0.4); }
.btn-ai { background: linear-gradient(135deg, #A78BFA, #8B5CF6); color: white; box-shadow: 0 4px 12px rgba(139,92,246,0.3); }
.btn-ai:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(139,92,246,0.45); }
.btn-secondary { background: white; color: var(--prof-text); border: 1px solid var(--prof-border); }
.btn-secondary:hover { background: #F8FAFC; border-color: #CBD5E1; }
.btn-ghost { color: var(--prof-text-muted); }
.btn-ghost:hover { background: #F1F5F9; color: var(--prof-text); }
.btn-danger { background: var(--prof-danger); color: white; }

/* Badges / Tags */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-family: var(--font-display); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.badge-f1 { background: rgba(110,207,181,0.15); color: #047857; }
.badge-f2 { background: rgba(167,139,250,0.18); color: #6D28D9; }
.badge-f3 { background: rgba(245,200,66,0.2); color: #B45309; }
.badge-f4 { background: rgba(232,121,160,0.18); color: #BE185D; }
.badge-f5 { background: rgba(99,102,241,0.15); color: #4338CA; }
.badge-ai { background: linear-gradient(135deg, rgba(167,139,250,0.2), rgba(139,92,246,0.15)); color: #6D28D9; }
.badge-green { background: rgba(16,185,129,0.15); color: #047857; }
.badge-amber { background: rgba(245,158,11,0.18); color: #B45309; }
.badge-red { background: rgba(239,68,68,0.15); color: #B91C1C; }
.badge-gray { background: #F1F5F9; color: #64748B; }

/* Inputs */
.input { width: 100%; padding: 10px 14px; background: white; border: 1px solid var(--prof-border); border-radius: 12px; font-size: 14px; transition: all 0.2s; }
.input:focus { outline: none; border-color: var(--prof-primary); box-shadow: 0 0 0 3px rgba(110,207,181,0.15); }
.input-dark { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.12); color: white; }
.input-dark::placeholder { color: #64748B; }
.input-dark:focus { border-color: var(--admin-primary-light); box-shadow: 0 0 0 3px rgba(99,102,241,0.2); }

/* Icon wrapper */
.icon { width: 18px; height: 18px; stroke-width: 2; flex-shrink: 0; }
.icon-sm { width: 14px; height: 14px; }
.icon-lg { width: 22px; height: 22px; }

/* Sidebar */
.sidebar { width: 240px; background: white; border-right: 1px solid var(--prof-border); display: flex; flex-direction: column; height: 100vh; position: sticky; top: 0; flex-shrink: 0; }
.sidebar-logo { padding: 20px 20px 16px; display: flex; align-items: center; gap: 10px; }
.sidebar-logo-mark { width: 32px; height: 32px; border-radius: 10px; background: linear-gradient(135deg, #6ECFB5, #4DB8A0); display: flex; align-items: center; justify-content: center; color: white; font-family: var(--font-display); font-weight: 800; font-size: 15px; }
.sidebar-nav { padding: 8px 12px; flex: 1; }
.sidebar-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--prof-text-muted); font-size: 14px; font-weight: 500; margin-bottom: 2px; cursor: pointer; transition: all 0.15s; }
.sidebar-item:hover { background: #F1F5F9; color: var(--prof-text); }
.sidebar-item.active { background: rgba(110,207,181,0.12); color: var(--prof-primary-dark); font-weight: 600; }
.sidebar-item.active.admin { background: rgba(99,102,241,0.12); color: var(--admin-primary); }

/* Topbar */
.topbar { display: flex; align-items: center; gap: 16px; padding: 14px 28px; background: white; border-bottom: 1px solid var(--prof-border); position: sticky; top: 0; z-index: 10; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }
::-webkit-scrollbar-track { background: transparent; }

/* Exam-specific (dark theme) */
.exam-bg { background: #0F1729; color: #F1F5F9; min-height: 100vh; }
.exam-card { background: #1E2640; border: 1px solid rgba(99,102,241,0.2); border-radius: 20px; color: #F1F5F9; }
.exam-option { background: #1E2640; border: 2px solid rgba(255,255,255,0.08); border-radius: 14px; padding: 16px 20px; color: #F1F5F9; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; gap: 14px; }
.exam-option:hover { border-color: rgba(139,124,246,0.5); background: #252D47; }
.exam-option.selected { border-color: var(--stud-primary); background: rgba(139,124,246,0.15); }

/* Utility */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.grow { flex: 1; }
.text-muted { color: var(--prof-text-muted); }

/* Mobile frame */
.mobile-frame { width: 375px; height: 760px; border-radius: 40px; background: #1a1a2e; padding: 10px; box-shadow: 0 30px 80px rgba(15,23,41,0.3), 0 10px 30px rgba(15,23,41,0.15); position: relative; }
.mobile-inner { background: white; border-radius: 32px; height: 100%; overflow: hidden; overflow-y: auto; position: relative; }
.mobile-notch { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); width: 100px; height: 24px; background: #000; border-radius: 999px; z-index: 10; }

/* Responsive widths */
.container-fluid { max-width: 1440px; margin: 0 auto; padding: 0 28px; }
