/* =====================================================
   DASHBOARD PAGE — Styles
   Navbar, hero welcome, subject cards grid
   ===================================================== */

/* ─── Page ─── */
.dashboard-page { min-height: 100vh; }

/* ═══════════════════════════════════════════════
   NAVBAR
═══════════════════════════════════════════════ */
.dash-nav {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(10,13,20,0.88);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
}
.dash-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* Logo */
.dash-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  transition: opacity 0.2s;
}
.dash-logo:hover { opacity: 0.85; }
.dash-logo-icon { font-size: 1.4rem; }

/* Right side */
.dash-nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-badge {
  background: rgba(251,191,36,0.1);
  border: 1px solid rgba(251,191,36,0.25);
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 100px;
}
@media (max-width: 560px) { .nav-badge { display: none; } }

.nav-user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 5px 14px 5px 6px;
  font-size: 0.82rem;
  animation: fadeInUp 0.3s ease;
}
.nav-avatar {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, #fbbf24, #f97316);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem;
  font-weight: 800;
  color: #0a0d14;
  flex-shrink: 0;
}
.nav-username {
  color: var(--text-secondary);
  font-weight: 600;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 420px) { .nav-username { display: none; } }

.nav-logout-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-main);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.2s;
}
.nav-logout-btn:hover {
  border-color: var(--red);
  color: var(--red);
  background: rgba(248,113,113,0.07);
}
@media (max-width: 480px) { .nav-logout-btn span:first-child { display: none; } }

/* ═══════════════════════════════════════════════
   HERO / WELCOME
═══════════════════════════════════════════════ */
.dash-hero {
  position: relative;
  overflow: hidden;
  padding: 5rem 1.5rem 4rem;
  text-align: center;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(251,191,36,0.08), transparent 60%),
    radial-gradient(ellipse 50% 40% at 80% 100%, rgba(96,165,250,0.06), transparent 50%);
}

.dash-hero-orbs { position: absolute; inset: 0; pointer-events: none; }
.dash-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.18;
  animation: floatOrb 14s ease-in-out infinite;
}
.dash-orb-1 { width: 500px; height: 500px; background: radial-gradient(circle, #fbbf24, transparent 70%); top: -200px; left: -80px; }
.dash-orb-2 { width: 350px; height: 350px; background: radial-gradient(circle, #60a5fa, transparent 70%); bottom: -100px; right: -50px; animation-delay: -7s; }

.dash-hero-content {
  position: relative;
  z-index: 2;
  max-width: 700px;
  margin: 0 auto;
}

.welcome-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(251,191,36,0.10);
  border: 1px solid rgba(251,191,36,0.25);
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 16px;
  border-radius: 100px;
  margin-bottom: 1.5rem;
}

.welcome-heading {
  font-size: clamp(2.2rem, 6vw, 3.8rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}
.welcome-name { display: inline-block; }

.welcome-sub {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  line-height: 1.7;
}

/* Stats row */
.dash-stats {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.dash-stat-chip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  backdrop-filter: blur(12px);
  transition: border-color 0.3s, transform 0.3s;
  animation: fadeInUp 0.5s ease both;
}
.dash-stat-chip:hover { border-color: var(--border-bright); transform: translateY(-3px); }
.dash-stat-num { font-size: 1.8rem; font-weight: 800; color: var(--gold); line-height: 1; }
.dash-stat-lbl { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }

/* ═══════════════════════════════════════════════
   SUBJECTS SECTION
═══════════════════════════════════════════════ */
.subjects-section {
  padding: 1rem 1.5rem 5rem;
}
.subjects-inner { max-width: 1200px; margin: 0 auto; }

.section-header {
  text-align: center;
  margin-bottom: 2.5rem;
}
.section-title {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.section-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ─── Grid ─── */
.subjects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}
@media (max-width: 640px) { .subjects-grid { grid-template-columns: 1fr; } }

/* ─── Subject Card Base ─── */
.subject-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: var(--text-primary);
  border: 1px solid var(--border);
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
  animation: fadeInUp 0.5s ease both;
  display: block;
}
.subject-card-inner {
  padding: 1.75rem;
  position: relative;
  z-index: 2;
}

/* Available card */
.subject-card.available {
  cursor: pointer;
  border-color: rgba(255,255,255,0.12);
}
.subject-card.available:hover {
  border-color: rgba(251,191,36,0.45);
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}
.subject-card.available::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #fbbf24, #f97316);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* Coming soon card */
.subject-card.coming-soon {
  opacity: 0.65;
  cursor: not-allowed;
}
.subject-card.coming-soon:hover {
  border-color: rgba(255,255,255,0.15);
}

/* Glow effect on hover */
.subject-card-glow {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  background: radial-gradient(ellipse 60% 60% at 50% 100%, rgba(var(--glow-rgb),0.12), transparent);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
  z-index: 1;
}
.subject-card.available:hover .subject-card-glow { opacity: 1; }

/* Card top */
.subject-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.subject-icon-wrap {
  width: 52px; height: 52px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--subj-color) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--subj-color) 30%, transparent);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
  box-shadow: 0 0 20px color-mix(in srgb, var(--subj-color) 20%, transparent);
}

/* Fallback for browsers without color-mix */
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .subject-icon-wrap { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.15); }
}

/* Status badges */
.subject-status {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 100px;
}
.available-tag {
  background: rgba(34,197,94,0.15);
  color: #22c55e;
  border: 1px solid rgba(34,197,94,0.3);
}
.soon-tag {
  background: rgba(255,255,255,0.06);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* Card body */
.subject-name {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.subject-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

/* Meta chips */
.subject-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 1.25rem;
}
.meta-chip {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 3px 10px;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}
.meta-chip.difficulty-hard {
  background: rgba(248,113,113,0.1);
  border-color: rgba(248,113,113,0.25);
  color: var(--red);
}

/* CTA */
.subject-cta {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: gap 0.2s;
}
.subject-card.available:hover .subject-cta { gap: 10px; }
.cta-arrow { transition: transform 0.2s; }
.subject-card.available:hover .cta-arrow { transform: translateX(4px); }
.subject-cta.muted { color: var(--text-muted); font-weight: 500; font-size: 0.82rem; }

/* ─── Stagger delays ─── */
.subjects-grid > *:nth-child(1) { animation-delay: 0.05s; }
.subjects-grid > *:nth-child(2) { animation-delay: 0.10s; }
.subjects-grid > *:nth-child(3) { animation-delay: 0.15s; }
.subjects-grid > *:nth-child(4) { animation-delay: 0.20s; }
.subjects-grid > *:nth-child(5) { animation-delay: 0.25s; }
.subjects-grid > *:nth-child(6) { animation-delay: 0.30s; }
.subjects-grid > *:nth-child(7) { animation-delay: 0.35s; }
.subjects-grid > *:nth-child(8) { animation-delay: 0.40s; }
