/* ==========================================================
   Maths In Space — Core Theme
   ========================================================== */

/* ---------- Design tokens ---------- */

:root {
  --bg-deep: #060A14;
  --bg-mid: #0b1024;
  --text: #ffffff;
  --text-muted: rgba(255,255,255,0.60);
  --brand-gold: #EFC556;
  --accent-pink: #ff2d55;
  --accent-pink-hi: #ff3f66;
  --accent-purple: #b56cff;
  --border-soft: rgba(255,255,255,0.08);
  --nav-h: 88px;
}

/* ---------- Base ---------- */

html, body {
  height: 100%;
}

body {
  background-color: var(--bg-deep);
  color: var(--bs-light);
  color: #ffffff;
}

/* ==========================================================
   Background: starfield
   ========================================================== */

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background: radial-gradient(ellipse at 20% 50%, rgba(30,60,120,0.18) 0%, transparent 60%), radial-gradient(ellipse at 80% 20%, rgba(80,40,120,0.12) 0%, transparent 50%), linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-mid) 100%);
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(1px 1px at 10% 15%, rgba(255,255,255,0.6) 0%, transparent 100%), radial-gradient(1px 1px at 25% 42%, rgba(255,255,255,0.4) 0%, transparent 100%), radial-gradient(1.5px 1.5px at 50% 8%, rgba(255,255,255,0.7) 0%, transparent 100%), radial-gradient(1px 1px at 72% 35%, rgba(255,255,255,0.5) 0%, transparent 100%), radial-gradient(1px 1px at 88% 72%, rgba(255,255,255,0.4) 0%, transparent 100%), radial-gradient(1.5px 1.5px at 15% 78%, rgba(255,255,255,0.6) 0%, transparent 100%), radial-gradient(1px 1px at 40% 90%, rgba(255,255,255,0.3) 0%, transparent 100%), radial-gradient(1px 1px at 60% 60%, rgba(255,255,255,0.5) 0%, transparent 100%), radial-gradient(1px 1px at 95% 10%, rgba(255,255,255,0.4) 0%, transparent 100%), radial-gradient(1.5px 1.5px at 33% 25%, rgba(255,255,255,0.35) 0%, transparent 100%), radial-gradient(1px 1px at 5% 55%, rgba(255,255,255,0.45) 0%, transparent 100%), radial-gradient(1px 1px at 78% 88%, rgba(255,255,255,0.3) 0%, transparent 100%);
  animation: twinkle 8s ease-in-out infinite alternate;
}

