/* ============================================================
   main.css — IEEE SB MCET Design System
   Reset · Tokens · Typography · Layout · Buttons · Forms · Toast
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* ── TOKENS ──────────────────────────────────────────────── */
:root {
  /* Colors — aether dark */
  --color-bg:           #06070a;
  --color-bg-2:         #0e1014;
  --color-bg-3:         #14171d;
  --color-border:       rgba(255,255,255,0.06);
  --color-border-hover: rgba(255,255,255,0.14);
  --color-text-1:       #f2f1ee;
  --color-text-2:       #8a8e97;
  --color-text-3:       #4a4f5a;
  --color-accent:       #ff4fa3;
  --color-accent-2:     #4ed8ff;
  --color-accent-hover: #ff72b8;
  --color-accent-soft:  rgba(255,79,163,0.10);
  --color-success:      #7ce0b0;
  --color-warning:      #ff8a2a;
  --aether-grad:        linear-gradient(90deg, #4ed8ff 0%, #ff4fa3 52%, #ff8a2a 100%);

  /* RGB versions for rgba() usage */
  --color-bg-rgb: 6,7,10;

  /* Shadows */
  --shadow-card:  0 1px 3px rgba(0,0,0,0.6), 0 0 0 1px var(--color-border);
  --shadow-hover: 0 8px 32px rgba(0,0,0,0.5), 0 0 0 1px var(--color-border-hover);
  --shadow-glow:  0 0 24px rgba(255,79,163,0.25);

  /* Radii */
  --r-card:   12px;
  --r-btn:    6px;
  --r-pill:   999px;
  --r-img:    10px;

  /* Spacing */
  --sp-1: 8px;  --sp-2: 16px; --sp-3: 24px; --sp-4: 32px;
  --sp-5: 48px; --sp-6: 64px; --sp-7: 96px; --sp-8: 128px;

  /* Typography */
  --font-body: 'Inter', sans-serif;
  --font-head: 'Space Grotesk', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Layout */
  --max-w: 1200px;
  --nav-h: 64px;
  --util-h: 32px;
  --total-header: calc(var(--nav-h) + var(--util-h));
}

[data-theme="light"] {
  --color-bg:           #f8f9fc;
  --color-bg-2:         #ffffff;
  --color-bg-3:         #eef0f7;
  --color-border:       rgba(0,0,0,0.07);
  --color-border-hover: rgba(0,0,0,0.15);
  --color-text-1:       #0e0f14;
  --color-text-2:       #4a4f5a;
  --color-text-3:       #9898b0;
  --color-accent:       #d4007a;
  --color-accent-hover: #b5006a;
  --color-accent-soft:  rgba(212,0,122,0.08);
  --shadow-card:  0 1px 4px rgba(0,0,0,0.07), 0 0 0 1px var(--color-border);
  --shadow-hover: 0 8px 32px rgba(0,0,0,0.10), 0 0 0 1px var(--color-border-hover);
  --color-bg-rgb: 248,249,252;
}

/* ── RESET ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text-1);
  background: var(--color-bg);
  transition: background 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ── TYPOGRAPHY ──────────────────────────────────────────── */
h1, h2, h3, h4, h5 {
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text-1);
  line-height: 1.2;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

p { color: var(--color-text-2); }

.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--sp-1);
  display: block;
}

