/* =====================================================
   VISION EDUCATION DASHBOARD — Professional Edition
   Modern, Clean, Accessible Design System
   ===================================================== */

/* ─── Page ─── */
.dashboard-page {
  min-height: 100vh;
  display: flex;
  background: var(--bg-primary);
  position: relative;
  overflow-x: hidden;
}

/* Subtle background pattern */
.dashboard-page::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ═══════════════════════════════════════════════
   SIDE NAVIGATION (Sidebar) — Enhanced Professional Design
═══════════════════════════════════════════════ */
.side-nav {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 260px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  z-index: 300;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.05);
}

.side-nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 2rem;
  padding: 0 0.75rem 1.25rem;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  letter-spacing: -0.02em;
  transition: opacity 0.2s;
}

.side-nav-logo:hover {
  opacity: 0.8;
}

.side-nav-logo img {
  transition: transform 0.3s ease;
}

.side-nav-logo:hover img {
  transform: scale(1.05) rotate(5deg);
}

.side-nav-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  overflow: hidden;
  width: 100%;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
}

.nav-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
  transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item:hover {
  background: rgba(99, 102, 241, 0.06);
  color: var(--text-primary);
  transform: translateX(2px);
}

.nav-item.active {
  background: rgba(99, 102, 241, 0.12);
  color: var(--primary);
  font-weight: 700;
}

.nav-item.active::before {
  height: 24px;
}

.nav-item:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 12px;
}

.nav-item-icon {
  width: 36px;
  min-width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 10px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  transition: all 0.2s;
}

.nav-item:hover .nav-item-icon {
  color: var(--primary);
  background: rgba(99, 102, 241, 0.08);
}

.nav-item.active .nav-item-icon {
  color: var(--primary);
  background: rgba(99, 102, 241, 0.15);
}

.nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.side-nav-footer {
  padding-top: 1rem;
  margin-top: 1rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-get-pro {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 0.5rem;
  padding: 13px 16px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: #fff !important;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.875rem;
  border: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
  position: relative;
  overflow: hidden;
}

.nav-get-pro::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.nav-get-pro:hover::before {
  left: 100%;
}

.nav-get-pro:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.nav-get-pro:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

/* Bottom Nav for Mobile */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-sidebar);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  height: 62px;
  z-index: 400;
  padding: 0 0.25rem;
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  transition: color 0.2s;
  padding: 6px 4px;
}

.bottom-nav-item.active {
  color: var(--primary);
}
.bottom-nav-item:hover {
  color: var(--text-primary);
}
.bottom-nav-item:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
  border-radius: 8px;
}
.bottom-nav-item:active {
  transform: scale(0.95);
  transition: transform 0.1s;
}

.bottom-icon {
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 900px) {
  .side-nav {
    display: none;
  }
  .bottom-nav {
    display: flex;
  }
}

/* ═══════════════════════════════════════════════
   MAIN CONTENT WRAPPER — Enhanced Layout
═══════════════════════════════════════════════ */
.main-wrapper {
  flex: 1;
  min-height: 100vh;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

@media (max-width: 900px) {
  .main-wrapper {
    margin-left: 0;
    padding-bottom: 72px;
  }
}

/* ═══════════════════════════════════════════════
   NAVBAR
═══════════════════════════════════════════════ */
.dash-nav {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--bg-sidebar);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.dash-nav-inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 0 1.5rem;
}

@media (max-width: 640px) {
  .dash-nav-inner {
    padding: 0 1rem;
    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: var(--primary-dim);
  border: 1px solid var(--border-accent);
  color: var(--primary);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: var(--radius-sm);
}
@media (max-width: 560px) {
  .nav-badge {
    display: none;
  }
}

.nav-user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 5px 14px 5px 6px;
  font-size: 0.82rem;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s;
  animation: fadeInUp 0.3s ease;
}
.nav-user-chip:hover {
  background: var(--primary-dim);
  border-color: var(--border-accent);
}

.nav-avatar {
  width: 28px;
  height: 28px;
  background: var(--primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 800;
  color: #fff;
  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;
  }
}

/* ═══ GLOBAL SEARCH ═══ */
.nav-search-wrap {
  flex: 1;
  max-width: 500px;
  position: relative;
  z-index: 100;
}
@media (max-width: 768px) {
  .nav-search-wrap {
    display: none;
  } /* Hide on small screens to save space */
}

.nav-search-input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  font-size: 0.9rem;
  color: var(--text-muted);
  pointer-events: none;
}

#globalSearch {
  width: 100%;
  padding: 10px 40px 10px 40px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.9rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}

#globalSearch:focus {
  border-color: var(--primary);
  background: var(--bg-card);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

#globalSearch:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.search-kbd {
  position: absolute;
  right: 12px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-accent);
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  pointer-events: none;
}