@keyframes twinkle {
  0% {
    opacity: 0.75;
  }
  100% {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  body::after {
    animation: none;
  }
}

/* ==========================================================
   Navbar
   ========================================================== */

.navbar {
  background-color: var(--bg-deep) !important;
  border-bottom: 1px solid var(--border-soft);
}

.navbar-brand, .navbar-brand:hover, .navbar-brand:focus {
  color: var(--brand-gold) !important;
  letter-spacing: 0.02em;
}

.navbar-nav .nav-link {
  color: rgba(255,255,255,0.75);
}

.navbar-nav .nav-link:hover, .navbar-nav .nav-link:focus {
  color: var(--text);
}

/* ==========================================================
   Navbar CTA: Launch Quest
   ========================================================== */

.btn-launch-quest {
  background-color: var(--accent-pink);
  color: var(--text) !important;
  border: none;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  margin-left: 1rem;
  font-weight: 600;
  line-height: 1.05;
  text-align: left;
  box-shadow: 0 10px 30px rgba(255, 45, 85, 0.35);
  transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.10s ease;
}

.btn-launch-quest:hover, .btn-launch-quest:focus, .btn-launch-quest:active {
  color: var(--text) !important;
  background-color: var(--accent-pink-hi);
}

.btn-launch-quest:active {
  transform: translateY(1px);
}

.btn-launch-quest * {
  color: var(--text) !important;
}

.btn-launch-quest img {
  width: 18px;
  height: 18px;
  display: block;
  filter: brightness(0) invert(1) drop-shadow(0 0 6px rgba(255,255,255,0.35));
}

/* ==========================================================
   Hero (stable badge + fits above fold)
   ========================================================== */

.hero-mis {
  min-height: calc(100vh - var(--nav-h));
  padding: 56px 0 56px;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(255, 45, 85, 0.10);
  border: 1px solid rgba(255, 45, 85, 0.25);
  color: rgba(255,255,255,0.85);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.85rem;
  margin-bottom: 16px;
}

.hero-title {
  margin: 12px 0 10px;
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.03em;
  font-size: clamp(46px, 4.8vw, 86px);
}

/* Gradient text: apply this class to the SPAN around “Maths In Space” */

.hero-gradient {
  display: inline-block;
  background: linear-gradient(90deg, var(--accent-pink) 0%, var(--accent-purple) 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  max-width: 760px;
  margin: 10px auto 0;
  color: var(--text-muted);
  font-size: 1.15rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 14px;
}

/* ==========================================================
   Hero buttons (base)
   ========================================================== */

.hero-btn-primary {
  background: var(--accent-pink);
  color: var(--text) !important;
  padding: 16px 26px;
  border-radius: 14px;
  font-weight: 700;
}

.hero-btn-secondary {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.88) !important;
  padding: 16px 26px;
  border-radius: 14px;
  font-weight: 700;
  opacity: 1;
}

/* ==========================================================
   Hero buttons (hover + bounce)
   ========================================================== */

.hero-btn-primary, .hero-btn-secondary {
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.18s cubic-bezier(.34,1.56,.64,1) !important;
}

.hero-btn-primary:hover, .hero-btn-primary:focus {
  background: var(--accent-pink-hi);
  box-shadow: 0 8px 24px rgba(255,45,85,0.35);
  transform: translateY(-1px);
}

.hero-btn-secondary:hover, .hero-btn-secondary:focus {
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.30);
  color: #ffffff !important;
  box-shadow: 0 6px 18px rgba(255,255,255,0.12);
  transform: translateY(-1px);
}

.hero-btn-primary:active, .hero-btn-secondary:active {
  transform: scale(0.96);
}

/* ==========================================================
   Optional: if hero buttons also have Bootstrap .btn classes
   (safe to keep even if unused)
   ========================================================== */

.hero-mis .hero-btn-primary {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--accent-pink);
  --bs-btn-border-color: transparent;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--accent-pink-hi);
  --bs-btn-hover-border-color: transparent;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--accent-pink-hi);
  --bs-btn-active-border-color: transparent;
  --bs-btn-focus-shadow-rgb: 255, 45, 85;
  opacity: 1 !important;
}

/* ==========================================================
   Mobile refinement: Navbar Launch Quest button
   ========================================================== */

@media (max-width: 576px) {
  .btn-launch-quest {
    margin-left: 0;
    padding: 10px 16px;
    border-radius: 999px;
    font-size: 0.95rem;
    line-height: 1.1;
    box-shadow: 0 6px 18px rgba(255,45,85,0.30);
  }
}

/* Center it in the navbar */

@media (max-width: 576px) {
  .navbar .btn-launch-quest {
    display: inline-flex;
    margin: 8px auto 0;
  }
}

/* Slightly reduce icon size on mobile */

@media (max-width: 576px) {
  .btn-launch-quest img {
    width: 16px;
    height: 16px;
  }
}

/* Strong readable panels for the worksheet cards */

.worksheet-item .worksheet-card {
  background: rgba(28, 32, 58, 0.55);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 22px;
  padding: 1.25rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 18px 55px rgba(0,0,0,0.55), inset 0 0 0 1px rgba(255,255,255,0.03);
}

/* Optional: make descriptions easier to read */

.worksheet-item .meta {
  color: rgba(255,255,255,0.78);
}

/* ==========================================================
   Premium Glass Panels (Lighter)
   ========================================================== */

