/**
 * Mind Bridge Institute, Patna
 * Shared Student Portal Design System & Component Styles
 * Obsidian Black & 3D Metallic Gold Design Hierarchy
 */

:root {
  /* Obsidian & Charcoal Canvas */
  --obsidian-darkest:  #050608;
  --obsidian-bg:       #08090C;
  --obsidian-surface:  #0E1017;
  --obsidian-card:     #131620;
  --obsidian-elevated: #181C28;
  --obsidian-input:    #0C0E14;
  --obsidian-line:     rgba(212, 175, 55, 0.16);
  --obsidian-line-sub: rgba(255, 255, 255, 0.08);

  /* Metallic Gold Palette */
  --gold-highlight:    #FFF1C2;
  --gold-champagne:    #F8DF93;
  --gold-primary:      #D4AF37;
  --gold-rich:         #E2B743;
  --gold-glow:         rgba(212, 175, 55, 0.28);
  --gold-ambient:      rgba(212, 175, 55, 0.08);

  /* Section Accent Colors */
  --live-red:          #FF4B4B;
  --live-glow:         rgba(255, 75, 75, 0.35);
  --free-green:        #2ECC71;
  --free-glow:         rgba(46, 204, 113, 0.3);
  --paid-purple:       #9B59B6;
  --paid-glow:         rgba(155, 89, 182, 0.3);
  --badge-blue:        #3498DB;
  --badge-glow:        rgba(52, 152, 219, 0.3);
  --amber-orange:      #E67E22;
  --teal-accent:       #1ABC9C;
  --test-gold:         #F39C12;

  --text-primary:      #FFFFFF;
  --text-heading:      #FAF9F6;
  --text-secondary:    #CBD2DE;
  --text-muted:        #8E96A4;
  --text-faint:        #616775;

  --r-sm:              8px;
  --r:                 14px;
  --r-lg:              20px;
  --r-pill:            999px;

  --shadow-card:       0 12px 30px rgba(0, 0, 0, 0.6), 0 0 1px rgba(212, 175, 55, 0.2);
  --shadow-card-hover: 0 18px 40px rgba(0, 0, 0, 0.75), 0 0 20px rgba(212, 175, 55, 0.25);
  --grad-gold-btn:     linear-gradient(135deg, #FFE89D 0%, #D4AF37 50%, #B88E28 100%);
  --grad-gold-text:    linear-gradient(135deg, #FFF5CC 0%, #D4AF37 50%, #F5C518 100%);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  font-size: 16px;
  background-color: var(--obsidian-bg);
  color-scheme: dark;
}
body {
  font-family: 'Inter', 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  color: var(--text-secondary);
  background: var(--obsidian-bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% 10%, rgba(212, 175, 55, 0.1) 0%, transparent 60%),
    linear-gradient(180deg, #050608 0%, #08090C 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 74px; /* Space for fixed mobile bottom nav */
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ============================================================
   TOP NAVIGATION BAR
============================================================ */
.dash-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: rgba(8, 9, 12, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--obsidian-line);
  position: sticky;
  top: 0;
  z-index: 100;
}
.brand-group {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #FFFFFF;
}
.brand-crest {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid rgba(212, 175, 55, 0.6);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.25);
  background: #000;
  overflow: hidden;
  flex-shrink: 0;
}
.brand-crest img { width: 100%; height: 100%; object-fit: cover; }
.brand-names { display: flex; flex-direction: column; }
.brand-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  color: #FFFFFF;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.brand-sub {
  font-size: 0.7rem;
  color: var(--gold-primary);
  font-weight: 600;
  letter-spacing: 0.03em;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.portal-badge {
  display: none;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gold-champagne);
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: var(--r-pill);
  padding: 4px 10px;
}
@media (min-width: 640px) {
  .portal-badge { display: inline-flex; }
}
.site-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--r-sm);
  padding: 6px 12px;
  text-decoration: none;
  transition: all .2s;
}
.site-link-btn:hover {
  background: rgba(212, 175, 55, 0.12);
  border-color: var(--gold-primary);
  color: var(--gold-champagne);
}
.header-avatar-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--gold-primary);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
  overflow: hidden;
  background: #000;
  cursor: pointer;
  text-decoration: none;
  display: block;
}
.header-avatar-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============================================================
   CONTAINER & VIEWS
============================================================ */
.dash-container {
  width: min(1040px, 100% - 24px);
  margin: 18px auto 28px;
  flex: 1;
}