.search-results-overlay {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-premium);
  max-height: 450px;
  overflow-y: auto;
  display: none;
  flex-direction: column;
  padding: 8px;
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.search-results-overlay.visible {
  display: flex;
}

.search-section-label {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 12px 12px 6px;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text-primary);
  transition: background 0.2s;
}

.search-result-item:hover {
  background: var(--primary-dim);
}

.search-result-icon {
  width: 32px;
  height: 32px;
  background: var(--bg-input);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.search-result-info {
  display: flex;
  flex-direction: column;
}

.search-result-title {
  font-size: 0.85rem;
  font-weight: 700;
}

.search-result-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.search-no-results {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ═══════════════════════════════════════════════
   HERO / WELCOME — Professional Redesign
═══════════════════════════════════════════════ */
.dash-hero {
  position: relative;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.03) 100%);
  padding: 4rem 2rem 3rem;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.dash-hero::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  animation: float 20s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-20px, 20px) scale(1.1); }
}

@media (max-width: 640px) {
  .dash-hero {
    padding: 3rem 1.5rem 2.5rem;
  }
}

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

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: start;
}

@media (min-width: 920px) {
  .hero-grid {
    grid-template-columns: 1.2fr 400px;
    gap: 3rem;
  }
}

.hero-left {
  animation: fadeInUp 0.6s ease-out;
}

.hero-right {
  align-self: start;
  animation: fadeInUp 0.6s ease-out 0.2s backwards;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.welcome-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 18px;
  border-radius: 100px;
  margin-bottom: 1.75rem;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.badge-dot {
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.2); }
}

.welcome-heading {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.04em;
  margin-bottom: 1.25rem;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.welcome-name {
  display: inline-block;
  position: relative;
  color: #6366f1 !important;
  font-weight: 800 !important;
  font-size: inherit;
  -webkit-text-fill-color: #6366f1 !important;
  background: none !important;
  -webkit-background-clip: unset !important;
  background-clip: unset !important;
}

.welcome-name::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), #8b5cf6);
  border-radius: 2px;
  animation: slideIn 0.8s ease-out 0.4s backwards;
}

@keyframes slideIn {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

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

/* ─── Hero Action Buttons ─── */
.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
  align-items: stretch;
}
.hero-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 24px;
  height: 50px;
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
  cursor: pointer;
  box-sizing: border-box;
  line-height: 1;
  border: 2px solid transparent;
}
.hero-btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: none;
}
.hero-btn-primary:hover {
  background: color-mix(in srgb, var(--primary) 88%, #000);
}
.hero-btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-accent);
  backdrop-filter: none;
}
.hero-btn-secondary:hover {
  background: var(--primary-dim);
  border-color: var(--primary);
  color: var(--primary);
}
.hero-btn-icon {
  font-size: 1rem;
  flex-shrink: 0;
}
.hero-btn-arrow {
  font-size: 1rem;
  transition: transform 0.2s;
}
.hero-btn-primary:hover .hero-btn-arrow {
  transform: none;
}

.hero-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ─── Trusted Schools Section ─── */
.trusted-schools {
  text-align: center;
  padding: 2rem 1.5rem;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.trusted-label {
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}
.trusted-pills {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

/* ─── Stats Grid — Enhanced Professional Design ─── */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}

.dash-stat-chip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.dash-stat-chip::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), #8b5cf6);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.dash-stat-chip:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
}

.dash-stat-chip:hover::before {
  transform: scaleX(1);
}

.dash-stat-num {
  font-size: 2rem;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -0.02em;
}

.dash-stat-lbl {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
}

/* ─── Streak Widget — Enhanced Design ─── */
.streak-widget {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.08) 0%, rgba(245, 158, 11, 0.05) 100%);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: 20px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 16px rgba(251, 191, 36, 0.1);
  transition: all 0.3s ease;
}

.streak-widget:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(251, 191, 36, 0.2);
}

.streak-widget-top {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.streak-fire {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.5rem;
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
  animation: fireGlow 2s ease-in-out infinite;
}

@keyframes fireGlow {
  0%, 100% { box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3); }
  50% { box-shadow: 0 6px 20px rgba(251, 191, 36, 0.5); }
}

.streak-fire-cold {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  animation: none;
}

.streak-widget-count {
  flex: 1;
}

.streak-num {
  font-size: 2.25rem;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1;
  display: block;
  letter-spacing: -0.03em;
}

.streak-unit {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.streak-widget-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid rgba(251, 191, 36, 0.15);
}