.glass, .worksheet-card {
  background: rgba(48,46,116,0.11);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.35), inset 0 0 0 1px rgba(255,255,255,0.02);
}

/* Navbar active page “pill” */

.navbar .nav-link {
  border-radius: 12px;
  padding: 0.45rem 0.8rem;
}

.navbar .nav-link.active, .navbar .nav-link.nav-pill.active {
  background: rgba(255, 45, 85, 0.12);
  color: #ff2d55 !important;
  border: 1px solid rgba(255, 45, 85, 0.25);
}

/* Optional: make the Crew Portal link always look like a pill (even when not active) 

.navbar .nav-link.nav-pill {
  border: 1px solid rgba(255, 45, 85, 0.18);
  background: rgba(255, 45, 85, 0.08);
  color: rgba(255,255,255,0.92);
  
} */

.navbar .nav-link.nav-pill:hover {
  background: rgba(255, 45, 85, 0.12);
}

/* Make the collapsed dropdown feel “glassier” */

@media (max-width: 767.98px) {
  #navcol-5 {
    margin-top: .75rem;
    padding: .75rem;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(28, 32, 58, 0.55);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }
}

@media (max-width: 767.98px) {
  .navbar-nav .nav-link {
    padding: .6rem .75rem;
  }
}

.navbar {
}

/* Fix search input text colour */

#searchInput, #levelSelect, #topicSelect {
  color: #212529 !important;
}

/* Also fix placeholder colour */

#searchInput::placeholder {
  color: #6c757d !important;
}

.form-control, .form-select {
  color: #212529 !important;
}

/* Learn tabs: force the crimson glass pill on active */

#learnTabs.mis-learn-tabs .nav-link {
  background: transparent !important;
  border: 1px solid transparent !important;
  color: #fff !important;
  border-radius: 999px !important;
  padding: 0.45rem 1.2rem !important;
}

#learnTabs.mis-learn-tabs .nav-link:hover {
  color: var(--bs-primary) !important;
}

#learnTabs.mis-learn-tabs .nav-link.active {
  color: var(--bs-primary) !important;
  background: rgba(255,63,102,0.14) !important;
  border-color: rgba(255,63,102,0.45) !important;
  box-shadow: 0 0 18px rgba(255,63,102,0.18) !important;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* =========================
   Contact page (glass form)
   ========================= */

.mis-page-bg {
  background: radial-gradient(1200px 700px at 20% 0%, rgba(124,219,255,0.18), transparent 55%), radial-gradient(900px 600px at 100% 20%, rgba(255,63,102,0.14), transparent 55%), radial-gradient(900px 700px at 40% 120%, rgba(124,219,255,0.10), transparent 60%), #07162d;
  min-height: 100vh;
}

.mis-contact-wrap {
  padding-top: 2rem;
  padding-bottom: 3rem;
}

.mis-glass-card {
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(12, 18, 35, 0.72);
  box-shadow: 0 30px 80px rgba(0,0,0,0.45);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.mis-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  font-size: 0.95rem;
  color: rgba(255,255,255,0.55);
  margin-bottom: 0.6rem;
}

.mis-input {
  border-radius: 12px;
  padding: 0.95rem 1.1rem;
  background: rgba(255,255,255,0.06) !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  color: rgba(255,255,255,0.88) !important;
}

.mis-input::placeholder {
  color: rgba(255,255,255,0.35);
}

.mis-input:focus {
  box-shadow: 0 0 0 .25rem rgba(255,63,102,0.18) !important;
  border-color: rgba(255,63,102,0.35) !important;
}

.mis-submit {
  border-radius: 14px;
  padding: 1.05rem 1.25rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

/* Make the primary button look like your screenshot (big crimson bar) */

.btn-primary {
  background-color: rgb(255,63,102);
  border-color: rgb(255,63,102);
}

.btn-primary:hover {
  background-color: #ff5c7d;
  border-color: #ff5c7d;
}