.dash-view {
  display: none;
}
.dash-view.active {
  display: block;
  animation: fadeIn .25s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   WELCOME BANNER
============================================================ */
.welcome-banner {
  background: linear-gradient(165deg, rgba(22, 26, 38, 0.95) 0%, rgba(13, 15, 22, 0.98) 100%);
  border: 1.5px solid rgba(212, 175, 55, 0.3);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}
.welcome-banner::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-highlight), var(--gold-primary), transparent);
}
.welcome-user-info {
  display: flex;
  align-items: center;
  gap: 14px;
}
.user-photo-ring {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid var(--gold-primary);
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.35);
  overflow: hidden;
  background: #000;
  flex-shrink: 0;
}
.user-photo-ring img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.welcome-text-wrap {
  display: flex;
  flex-direction: column;
}
.welcome-sub {
  font-size: 0.76rem;
  color: var(--gold-champagne);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.welcome-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(1.25rem, 4vw, 1.55rem);
  font-weight: 800;
  color: #FFFFFF;
  line-height: 1.15;
}
.welcome-right-badge {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}
.admit-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--free-green);
  background: rgba(46, 204, 113, 0.1);
  border: 1px solid rgba(46, 204, 113, 0.3);
  padding: 3px 10px;
  border-radius: var(--r-pill);
}
.pulse-green {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--free-green);
  box-shadow: 0 0 6px var(--free-green);
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.3); }
}
.admit-target {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 3px;
}

/* Notice Strip */
.notice-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.22);
  border-radius: var(--r);
  padding: 10px 14px;
  margin-bottom: 22px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}
.notice-tag {
  background: var(--gold-primary);
  color: #000;
  font-weight: 800;
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  flex-shrink: 0;
}
.notice-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   PAGE SECTION HEADERS
============================================================ */
.inpage-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  font-size: 1.45rem;
  font-weight: 800;
  color: #FFD700; /* Bright Vivid Yellow Arrow */
  background: rgba(255, 215, 0, 0.1);
  border: 1.5px solid rgba(255, 215, 0, 0.45);
  border-radius: 50%;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  transition: all .2s ease;
  line-height: 1;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.18);
  flex-shrink: 0;
}
.back-btn:hover {
  background: rgba(255, 215, 0, 0.24);
  color: #FFF04D;
  border-color: #FFD700;
  box-shadow: 0 0 18px rgba(255, 215, 0, 0.45);
  transform: translateX(-3px);
}
.inpage-title-wrap {
  flex: 1;
  min-width: 200px;
}
.inpage-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.45rem;
  font-weight: 800;
  color: #FFFFFF;
  line-height: 1.2;
}
.inpage-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ============================================================
   SQUARE CARDS GRID (HUB)
============================================================ */
.section-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.section-headline h3 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: -0.01em;
}
.section-headline span {
  font-size: 0.75rem;
  color: var(--gold-champagne);
  font-weight: 600;
}
.square-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
@media (min-width: 680px) {
  .square-cards-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
}
@media (min-width: 990px) {
  .square-cards-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
  }
}

.square-card {
  aspect-ratio: 1 / 1;
  background: linear-gradient(165deg, rgba(22, 26, 38, 0.95) 0%, rgba(13, 15, 22, 0.98) 100%);
  border: 1.5px solid rgba(212, 175, 55, 0.18);
  border-radius: var(--r);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform .22s cubic-bezier(0.2, 0, 0.2, 1), box-shadow .22s ease, border-color .22s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
  color: inherit;
}
.square-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: var(--card-accent, var(--gold-primary));
  opacity: 0.85;
}
.square-card:hover {
  transform: translateY(-4px);
  border-color: var(--card-accent, var(--gold-primary));
  box-shadow: var(--shadow-card-hover), 0 0 20px var(--card-glow, var(--gold-glow));
}
.square-card:active {
  transform: scale(0.96);
}

.card-icon-frame {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  font-size: 1.4rem;
  background: rgba(212, 175, 55, 0.1);
  border: 1.5px solid rgba(212, 175, 55, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
  transition: transform .2s ease;
}
.square-card:hover .card-icon-frame {
  transform: scale(1.08);
}
.card-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(0.88rem, 3.2vw, 1.02rem);
  font-weight: 800;
  color: #FFFFFF;
  line-height: 1.15;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}
.card-badge {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--card-accent, var(--gold-champagne));
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: var(--r-pill);
  padding: 2px 8px;
  letter-spacing: 0.03em;
}

/* Card Variations */
.card-live { --card-accent: var(--live-red); --card-glow: var(--live-glow); }
.card-live .card-icon-frame { background: rgba(255, 75, 75, 0.12); border-color: rgba(255, 75, 75, 0.4); }
.card-live .card-badge { border-color: rgba(255, 75, 75, 0.35); }