.streak-best {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.streak-best strong {
  color: #fbbf24;
  font-weight: 800;
}

.streak-status {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ═══════════════════════════════════════════════
   SUBJECTS SECTION — Professional Card Design
═══════════════════════════════════════════════ */
.subjects-section {
  padding: 3rem 2rem 6rem;
  background: var(--bg-primary);
}

.subjects-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
  animation: fadeInUp 0.6s ease-out;
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-sub {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ─── Grid ─── */
.subjects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

@media (max-width: 640px) {
  .subjects-grid {
    grid-template-columns: 1fr;
  }
}

/* ─── Subject Card — Enhanced Professional Design ─── */
.subject-card {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  text-decoration: none;
  color: var(--text-primary);
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: block;
  animation: fadeInUp 0.6s ease-out backwards;
}

.subject-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--subj-color), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.subject-card-inner {
  padding: 2rem;
  position: relative;
  z-index: 2;
}

.subject-card.available {
  cursor: pointer;
}

.subject-card.available:hover {
  border-color: var(--primary);
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12), 0 0 0 1px var(--primary);
}

.subject-card.available:hover::before {
  opacity: 1;
}

.subject-card:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 4px;
}

/* Coming soon card */
.subject-card.coming-soon {
  opacity: 0.6;
  cursor: not-allowed;
  filter: grayscale(0.3);
}

.subject-card.coming-soon:hover {
  transform: none;
  border-color: var(--border);
}

/* Glow effect on hover */
.subject-card-glow {
  position: absolute;
  inset: 0;
  border-radius: 24px;
  background: radial-gradient(
    ellipse 70% 70% at 50% 100%,
    rgba(99, 102, 241, 0.15),
    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.5rem;
}

.subject-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
  color: var(--subj-color);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.subject-card:hover .subject-icon-wrap {
  background: var(--subj-color);
  color: #fff;
  border-color: transparent;
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

/* Status badges */
.subject-status {
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.available-tag {
  background: rgba(34, 197, 94, 0.12);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.premium-tag {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.soon-tag {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* Card body */
.subject-name {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.subject-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

/* Meta chips */
.subject-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 1.5rem;
}

.meta-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 700;
  transition: all 0.2s;
}

.subject-card:hover .meta-chip {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.2);
  color: var(--primary);
}

.meta-chip.difficulty-hard {
  background: rgba(248, 113, 113, 0.08);
  border-color: rgba(248, 113, 113, 0.2);
  color: #f87171;
}

/* CTA */
.subject-cta {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 0.75rem;
  transition: all 0.3s;
}

.subject-card.available:hover .subject-cta {
  gap: 14px;
  color: var(--primary);
}

.cta-arrow {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 1.1rem;
}

.subject-card.available:hover .cta-arrow {
  transform: translateX(6px);
}

.subject-cta.muted {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.85rem;
}

/* ─── Stagger Animation Delays ─── */
.subjects-grid > *:nth-child(1) { animation-delay: 0.1s; }
.subjects-grid > *:nth-child(2) { animation-delay: 0.2s; }
.subjects-grid > *:nth-child(3) { animation-delay: 0.3s; }
.subjects-grid > *:nth-child(4) { animation-delay: 0.4s; }
.subjects-grid > *:nth-child(5) { animation-delay: 0.5s; }
.subjects-grid > *:nth-child(6) { animation-delay: 0.6s; }
.subjects-grid > *:nth-child(7) { animation-delay: 0.7s; }
.subjects-grid > *:nth-child(8) { animation-delay: 0.8s; }

/* ─── Institution Pill (Trusted Schools) ─── */
.institution-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
}
.institution-avatar {
  font-size: 1rem;
}

/* ─── Modal Overlay ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(5, 6, 10, 0.82);
  backdrop-filter: blur(12px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
  overflow-y: auto;
  transition: opacity 0.3s ease;
}
.modal-overlay.visible {
  display: flex;
  animation: modalFadeIn 0.25s ease forwards;
}
@keyframes modalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.never-match-light .modal-overlay {
  background: rgba(15, 23, 42, 0.65);
}

.settings-modal {
  background: var(--bg-card);
  width: 100%;
  max-width: 480px;
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-premium);
  display: flex;
  flex-direction: column;
  animation: modalSlideUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scrollbar for modal */
.settings-modal::-webkit-scrollbar {
  width: 4px;
}
.settings-modal::-webkit-scrollbar-track {
  background: transparent;
}
.settings-modal::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.modal-header {
  padding: 1.5rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 2;
}
.modal-title {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 0;
}
.close-modal-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 1.3rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}
.close-modal-btn:hover {
  background: rgba(248, 113, 113, 0.15);
  color: var(--error);
  border-color: var(--error);
}

.modal-content {
  padding: 0 1.5rem 1.5rem;
  overflow-y: auto;
  flex: 1;
}

/* User Info Card */
.settings-user-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--primary-dim);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0 0.5rem;
}

.settings-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--brand-accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 800;
  color: #000;
  box-shadow: 0 0 25px rgba(251, 191, 36, 0.3);
}
.settings-info h4 {
  margin: 0;
  font-size: 1.05rem;
}
.settings-info p {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Option Row */
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
}
.setting-label-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}
.setting-label {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
}
.setting-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Section title */
.setting-section-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin: 1.25rem 0 0.75rem;
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
}