/* ── LAYOUT ──────────────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--sp-3);
}

.section { padding: var(--sp-7) 0; }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-6);
  align-items: center;
}

@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; gap: var(--sp-4); }
}

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--r-btn);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-body);
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(255,79,163,0.30);
}
.btn-primary:hover {
  background: var(--color-accent-hover);
  box-shadow: 0 6px 20px rgba(255,79,163,0.45);
  transform: translateY(-2px);
}

.btn-ghost {
  background: var(--color-accent-soft);
  color: var(--color-accent);
  border: 1px solid var(--color-border);
}
.btn-ghost:hover {
  background: rgba(255,79,163,0.16);
  border-color: var(--color-accent);
  transform: translateY(-2px);
}

.btn-ghost-sm {
  padding: 8px 16px;
  font-size: 0.82rem;
  background: var(--color-accent-soft);
  color: var(--color-accent);
  border: 1px solid var(--color-border);
  border-radius: var(--r-btn);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  transition: all 0.2s;
}
.btn-ghost-sm:hover {
  background: rgba(255,79,163,0.18);
  border-color: var(--color-accent);
  transform: translateY(-1px);
}

/* ── CONFETTI BUBBLE BUTTON ──────────────────────────────── */
.confetti-btn {
  position: relative;
  padding: 11px 24px;
  border-radius: 6px;
  border: none;
  color: #fff;
  cursor: pointer;
  background-image: linear-gradient(-60deg, #ff4fa3 0%, #4ed8ff 100%);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: var(--font-body);
  white-space: nowrap;
  text-decoration: none;
  overflow: visible;
}
.confetti-btn:active { transform: scale(0.96); }

.confetti-btn::before,
.confetti-btn::after,
.resource-card::before,
.resource-card::after {
  position: absolute;
  content: "";
  width: 150%;
  left: 50%;
  height: 100%;
  transform: translateX(-50%);
  z-index: -1;
  background-repeat: no-repeat;
  pointer-events: none;
}

.confetti-btn:hover::before,
.resource-card:hover::before {
  top: -70%;
  background-image: radial-gradient(circle, #a89215 20%, transparent 20%),
    radial-gradient(circle, transparent 20%, #13a5be 20%, transparent 30%),
    radial-gradient(circle, #a3b82d 20%, transparent 20%),
    radial-gradient(circle, #590cbe 20%, transparent 20%),
    radial-gradient(circle, transparent 10%, #bd1717 15%, transparent 20%),
    radial-gradient(circle, #2a7ce8 20%, transparent 20%),
    radial-gradient(circle, #30e82a 20%, transparent 20%),
    radial-gradient(circle, #e92c75 20%, transparent 20%),
    radial-gradient(circle, #914fe7 20%, transparent 20%);
  background-size: 10% 10%, 20% 20%, 15% 15%, 20% 20%, 18% 18%, 10% 10%, 15% 15%,
    10% 10%, 18% 18%;
  background-position: 50% 120%;
  animation: greentopBubbles 0.6s ease;
}

@keyframes greentopBubbles {
  0% {
    background-position: 5% 90%, 10% 90%, 10% 90%, 15% 90%, 25% 90%, 25% 90%,
      40% 90%, 55% 90%, 70% 90%;
  }
  50% {
    background-position: 0% 80%, 0% 20%, 10% 40%, 20% 0%, 30% 30%, 22% 50%,
      50% 50%, 65% 20%, 90% 30%;
  }
  100% {
    background-position: 0% 70%, 0% 10%, 10% 30%, 20% -10%, 30% 20%, 22% 40%,
      50% 40%, 65% 10%, 90% 20%;
    background-size: 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%;
  }
}

.confetti-btn:hover::after,
.resource-card:hover::after {
  bottom: -70%;
  background-image: radial-gradient(circle, #ff93db 20%, transparent 20%),
    radial-gradient(circle, #2ae8df 20%, transparent 20%),
    radial-gradient(circle, transparent 10%, #71ffbd 15%, transparent 20%),
    radial-gradient(circle, #2a9ce8 20%, transparent 20%),
    radial-gradient(circle, #7814fc 20%, transparent 20%),
    radial-gradient(circle, #73e4f8 20%, transparent 20%),
    radial-gradient(circle, #f8d3a9 20%, transparent 20%);
  background-size: 15% 15%, 20% 20%, 18% 18%, 20% 20%, 15% 15%, 20% 20%, 18% 18%;
  background-position: 50% 0%;
  animation: greenbottomBubbles 0.6s ease;
}

@keyframes greenbottomBubbles {
  0% {
    background-position: 10% -10%, 30% 10%, 55% -10%, 70% -10%, 85% -10%,
      70% -10%, 70% 0%;
  }
  50% {
    background-position: 0% 80%, 20% 80%, 45% 60%, 60% 100%, 75% 70%, 95% 60%,
      105% 0%;
  }
  100% {
    background-position: 0% 90%, 20% 90%, 45% 70%, 60% 110%, 75% 80%, 95% 70%,
      110% 10%;
    background-size: 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%;
  }
}

/* ── BADGES ──────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.badge-chapter { background: var(--color-accent-soft); color: var(--color-accent); }

.badge-status.past     { background: rgba(47,158,68,0.12);  color: #2f9e44; }
.badge-status.upcoming { background: rgba(230,119,0,0.12);  color: #e67700; }

/* ── PAGE HERO BANNER ────────────────────────────────────── */
.page-hero {
  padding: calc(var(--total-header) + var(--sp-6)) 0 var(--sp-6);
  background: linear-gradient(135deg, var(--color-bg) 0%, var(--color-bg-2) 100%);
  border-bottom: 1px solid var(--color-border);
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(59,91,219,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.page-hero .breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--color-text-3);
  margin-bottom: var(--sp-2);
}
.page-hero .breadcrumb a { color: var(--color-accent); }
.page-hero .breadcrumb a:hover { text-decoration: underline; }

.page-hero h1 { margin-bottom: var(--sp-2); }
.page-hero p  { font-size: 1.05rem; max-width: 560px; }

/* ── FORMS ───────────────────────────────────────────────── */
.form-group { margin-bottom: var(--sp-2); }
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-1);
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  background: var(--color-bg-3);
  border: 1px solid var(--color-border);
  border-radius: var(--r-btn);
  color: var(--color-text-1);
  font-size: 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--color-text-3); }

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(59,91,219,0.15);
}

.form-group textarea { resize: vertical; min-height: 120px; }

/* ── TOAST & PROMO POPUP ─────────────────────────────────── */
@keyframes floatToast {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-4px); }
}

@keyframes iconWiggle {
  0%, 100% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(-10deg) scale(1.1); }
  75% { transform: rotate(10deg) scale(1.1); }
}

.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(var(--color-bg-rgb), 0.65);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--color-text-1);
  padding: 16px 24px;
  border-radius: 100px;
  font-size: 0.95rem;
  font-weight: 500;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,79,163,0.2), inset 0 0 20px rgba(255,79,163,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  z-index: 9999;
  transition: transform 0.5s cubic-bezier(0.34,1.56,0.64,1), opacity 0.5s ease;
  opacity: 0;
  white-space: normal;
  max-width: 90vw;
  width: max-content;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  animation: floatToast 4s ease-in-out infinite alternate;
  animation-delay: 0.5s;
}

.promo-toast-inner {
  display: flex;
  align-items: center;
  gap: 14px;
}
.promo-toast-inner .promo-icon {
  font-size: 1.8rem;
  animation: iconWiggle 3s ease-in-out infinite;
  transform-origin: center bottom;
}
.promo-content {
  display: flex;
  flex-direction: column;
}
.promo-content strong {
  background: var(--aether-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.5px;
}
.promo-content p {
  font-size: 0.85rem;
  color: var(--color-text-1);
  opacity: 0.85;
  margin: 0;
  line-height: 1.4;
}
.promo-close {
  margin-left: 12px;
  font-size: 1.1rem;
  color: var(--color-text-2);
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  transition: all 0.2s ease;
}
.promo-close:hover {
  color: #fff;
  background: var(--color-accent);
  transform: rotate(90deg);
}

@media (max-width: 600px) {
  .toast {
    padding: 12px 16px;
    bottom: 20px;
    width: 92vw;
  }
  .promo-toast-inner {
    gap: 8px;
  }
  .promo-toast-inner .promo-icon {
    font-size: 1.25rem;
    display: none;
  }
  .promo-content strong {
    font-size: 0.95rem;
  }
  .promo-content p {
    font-size: 0.75rem;
  }
  .btn-ghost-sm {
    padding: 6px 10px;
    font-size: 0.75rem;
  }
  .promo-close {
    margin-left: auto;
  }
}

/* ── SCROLL PROGRESS ─────────────────────────────────────── */
#scroll-progress {
  position: fixed;
  top: var(--util-h);
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--color-accent), #748ffc);
  z-index: 999;
  transition: width 0.1s linear;
}

/* ── CTA STRIP ───────────────────────────────────────────── */
.cta-strip {
  background: linear-gradient(135deg, var(--color-accent) 0%, #748ffc 100%);
  padding: var(--sp-6) 0;
  text-align: center;
}
.cta-strip h2 { color: #fff; margin-bottom: var(--sp-2); }
.cta-strip p  { color: rgba(255,255,255,0.8); margin-bottom: var(--sp-3); }
.cta-strip .btn-ghost {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border-color: rgba(255,255,255,0.3);
}
.cta-strip .btn-ghost:hover {
  background: rgba(255,255,255,0.28);
  border-color: rgba(255,255,255,0.6);
}

/* ── SKELETON LOADER ─────────────────────────────────────── */
.skeleton {
  background: var(--color-bg-3);
  background: linear-gradient(
    90deg,
    var(--color-bg-3) 25%,
    var(--color-bg-2) 50%,
    var(--color-bg-3) 75%
  );
  background-size: 400% 100%;
  animation: skeleton-loading 1.5s infinite linear;
  border-radius: var(--r-btn);
}

@keyframes skeleton-loading {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.skeleton-text {
  height: 1rem;
  margin-bottom: 0.5rem;
  width: 100%;
}
.skeleton-text.short { width: 60%; }
.skeleton-text.tall { height: 3rem; }

.skeleton-img {
  width: 100%;
  height: 200px;
  border-radius: var(--r-img);
  margin-bottom: 1rem;
}

.skeleton-avatar {
  width: 100px;
  height: 100px;
  border-radius: var(--r-pill);
  margin: 0 auto 1rem auto;
}

.skeleton-card {
  padding: var(--sp-2);
  border: 1px solid var(--color-border);
  border-radius: var(--r-card);
  background: var(--color-bg-2);
  display: flex;
  flex-direction: column;
}

.skeleton-team-card {
  padding: 24px;
  background: var(--color-bg-2);
  border-radius: var(--r-card);
  border: 1px solid var(--color-border);
  text-align: center;
}

/* ── UTILITY ─────────────────────────────────────────────── */
.text-accent { color: var(--color-accent); }
.text-muted  { color: var(--color-text-2); }
.visually-hidden { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); }

@media (max-width: 480px) {
  .container { padding: 0 var(--sp-2); }
  /* Tighten section vertical padding on small screens */
  .section { padding: var(--sp-5) 0; }
}

/* ── LIGHTBOX ────────────────────────────────────────────── */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.93);
  backdrop-filter: blur(10px);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.lightbox-overlay.open { opacity: 1; pointer-events: all; }

.lb-img-wrap {
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lb-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--r-img);
  box-shadow: 0 24px 80px rgba(0,0,0,0.8);
}

.lb-close, .lb-prev, .lb-next {
  position: fixed;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  border-radius: var(--r-pill);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 1.1rem;
}
.lb-close:hover, .lb-prev:hover, .lb-next:hover { background: rgba(255,255,255,0.25); }

.lb-close { top: 24px; right: 24px; width: 42px; height: 42px; font-size: 1.2rem; }
.lb-prev  { left: 24px; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; }
.lb-next  { right: 24px; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; }

.lb-counter {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.6);
  font-size: 0.85rem;
  background: rgba(0,0,0,0.5);
  padding: 6px 16px;
  border-radius: var(--r-pill);
}

@media (max-width: 600px) {
  .lb-prev { left: 8px; }
  .lb-next { right: 8px; }
}