.card-free-classes { --card-accent: var(--free-green); --card-glow: var(--free-glow); }
.card-paid-batches { --card-accent: var(--gold-primary); --card-glow: var(--gold-glow); }
.card-my-batches { --card-accent: var(--free-green); --card-glow: var(--free-glow); }
.card-free-batches { --card-accent: var(--amber-orange); --card-glow: rgba(230, 126, 34, 0.3); }
.card-free-pdfs { --card-accent: var(--badge-blue); --card-glow: var(--badge-glow); }
.card-free-books { --card-accent: var(--teal-accent); --card-glow: rgba(26, 188, 156, 0.3); }
.card-free-ebooks { --card-accent: var(--paid-purple); --card-glow: var(--paid-glow); }
.card-free-tests { --card-accent: var(--test-gold); --card-glow: rgba(243, 156, 18, 0.3); }

/* Stats Strip */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  background: var(--obsidian-surface);
  border: 1px solid var(--obsidian-line);
  border-radius: var(--r);
  padding: 14px 10px;
  margin-bottom: 24px;
  text-align: center;
}
.stat-box strong {
  display: block;
  font-size: 1.1rem;
  font-weight: 800;
  color: #FFFFFF;
}
.stat-box span {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============================================================
   EMPTY STATE BOX
============================================================ */
.empty-state-box {
  background: var(--obsidian-card);
  border: 1.5px dashed rgba(212, 175, 55, 0.32);
  border-radius: var(--r);
  padding: 40px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  max-width: 580px;
  margin: 20px auto;
  box-shadow: var(--shadow-card);
}
.empty-state-icon {
  font-size: 3rem;
  line-height: 1;
  filter: drop-shadow(0 4px 12px rgba(212, 175, 55, 0.25));
}
.empty-state-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.35);
  color: var(--gold-champagne);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.empty-state-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  color: #FFFFFF;
  margin: 0;
}
.empty-state-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 440px;
  margin: 0;
}
.empty-state-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 6px;
}

/* ============================================================
   ACTION BUTTONS
============================================================ */
.action-btn {
  padding: 8px 16px;
  border-radius: var(--r-sm);
  font-size: 0.85rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: all .2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}
.btn-gold {
  background: var(--grad-gold-btn);
  color: #000;
}
.btn-gold:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-outline {
  background: transparent;
  color: var(--gold-champagne);
  border: 1px solid rgba(212, 175, 55, 0.4);
}
.btn-outline:hover { background: rgba(212, 175, 55, 0.12); color: #FFF; }
.btn-danger {
  background: rgba(255, 75, 75, 0.15);
  color: #FFA5A5;
  border: 1px solid rgba(255, 75, 75, 0.4);
}
.btn-danger:hover {
  background: rgba(255, 75, 75, 0.25);
  color: #FFFFFF;
}

/* ============================================================
   PROFILE BOX & METADATA
============================================================ */
.profile-box {
  background: var(--obsidian-card);
  border: 1.5px solid rgba(212, 175, 55, 0.35);
  border-radius: var(--r-lg);
  padding: 28px 20px;
  text-align: center;
  box-shadow: var(--shadow-card);
}
.profile-avatar-big {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 2.5px solid var(--gold-primary);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.35);
  margin: 0 auto 14px;
  overflow: hidden;
  background: #000;
}
.profile-avatar-big img { width: 100%; height: 100%; object-fit: cover; }
.profile-meta-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 20px 0;
  text-align: left;
}
.profile-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--r-sm);
  font-size: 0.88rem;
  gap: 8px;
}
.profile-meta-row span { color: var(--text-muted); font-size: 0.82rem; }
.profile-meta-row strong { color: #FFFFFF; font-weight: 700; word-break: break-all; }

/* ============================================================
   MODALS
============================================================ */
.inpage-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.inpage-modal.open {
  display: flex;
}
.modal-content {
  width: 100%;
  max-width: 580px;
  background: var(--obsidian-surface);
  border: 1.5px solid rgba(212, 175, 55, 0.4);
  border-radius: var(--r-lg);
  padding: 24px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}
.modal-close-btn:hover { color: #FFFFFF; }

/* ============================================================
   BOTTOM NAVIGATION BAR (MOBILE & DESKTOP DOCK)
============================================================ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(10, 12, 17, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--obsidian-line);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 4px;
  z-index: 90;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.7);
}
.bnav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px 4px;
  border-radius: 8px;
  transition: all .2s;
  font-family: inherit;
  flex: 1;
  min-width: 0;
  text-decoration: none;
}
.bnav-icon {
  font-size: 1.25rem;
  line-height: 1;
  transition: transform .2s ease;
}
.bnav-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.bnav-item.active {
  color: var(--gold-champagne);
}
.bnav-item.active .bnav-icon {
  transform: translateY(-2px);
}
.bnav-item.active .bnav-label {
  color: var(--gold-primary);
}