/* Password inputs */
.setting-password-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.setting-input {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-input);
  border: 1.5px solid var(--border-bright);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.88rem;
  font-family: var(--font-main);
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.setting-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.setting-input:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.setting-input::placeholder {
  color: var(--text-muted);
}
.never-match-light .setting-input {
  border-color: rgba(0, 0, 0, 0.18);
  background: rgba(0, 0, 0, 0.03);
}

/* Password change feedback */
.pass-change-msg {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  margin-top: 4px;
}

/* Modal footer buttons */
.modal-footer-btns {
  display: flex;
  gap: 10px;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.modal-btn {
  flex: 1;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-align: center;
  white-space: nowrap;
}
.modal-btn-primary {
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: #fff;
}
.modal-btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}
.modal-btn-ghost {
  background: var(--bg-input);
  border: 1.5px solid var(--border-bright);
  color: var(--text-secondary);
}
.modal-btn-ghost:hover {
  background: rgba(248, 113, 113, 0.1);
  border-color: var(--error);
  color: var(--error);
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  width: 50px;
  height: 26px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all 0.3s;
  flex-shrink: 0;
}
.toggle-switch::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 20px;
  height: 20px;
  background: var(--bg-card);
  border-radius: 50%;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}
.toggle-switch.active {
  background: #22c55e;
}
.toggle-switch.active::after {
  transform: translateX(24px);
}

/* Security Badge */
.security-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.status-secure {
  color: #4ade80;
}
.status-warn {
  color: var(--gold);
}

/* Settings Button in Nav */
.nav-settings-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1.1rem;
}
.nav-settings-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--gold);
  transform: rotate(30deg);
}

/* ═══════════════════════════════════════════════
   IMMERSIVE SETTINGS WORKSPACE
   Full-screen drawer with glassmorphism
═══════════════════════════════════════════════ */
.settings-immersive-view {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(5, 8, 15, 0.94);
  backdrop-filter: blur(28px);
  display: flex;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  transform: scale(1.05) translateY(20px);
}
.settings-immersive-view.visible {
  opacity: 1;
  visibility: visible;
  transform: scale(1) translateY(0);
}

.settings-sidebar {
  width: 280px;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  padding: 3rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  background: rgba(15, 23, 42, 0.3);
}

.settings-nav-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.settings-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.settings-nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.settings-nav-item.active {
  background: var(--primary-dim);
  color: var(--primary);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
}

.settings-main {
  flex: 1;
  padding: 4rem 10% 4rem 4rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

@media (max-width: 900px) {
  .settings-immersive-view {
    flex-direction: column;
  }
  .settings-sidebar {
    width: 100%;
    padding: 1.5rem;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-direction: row;
    overflow-x: auto;
  }
  .settings-main {
    padding: 2rem 1.5rem;
  }
}

.settings-pane {
  display: none;
  animation: fadeInPane 0.4s ease;
}
.settings-pane.active {
  display: block;
}

@keyframes fadeInPane {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.settings-section-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2rem;
}

.settings-h1 {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin-bottom: 1.5rem;
}

.settings-h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ═══════════════════════════════════════════════
   STREAK WIDGET
═══════════════════════════════════════════════ */
.streak-widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}

.streak-widget-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 0.75rem;
}

.streak-fire {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s;
}

.streak-fire-cold {
  background: rgba(148, 163, 184, 0.1);
  color: #64748b;
}

.streak-fire-lit {
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
}

.streak-fire-warm {
  background: rgba(251, 146, 60, 0.15);
  color: #fb923c;
}

.streak-fire-hot {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  animation: fireGlow 1.5s ease-in-out infinite alternate;
}

@keyframes fireGlow {
  from { box-shadow: 0 0 8px rgba(239, 68, 68, 0.2); }
  to { box-shadow: 0 0 16px rgba(239, 68, 68, 0.35); }
}

.streak-widget-count {
  display: flex;
  flex-direction: column;
}

.streak-num {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -0.03em;
}

.streak-unit {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
}

.streak-widget-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.streak-best {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.streak-best strong {
  color: var(--text-secondary);
  font-weight: 700;
}

.streak-status {
  font-size: 0.72rem;
  font-weight: 600;
}

/* ─── Streak Toast ─── */
.streak-toast {
  position: fixed;
  bottom: 80px;
  right: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 9000;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.streak-toast-visible {
  transform: translateY(0);
  opacity: 1;
}

.streak-toast-fire {
  font-size: 1.4rem;
}

.streak-toast-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.streak-toast-content strong {
  font-size: 0.88rem;
  color: var(--text-primary);
}

.streak-toast-content span {
  font-size: 0.75rem;
  color: var(--text-muted);
}
