/* ============================================
   TMKM ALIM '28 SCIENCE STUDY PORTAL — DESIGN SYSTEM v2
   Navy + Gold + Emerald Glassmorphism
   ============================================ */

/* --- DESIGN TOKENS --- */
:root {
  --navy: #1e3a8a;
  --navy-dark: #0f172a;
  --navy-mid: #162d6e;
  --navy-light: #2e4fa3;
  --gold: #f59e0b;
  --gold-light: #fcd34d;
  --gold-dim: rgba(245, 158, 11, 0.18);
  --emerald: #059669;
  --emerald-light: #34d399;
  --emerald-dim: rgba(5, 150, 105, 0.18);
  --danger: #ef4444;
  --danger-dim: rgba(239, 68, 68, 0.15);
  --danger-glow: rgba(239, 68, 68, 0.25);
  --white: #ffffff;
  --slate: #f8fafc;
  --glass-nav: rgba(15, 23, 42, 0.62);
  --glass-card: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-shine: rgba(255, 255, 255, 0.18);
  --surface: #111827;
  --surface-card: rgba(255, 255, 255, 0.06);
  --surface-card-hover: rgba(255, 255, 255, 0.1);
  --surface-glass: rgba(255, 255, 255, 0.06);
  --surface-glass-border: rgba(255, 255, 255, 0.12);
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-accent: #fcd34d;
  --border: rgba(255, 255, 255, 0.12);
  --border-accent: rgba(245, 158, 11, 0.3);
  --accent: #f59e0b;
  --accent-light: #fcd34d;
  --accent-glow: rgba(245, 158, 11, 0.25);
  --primary: #1e3a8a;
  --primary-light: #2e4fa3;
  --primary-dark: #0f172a;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
  --shadow-glow: 0 0 25px rgba(245, 158, 11, 0.1);
  --shadow-card: 0 8px 32px rgba(0,0,0,0.25), 0 0 0 1px rgba(255,255,255,0.05);
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 26px;
  --r-pill: 50px;
  --radius: var(--r-md);
  --radius-sm: var(--r-sm);
  --radius-full: var(--r-pill);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  --font-heading: 'Poppins', 'Hind Siliguri', sans-serif;
  --font-body: 'Poppins', 'Hind Siliguri', sans-serif;
}

/* --- RESET & BASE --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; scroll-padding-top: 80px; }
body {
  font-family: var(--font-body);
  background: #080d1f;
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

/* --- BACKGROUND LAYER --- */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: linear-gradient(180deg, #080d1f 0%, #0c1333 40%, #0a1028 100%);
}
.bg-gradient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 20%, rgba(30,58,138,0.35) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(245,158,11,0.08) 0%, transparent 50%),
    radial-gradient(ellipse 50% 50% at 50% 50%, rgba(5,150,105,0.06) 0%, transparent 60%);
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  animation: float 20s ease-in-out infinite;
}
.orb-1 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(30,58,138,0.5), transparent 70%);
  top: -100px; left: -100px;
  animation-delay: 0s;
}
.orb-2 {
  width: 350px; height: 350px;
  background: radial-gradient(circle, rgba(245,158,11,0.3), transparent 70%);
  bottom: -80px; right: -80px;
  animation-delay: -7s;
}
.orb-3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(5,150,105,0.25), transparent 70%);
  top: 40%; left: 60%;
  animation-delay: -14s;
}
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -20px) scale(1.05); }
  50% { transform: translate(-20px, 30px) scale(0.95); }
  75% { transform: translate(20px, 20px) scale(1.02); }
}

a { color: var(--gold); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold-light); }
img { max-width: 100%; display: block; }
ul { list-style: none; }
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--text);
  line-height: 1.2;
}

/* --- UTILITIES --- */
.container { max-width: 1140px; margin: 0 auto; padding: 0 20px; }
.section { padding: 60px 0; }
.section-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  text-align: center;
  margin-bottom: 12px;
  color: var(--text);
}
.section-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 40px;
  font-size: 0.95rem;
}
.text-center { text-align: center; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

/* --- SCROLL REVEAL --- */
.reveal {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.js-loaded .reveal {
  opacity: 0;
  transform: translateY(30px);
}
.js-loaded .reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* --- NAVIGATION --- */
.navbar {
  position: fixed;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 1000;
  background: var(--glass-nav);
  backdrop-filter: blur(28px) saturate(1.6);
  -webkit-backdrop-filter: blur(28px) saturate(1.6);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-xl);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.06);
  transition: background var(--transition), box-shadow var(--transition);
}
.navbar.scrolled {
  box-shadow: 0 12px 40px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.08);
}
.nav-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
.nav-brand {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Logo image — sized by height, width auto so the real aspect ratio
   of the artwork is preserved (no cropping, no forced square/circle) */
.nav-brand .brand-icon {
  height: 34px;
  width: auto;
  max-width: 120px;
  background: transparent;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}
.nav-brand .brand-icon img {
  height: 100%;
  width: auto;
  object-fit: contain;
  display: block;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  background: none;
  border: none;
  position: relative;
  z-index: 1010;
}
.hamburger span {
  width: 22px;
  height: 2.5px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.35s var(--ease-spring);
  transform-origin: center;
}
.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* === NAV-LINKS: SIBLING of .navbar, NOT a child === */
/* Desktop: positioned to visually sit inside the navbar via fixed positioning.
   Mobile: full-viewport overlay. Neither case is affected by .navbar's backdrop-filter
   because .nav-links is NOT a DOM descendant of .navbar. */
.nav-links {
  position: fixed;
  top: var(--navbar-top, 12px);
  left: 12px;
  right: 12px;
  height: var(--navbar-height, 56px);
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  z-index: 1001; /* above .navbar (1000) so links are clickable */
  pointer-events: none; /* container transparent to clicks */
}
.nav-links a {
  pointer-events: auto; /* links themselves are clickable */
}
.nav-links a {
  color: var(--text-muted);
  padding: 7px 14px;
  border-radius: var(--r-pill);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--transition);
  white-space: nowrap;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--white);
  background: rgba(255,255,255,0.1);
}
.nav-links a.active {
  color: var(--gold);
  background: var(--gold-dim);
}

/* Mobile nav overlay */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.nav-overlay.open { display: block; opacity: 1; }

@media (max-width: 1100px) {
  .navbar {
    top: 12px;
    left: 8px;
    right: 8px;
  }
  .hamburger { display: flex; }
}
/* --- HERO --- */
.hero {
  min-height: 50vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 20px 60px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(245,158,11,0.06) 0%, transparent 70%);
  pointer-events: none;
  animation: hero-glow 8s ease-in-out infinite alternate;
}
@keyframes hero-glow {
  0% { transform: translateX(-50%) scale(1); opacity: 0.6; }
  50% { transform: translateX(-50%) scale(1.15); opacity: 1; }
  100% { transform: translateX(-50%) scale(1); opacity: 0.6; }
}
.hero-content { position: relative; z-index: 1; }
.hero h1 {
  font-size: clamp(2rem, 6vw, 3.5rem);
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--white), var(--gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
}
.hero h1.typing-cursor::after {
  content: '|';
  -webkit-text-fill-color: var(--gold);
  animation: blink 0.7s step-end infinite;
  font-weight: 300;
  margin-left: 2px;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
.hero .tagline {
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 32px;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease 1.4s, transform 0.6s ease 1.4s;
}
.hero.typed .tagline {
  opacity: 1;
  transform: translateY(0);
}
.hero .hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--navy-dark);
  font-weight: 700;
  font-size: 1rem;
  border-radius: var(--r-pill);
  border: none;
  cursor: pointer;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease 1.8s, transform 0.6s ease 1.8s, box-shadow 0.3s var(--ease-spring), color 0.3s var(--ease-spring);
  box-shadow: 0 4px 20px var(--accent-glow);
}
.hero.typed .hero-btn {
  opacity: 1;
  transform: translateY(0);
}
.hero .hero-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 30px var(--accent-glow);
  color: var(--navy-dark);
}

/* Hero particles */
.hero-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.hero-particle {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  animation: particle-float linear infinite;
}
@keyframes particle-float {
  0% { opacity: 0; transform: translateY(0) translateX(0) scale(0.5); }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-100vh) translateX(40px) scale(1.2); }
}

/* Hero animated gradient */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(30,58,138,0.08) 0%,
    rgba(245,158,11,0.04) 25%,
    rgba(5,150,105,0.04) 50%,
    rgba(245,158,11,0.06) 75%,
    rgba(30,58,138,0.08) 100%
  );
  background-size: 300% 300%;
  animation: hero-gradient 12s ease infinite;
  pointer-events: none;
}
@keyframes hero-gradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* --- GLASS CARD BASE --- */
.card {
  background: var(--glass-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  padding: 24px;
  transition: all 0.3s var(--ease-spring);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.card:hover {
  background: var(--surface-card-hover);
  border-color: rgba(245,158,11,0.2);
  box-shadow: 0 8px 32px rgba(0,0,0,0.2), 0 0 20px rgba(245,158,11,0.06);
  transform: translateY(-4px);
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* --- NOTICE / HOMEWORK / UPDATE ITEMS --- */
.list-item {
  background: var(--glass-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  padding: 18px 22px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  transition: all 0.3s var(--ease-spring);
  backdrop-filter: blur(8px);
}
.list-item:hover {
  border-color: rgba(245,158,11,0.2);
  box-shadow: 0 4px 20px rgba(0,0,0,0.15), 0 0 15px rgba(245,158,11,0.05);
}
.list-item-content { flex: 1; }
.list-item-title {
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 4px;
  display: inline;
}
.new-badge {
  display: inline-block;
  background: var(--emerald);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--r-pill);
  vertical-align: middle;
  margin-left: 6px;
  letter-spacing: 0.03em;
  line-height: 1.4;
  box-shadow: 0 0 8px rgba(5,150,105,0.35);
}
.list-item-text { color: var(--text-muted); font-size: 0.92rem; }
.list-item-time { font-size: 0.78rem; color: var(--text-muted); margin-top: 6px; }
.list-item .btn-delete {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px 8px;
  border-radius: var(--r-sm);
  transition: background var(--transition);
  flex-shrink: 0;
}
.list-item .btn-delete:hover { background: rgba(239,68,68,0.12); }

/* --- HOMEWORK TABLE --- */
.hw-table {
  width: 100%;
  border-collapse: collapse;
}
.hw-table th, .hw-table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--glass-border);
}
.hw-table th {
  background: var(--gold-dim);
  color: var(--gold);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.hw-table tr:hover td { background: rgba(245,158,11,0.03); }

/* --- SEARCH BAR --- */
.search-wrap {
  position: relative;
  max-width: 480px;
  margin: 0 auto 32px;
}
.search-wrap input {
  width: 100%;
  padding: 14px 20px 14px 48px;
  background: var(--glass-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-pill);
  color: var(--text);
  font-size: 0.95rem;
  font-family: var(--font-body);
  outline: none;
  transition: all 0.3s var(--ease-spring);
}
.search-wrap input::placeholder { color: var(--text-muted); }
.search-wrap input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 20px var(--accent-glow), 0 0 0 3px rgba(245,158,11,0.08);
}
.search-wrap .search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.1rem;
  transition: color var(--transition);
  z-index: 2;
  pointer-events: none;
  background: transparent;
}
.search-wrap input:focus ~ .search-icon { color: var(--gold); }

/* --- FILTER DROPDOWNS (Custom Select) --- */
.filter-dropdowns {
  position: relative;
  z-index: 10;
  display: flex;
  gap: 16px;
  margin-bottom: 32px;
}
.filter-dropdown-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.filter-dropdown-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.filter-dropdown {
  position: relative;
  z-index: 101;
}
.filter-dropdown-trigger {
  width: 100%;
  padding: 10px 36px 10px 14px;
  background: var(--glass-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  color: var(--text);
  font-size: 0.9rem;
  font-family: var(--font-body);
  cursor: pointer;
  text-align: left;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.filter-dropdown-trigger::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transition: transform 0.25s ease, border-color 0.25s ease;
  pointer-events: none;
}
.filter-dropdown-trigger:hover {
  border-color: rgba(245,158,11,0.35);
}
.filter-dropdown.open .filter-dropdown-trigger {
  border-color: rgba(245,158,11,0.5);
  box-shadow: 0 0 12px rgba(245,158,11,0.1);
}
.filter-dropdown.open .filter-dropdown-trigger::after {
  transform: translateY(-30%) rotate(-135deg);
  border-color: var(--gold);
}
.filter-dropdown-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow-y: auto;
  background: var(--navy-dark);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: all 0.2s ease;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.filter-dropdown-panel::-webkit-scrollbar { width: 5px; }
.filter-dropdown-panel::-webkit-scrollbar-track { background: transparent; }
.filter-dropdown-panel::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 10px; }
.filter-dropdown.open .filter-dropdown-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.filter-dropdown-option {
  padding: 10px 14px;
  font-size: 0.88rem;
  font-family: var(--font-body);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.filter-dropdown-option:last-child { border-bottom: none; }
.filter-dropdown-option:hover {
  background: rgba(245,158,11,0.08);
  color: var(--text);
}
.filter-dropdown-option.selected {
  color: var(--gold);
  font-weight: 600;
  background: rgba(245,158,11,0.1);
}

/* --- FILTER TABS (legacy, used by gallery) --- */
.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 32px;
}
.filter-tab {
  padding: 8px 18px;
  background: var(--glass-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-pill);
  color: var(--text-muted);
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.3s var(--ease-spring);
  font-family: var(--font-body);
}
.filter-tab:hover { border-color: rgba(245,158,11,0.3); color: var(--text); }
.filter-tab.active {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--navy-dark);
  border-color: transparent;
  font-weight: 600;
}

/* --- PORTAL CARDS (Student/Teacher) --- */
.portal-card {
  background: var(--glass-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: all 0.3s var(--ease-spring);
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(8px);
}
.portal-card:hover {
  border-color: rgba(245,158,11,0.25);
  box-shadow: 0 12px 40px rgba(0,0,0,0.25), 0 0 20px rgba(245,158,11,0.08);
  transform: translateY(-6px);
}
.portal-card-photo {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-bottom: 1px solid var(--glass-border);
  transition: transform var(--transition-slow);
}
.portal-card:hover .portal-card-photo { transform: scale(1.03); }
.portal-card-body { padding: 20px; flex: 1; }
.portal-card-name {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  margin-bottom: 4px;
}
.portal-card-detail {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.portal-card-detail span { color: var(--gold); }
.portal-card-phone {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.portal-card-phone a { color: var(--gold); }

/* --- CAPTAIN / ASSISTANT CAPTAIN CARDS --- */
.portal-card.captain {
  position: relative;
  border: 2px solid var(--gold);
  overflow: visible;
  box-shadow:
    0 0 20px rgba(245, 158, 11, 0.25),
    0 0 40px rgba(245, 158, 11, 0.1),
    0 8px 32px rgba(0, 0, 0, 0.3);
  transform: scale(1.02);
}
.portal-card.captain::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--gold), var(--gold-light), var(--gold));
  z-index: -1;
  opacity: 0.5;
}
.portal-card.captain:hover {
  border-color: var(--gold-light);
  box-shadow:
    0 0 30px rgba(245, 158, 11, 0.35),
    0 0 60px rgba(245, 158, 11, 0.15),
    0 12px 40px rgba(0, 0, 0, 0.35);
  transform: scale(1.03) translateY(-4px);
}
.captain-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--navy-dark);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: var(--r-pill);
  margin: 12px 16px 0;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  z-index: 2;
  position: relative;
}

.portal-card.assistant-captain {
  position: relative;
  border: 2px solid var(--emerald);
  overflow: visible;
  box-shadow:
    0 0 16px rgba(5, 150, 105, 0.18),
    0 6px 24px rgba(0, 0, 0, 0.25);
}
.portal-card.assistant-captain::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--emerald), var(--gold), var(--emerald-light));
  z-index: -1;
  opacity: 0.4;
}
.portal-card.assistant-captain:hover {
  border-color: var(--emerald-light);
  box-shadow:
    0 0 24px rgba(5, 150, 105, 0.25),
    0 10px 36px rgba(0, 0, 0, 0.3);
  transform: translateY(-5px);
}
.assistant-captain-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, var(--emerald), var(--emerald-light));
  color: var(--white);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  margin: 12px 16px 0;
  letter-spacing: 0.02em;
  z-index: 2;
  position: relative;
}

/* ═══════════════════════════════════════════════════════════════
   4. ROUTINE CONTAINER (3D Glass)
    ═══════════════════════════════════════════════════════════════ */
    .routine-container {
      background: var(--glass-card);
      border: 1px solid var(--glass-border);
      border-radius: var(--r-xl);
      backdrop-filter: blur(18px) saturate(1.4);
      box-shadow: var(--shadow-card);
      overflow: hidden; /* Ensures rounded corners clip */
      transition: transform 0.3s ease;
      animation: fadeInUp 1s ease 0.2s backwards;
    }

    .routine-header {
      padding: 20px 28px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.08);
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 12px;
    }
    .routine-title {
      display: flex;
      align-items: center;
      gap: 10px;
      font-weight: 700;
      font-size: 1.1rem;
      color: var(--white);
    }
    .routine-title svg { color: var(--gold); }

    .routine-meta {
      font-size: 0.8rem;
      color: rgba(255, 255, 255, 0.50);
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .table-wrapper {
      overflow-x: auto;
      -webkit-overflow-scrolling: touch; /* Smooth scroll on iOS */
    }
    
    /* Custom Scrollbar for table */
    .table-wrapper::-webkit-scrollbar {
      height: 8px;
    }
    .table-wrapper::-webkit-scrollbar-track {
      background: rgba(0, 0, 0, 0.2);
    }
    .table-wrapper::-webkit-scrollbar-thumb {
      background: rgba(255, 255, 255, 0.15);
      border-radius: 4px;
    }
    .table-wrapper::-webkit-scrollbar-thumb:hover {
      background: rgba(255, 255, 255, 0.25);
    }

    /* ═══════════════════════════════════════════════════════════════
       5. ROUTINE TABLE STYLES
    ═══════════════════════════════════════════════════════════════ */
    table {
      width: 100%;
      border-collapse: collapse;
      min-width: 800px; /* Forces horizontal scroll on small screens */
    }

    /* Thead Gradient */
    thead tr {
      background: linear-gradient(90deg, rgba(30, 58, 138, 0.4) 0%, rgba(15, 23, 42, 0.8) 100%);
    }
    th {
      padding: 18px 16px;
      text-align: left;
      font-weight: 700;
      font-size: 0.85rem;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      color: rgba(255, 255, 255, 0.9);
      border-bottom: 1px solid rgba(255, 255, 255, 0.12);
      white-space: nowrap;
    }
    th:first-child { padding-left: 28px; border-radius: var(--r-xl) 0 0 0; }
    th:last-child { padding-right: 28px; }

    /* Tbody Rows */
    tbody tr {
      transition: background 0.2s ease, transform 0.2s ease;
      border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
    
    /* 3D Row Hover Effect */
    tbody tr:hover {
      background: rgba(255, 255, 255, 0.04);
      box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
      transform: scale(1.005); /* Subtle scale */
    }

    td {
      padding: 18px 16px;
      font-size: 0.92rem;
      color: rgba(255, 255, 255, 0.85);
      vertical-align: top;
      font-family: 'Hind Siliguri', sans-serif;
    }
    td:first-child { padding-left: 28px; font-weight: 600; color: var(--white); }
    td:last-child { padding-right: 28px; }

    /* Time Column Styling */
    .time-badge {
      display: inline-block;
      font-size: 0.75rem;
      font-weight: 600;
      color: var(--gold-light);
      background: var(--gold-dim);
      border: 1px solid rgba(245, 158, 11, 0.20);
      padding: 4px 10px;
      border-radius: var(--r-sm);
      margin-bottom: 4px;
    }

    /* Subject Tags/Badges */
    .sub-badge {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 6px 12px;
      border-radius: var(--r-md);
      font-size: 0.85rem;
      font-weight: 600;
      margin-bottom: 4px;
      border: 1px solid transparent;
    }
    
    /* Subject Variations */
    .sub-islamic {
      background: rgba(5, 150, 105, 0.15);
      color: var(--emerald-light);
      border-color: rgba(5, 150, 105, 0.3);
    }
    .sub-general {
      background: rgba(30, 58, 138, 0.25);
      color: #93c5fd;
      border-color: rgba(30, 58, 138, 0.4);
    }
    .sub-science {
      background: rgba(236, 72, 153, 0.12);
      color: #f9a8d4;
      border-color: rgba(236, 72, 153, 0.25);
    }
    .sub-lang {
      background: var(--gold-dim);
      color: var(--gold-light);
      border-color: rgba(245, 158, 11, 0.25);
    }
    
    .teacher-name {
      display: block;
      font-size: 0.75rem;
      color: rgba(255, 255, 255, 0.45);
      font-weight: 500;
      margin-top: 2px;
    }

/* --- MATERIAL CARDS --- */
.material-card {
  background: var(--glass-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  padding: 24px;
  transition: all 0.3s var(--ease-spring);
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(8px);
  position: relative;
  z-index: 1;
}
.material-card:hover {
  border-color: rgba(245,158,11,0.2);
  box-shadow: 0 8px 32px rgba(0,0,0,0.2), 0 0 15px rgba(245,158,11,0.06);
  transform: translateY(-4px);
}
.material-tag {
  display: inline-block;
  padding: 4px 12px;
  background: var(--gold-dim);
  color: var(--gold);
  border-radius: var(--r-pill);
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 12px;
  width: fit-content;
}
.material-tag-type {
  background: var(--emerald-dim);
  color: var(--emerald-light);
  margin-left: 6px;
}
.material-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  margin-bottom: 8px;
  display: inline;
}
.material-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  flex: 1;
  margin-bottom: 16px;
}
.material-price {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 14px;
}
.material-price small {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* --- BOOKMARK --- */
.bookmark-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  z-index: 2;
  transition: all 0.2s ease;
  line-height: 1;
}
.bookmark-btn svg {
  width: 22px;
  height: 22px;
  stroke: rgba(255,255,255,0.3);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: all 0.2s ease;
}
.bookmark-btn:hover svg {
  stroke: var(--gold);
  transform: scale(1.15);
}
.bookmark-btn.active svg {
  stroke: var(--gold);
  fill: var(--gold);
  filter: drop-shadow(0 0 6px rgba(245,158,11,0.5));
}

/* Saved-only toggle */
.saved-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.saved-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--glass-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-pill);
  padding: 8px 16px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.2s ease;
  white-space: nowrap;
}
.saved-toggle:hover {
  border-color: rgba(245,158,11,0.2);
  color: var(--gold);
}
.saved-toggle.active {
  background: var(--gold-dim);
  border-color: rgba(245,158,11,0.35);
  color: var(--gold);
}
.saved-toggle svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.saved-toggle.active svg {
  fill: var(--gold);
  filter: drop-shadow(0 0 4px rgba(245,158,11,0.4));
}
.saved-count {
  background: rgba(245,158,11,0.15);
  color: var(--gold);
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: var(--r-pill);
  min-width: 18px;
  text-align: center;
}

/* --- GALLERY --- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}
.gallery-item {
  position: relative;
  border-radius: var(--r-md);
  overflow: hidden;
  aspect-ratio: 4/3;
  cursor: pointer;
  border: 1px solid var(--glass-border);
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}
.gallery-item:hover img { transform: scale(1.08); }
.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(8,13,31,0.7) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--transition);
}
.gallery-item:hover::after { opacity: 1; }
.gallery-item:hover {
  border-color: rgba(245,158,11,0.25);
  box-shadow: 0 0 30px var(--accent-glow);
}

/* --- LIGHTBOX --- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,0.92);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.lightbox.open { opacity: 1; pointer-events: all; }
.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: var(--r-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  transform: scale(0.9);
  transition: transform var(--transition);
}
.lightbox.open img { transform: scale(1); }
.lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  transition: all var(--transition);
}
.lightbox-close:hover { background: rgba(255,255,255,0.2); }

/* --- ABOUT STATS --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 20px;
  margin-bottom: 48px;
}
.stat-card {
  text-align: center;
  padding: 32px 20px;
  background: var(--glass-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  transition: all 0.3s var(--ease-spring);
  backdrop-filter: blur(8px);
}
.stat-card:hover {
  border-color: rgba(245,158,11,0.2);
  box-shadow: 0 8px 32px rgba(0,0,0,0.2), 0 0 15px rgba(245,158,11,0.06);
  transform: translateY(-4px);
}
.stat-number {
  font-family: var(--font-heading);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 8px;
}
.stat-label {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* --- CONTACT --- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
@media (max-width: 768px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-links { display: flex; flex-direction: column; gap: 14px; }
.contact-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--glass-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  color: var(--text);
  transition: all 0.3s var(--ease-spring);
  backdrop-filter: blur(8px);
}
.contact-link:hover {
  border-color: rgba(245,158,11,0.2);
  box-shadow: 0 4px 20px rgba(0,0,0,0.15), 0 0 15px rgba(245,158,11,0.05);
  transform: translateX(4px);
  color: var(--text);
}
.contact-link .icon { font-size: 1.3rem; flex-shrink: 0; }
.ai-block {
  background: var(--glass-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--r-lg);
  padding: 32px;
  text-align: center;
  margin-top: 24px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(8px);
}
.ai-block::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(245,158,11,0.05) 0%, transparent 60%);
  pointer-events: none;
}

/* --- FORMS --- */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 500;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: 0.95rem;
  font-family: var(--font-body);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 12px var(--accent-glow), 0 0 0 3px rgba(245,158,11,0.06);
}
.form-group select { cursor: pointer; }
.form-group textarea { resize: vertical; min-height: 100px; }

/* Animated moving-light border on all inputs */
.form-group input,
.form-group select,
.form-group textarea {
  position: relative;
  background: var(--surface);
  border: 1.5px solid rgba(255,255,255,0.06);
  transition: border-color 0.3s, box-shadow 0.3s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: transparent;
  box-shadow: none;
  animation: input-glow-rotate 3s linear infinite;
}
@keyframes input-glow-rotate {
  0%   { box-shadow: 0 0 0 2px var(--gold), 0 0 12px var(--accent-glow); }
  25%  { box-shadow: 0 0 0 2px #059669, 0 0 12px rgba(5,150,105,0.3); }
  50%  { box-shadow: 0 0 0 2px var(--gold), 0 0 12px var(--accent-glow); }
  75%  { box-shadow: 0 0 0 2px #059669, 0 0 12px rgba(5,150,105,0.3); }
  100% { box-shadow: 0 0 0 2px var(--gold), 0 0 12px var(--accent-glow); }
}
.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
  border-color: rgba(245,158,11,0.3);
}

/* Contact reason box styles */
.contact-reason-box {
  padding: 12px 16px;
  border-radius: var(--r-sm);
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 14px;
  animation: fadeIn 0.3s ease;
}
.reason-danger {
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.3);
  color: #f87171;
}
.reason-ok {
  background: rgba(5,150,105,0.12);
  border: 1px solid rgba(5,150,105,0.3);
  color: #34d399;
}

/* Material card access note */
.material-access-note {
  font-size: 0.82rem;
  color: #f87171;
  margin-top: 6px;
  font-weight: 500;
}

/* Admin owner warning */
.admin-owner-warning {
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.3);
  color: #f87171;
  padding: 14px 20px;
  border-radius: var(--r-md);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 24px;
  text-align: center;
}

/* Brand icon image sizing */
.nav-brand .brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  object-fit: contain;
  flex-shrink: 0;
}
.nav-brand .brand-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* --- BUTTONS --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font-body);
  border-radius: var(--r-pill);
  border: none;
  cursor: pointer;
  transition: all 0.3s var(--ease-spring);
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--navy-dark);
  box-shadow: 0 4px 15px var(--accent-glow);
}
.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 25px var(--accent-glow);
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--gold);
}
.btn-outline:hover {
  background: var(--gold-dim);
  border-color: rgba(245,158,11,0.3);
  box-shadow: 0 0 20px rgba(245,158,11,0.08);
}
.btn-danger {
  background: #ef4444;
  color: #fff;
}
.btn-danger:hover { background: #dc2626; }
.btn-success {
  background: var(--emerald);
  color: #fff;
}
.btn-success:hover { background: #047857; }
.btn-sm { padding: 8px 18px; font-size: 0.85rem; }
.btn-block { width: 100%; }

/* --- ADMIN PANEL --- */
.admin-login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.admin-login-card {
  background: var(--glass-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-xl);
  padding: 48px 40px;
  text-align: center;
  max-width: 420px;
  width: 100%;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-card);
}
.admin-login-card h2 { margin-bottom: 8px; }
.admin-login-card p { color: var(--text-muted); margin-bottom: 28px; }
.admin-welcome {
  padding: 16px 24px;
  background: var(--gold-dim);
  border-radius: var(--r-sm);
  margin-bottom: 24px;
  color: var(--gold);
  font-weight: 500;
}
.admin-section {
  background: var(--glass-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  padding: 28px;
  margin-bottom: 24px;
  backdrop-filter: blur(8px);
}
.admin-section h3 {
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--glass-border);
  color: var(--gold);
}
.admin-form-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  align-items: flex-end;
}
.admin-form-row .form-group { flex: 1; margin-bottom: 0; }
.admin-form-row .btn { flex-shrink: 0; }
.hw-admin-row {
  display: grid;
  grid-template-columns: 200px 1fr auto;
  gap: 12px;
  margin-bottom: 10px;
  align-items: center;
}
@media (max-width: 600px) {
  .hw-admin-row { grid-template-columns: 1fr; }
}

/* --- BANNER --- */
.info-banner {
  background: var(--gold-dim);
  border: 1px solid var(--border-accent);
  border-radius: var(--r-md);
  padding: 18px 24px;
  margin-bottom: 32px;
  text-align: center;
  color: var(--text);
}
.info-banner strong { color: var(--gold); }
.info-banner a { color: var(--gold); text-decoration: underline; }

/* --- FOOTER --- */
.footer {
  padding: 40px 0 24px;
  border-top: 1px solid var(--glass-border);
  margin-top: 60px;
  text-align: center;
}
.footer p { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 8px; }
.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}
.footer-links a { color: var(--text-muted); font-size: 0.85rem; }
.footer-links a:hover { color: var(--gold); }

/* --- EMPTY STATE --- */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 12px; }

/* --- PAGE HEADER --- */
.page-header {
  padding: 100px 20px 40px;
  text-align: center;
}
.page-header h1 {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  margin-bottom: 8px;
}
.page-header p { color: var(--text-muted); max-width: 600px; margin: 0 auto; }

/* --- SCROLLBAR --- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #080d1f; }
::-webkit-scrollbar-thumb { background: var(--navy-mid); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* --- TOAST --- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--glass-card);
  border: 1px solid var(--border-accent);
  padding: 14px 28px;
  border-radius: var(--r-pill);
  color: var(--text);
  font-size: 0.9rem;
  z-index: 3000;
  box-shadow: var(--shadow);
  transition: transform 0.3s var(--ease-spring);
  backdrop-filter: blur(16px);
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.error { border-color: #ef4444; color: #ef4444; }

/* --- PENDING BADGE --- */
.pending-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  background: #ef4444;
  color: #fff;
  border-radius: var(--r-pill);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0 6px;
  margin-left: 8px;
  vertical-align: middle;
}

/* --- ROUTINE EDITOR (Admin) --- */
.routine-admin-grid {
  display: grid;
  gap: 16px;
}
.routine-day-block {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  padding: 16px;
}
.routine-day-block h4 {
  color: var(--gold);
  margin-bottom: 12px;
  font-size: 0.95rem;
}
.routine-period-row {
  display: grid;
  grid-template-columns: 90px 1fr 130px 1fr;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}
@media (max-width: 700px) {
  .routine-period-row { grid-template-columns: 1fr 1fr; }
}
.routine-period-row input,
.routine-period-row select {
  width: 100%;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: 0.82rem;
  font-family: var(--font-body);
  outline: none;
}
.routine-period-row input:focus,
.routine-period-row select:focus {
  border-color: var(--gold);
}

/* --- ROUTINE PAGE — Visual Redesign --- */
.routine-eyebrow {
  display: inline-block;
  padding: 6px 16px;
  background: var(--gold-dim);
  border: 1px solid var(--border-accent);
  border-radius: var(--r-pill);
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}
.routine-container {
  background: var(--glass-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-xl);
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.routine-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 28px;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(245, 158, 11, 0.03);
}
.routine-header-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
}
.routine-header-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}
.routine-header-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
}
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table-wrapper::-webkit-scrollbar { height: 6px; }
.table-wrapper::-webkit-scrollbar-track { background: rgba(255,255,255,0.02); }
.table-wrapper::-webkit-scrollbar-thumb { background: var(--navy-mid); border-radius: 3px; }
.table-wrapper::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* Time badge — pill-shaped time display per cell */
.time-badge {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--r-pill);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.3px;
  white-space: nowrap;
}

/* Sub-badge — subject category variants (strict navy/gold/emerald palette) */
.sub-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}
.sub-badge:hover { transform: scale(1.03); filter: brightness(1.1); }
.sub-islamic {
  background: rgba(5, 150, 105, 0.15);
  color: var(--emerald-light);
  border-left: 2px solid var(--emerald);
}
.sub-lang {
  background: rgba(245, 158, 11, 0.15);
  color: var(--gold-light);
  border-left: 2px solid var(--gold);
}
.sub-science {
  background: rgba(46, 79, 163, 0.18);
  color: #93a5e8;
  border-left: 2px solid var(--navy-light);
}
.sub-general {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border-left: 2px solid rgba(255, 255, 255, 0.2);
}

/* Teacher name — small subtext under subject badge */
.teacher-name {
  margin-top: 4px;
  font-size: 0.75rem;
  font-style: italic;
}
.teacher-name a {
  color: var(--text-muted);
  transition: color var(--transition);
  text-decoration: none;
}
.teacher-name a:hover { color: var(--gold); }

/* Row hover — subtle scale + inset highlight */
.routine-table tbody tr:hover td {
  background: rgba(245, 158, 11, 0.04);
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.08);
}
.routine-table tbody tr {
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

/* --- ROUTINE GRID — Days as ROWS, Periods as COLUMNS --- */
.routine-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 6px;
  min-width: 900px; /* forces horizontal scroll on mobile */
}

/* Period header row */
.routine-period-header {
  padding: 12px 14px;
  text-align: center;
  background: linear-gradient(180deg, rgba(30, 58, 138, 0.35) 0%, rgba(15, 23, 42, 0.6) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--r-md);
  vertical-align: bottom;
}
.routine-period-num {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.routine-period-time {
  display: block;
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 400;
  white-space: nowrap;
}

/* Day column header (top-left corner) */
.routine-day-col-header {
  background: transparent;
  border: none;
  min-width: 90px;
}

/* Day row header (left side, sticky on scroll) */
.routine-day-cell {
  position: sticky;
  left: 0;
  z-index: 2;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--r-md);
  padding: 14px 12px;
  text-align: center;
  vertical-align: middle;
  min-width: 90px;
}
.routine-day-label {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1.2;
}
.routine-day-full {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 2px;
  letter-spacing: 0.02em;
}

/* Data cell — glass card box */
.routine-cell {
  background: var(--glass-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  padding: 12px 10px;
  vertical-align: top;
  min-width: 120px;
  transition: all 0.25s var(--ease-spring);
}
.routine-cell:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(245, 158, 11, 0.18);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 0 12px rgba(245, 158, 11, 0.05);
}

/* Empty cell */
.routine-cell-empty {
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.06);
  min-height: 80px;
}

/* Subject badge inside cell */
.routine-sub-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--r-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  border-left: 3px solid transparent;
}
.routine-sub-badge:hover {
  transform: scale(1.04);
  filter: brightness(1.1);
}
.routine-sub-badge.sub-islamic {
  background: rgba(5, 150, 105, 0.15);
  color: var(--emerald-light);
  border-left-color: var(--emerald);
}
.routine-sub-badge.sub-lang {
  background: rgba(245, 158, 11, 0.15);
  color: var(--gold-light);
  border-left-color: var(--gold);
}
.routine-sub-badge.sub-science {
  background: rgba(46, 79, 163, 0.18);
  color: #93a5e8;
  border-left-color: var(--navy-light);
}
.routine-sub-badge.sub-general {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border-left-color: rgba(255, 255, 255, 0.2);
}

/* Time inside cell */
.routine-cell-time {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 4px;
  letter-spacing: 0.3px;
}

/* Teacher name inside cell */
.routine-teacher {
  margin-top: 6px;
  font-size: 0.72rem;
  font-style: italic;
}
.routine-teacher a {
  color: rgba(255, 255, 255, 0.45);
  text-decoration: none;
  transition: color var(--transition);
}
.routine-teacher a:hover {
  color: var(--gold);
}

/* Day row hover */
.routine-day-row:hover .routine-cell:not(.routine-cell-empty) {
  background: rgba(245, 158, 11, 0.04);
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.06);
}
.routine-day-row {
  transition: background 0.2s ease;
}

/* Today highlight */
.routine-day-today .routine-cell:not(.routine-cell-empty) {
  background: rgba(245, 158, 11, 0.06);
  border-color: rgba(245, 158, 11, 0.2);
}
.routine-day-cell-today {
  background: rgba(245, 158, 11, 0.12) !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.15), inset 0 0 12px rgba(245, 158, 11, 0.06);
}
.routine-day-cell-today .routine-day-label {
  color: var(--gold-light);
}
.routine-day-cell-today .routine-day-full {
  color: rgba(255, 255, 255, 0.6);
}
.routine-cell-today {
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.08);
}
.today-badge {
  display: inline-block;
  background: var(--gold);
  color: #0f172a;
  font-size: 0.55rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--r-pill);
  vertical-align: middle;
  margin-left: 4px;
  letter-spacing: 0.03em;
  line-height: 1.4;
}

/* ============================================
   MOBILE RESPONSIVENESS — PRIORITY: MOBILE-FIRST
   ============================================ */

/* Global mobile fixes */
@media (max-width: 768px) {
  body { overflow-x: hidden; }
  html { overflow-x: hidden; }
  img { max-width: 100%; height: auto; }
  table { max-width: 100%; }
  
  /* Container */
  .container { padding: 0 16px; }
  
  /* Page header */
  .page-header { padding: 80px 16px 28px; }
  .page-header h1 { font-size: clamp(1.4rem, 6vw, 2rem); }
  .page-header p { font-size: 0.88rem; }
  
  /* Sections */
  .section { padding: 40px 0; }
  .section-title { font-size: clamp(1.3rem, 5vw, 1.8rem); }
  
  /* Cards */
  .card { padding: 18px; border-radius: var(--r-md); }
  .card-grid { grid-template-columns: 1fr; gap: 14px; }
  
  /* Hero */
  .hero { min-height: 40vh; padding: 90px 16px 40px; }
  .hero h1 { font-size: clamp(1.6rem, 7vw, 2.5rem); }
  .hero .tagline { font-size: 0.92rem; }
  .hero-btn { padding: 12px 24px; font-size: 0.9rem; }
  
  /* Stats grid */
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .stat-card { padding: 20px 14px; }
  .stat-number { font-size: 1.8rem; }
  .stat-label { font-size: 0.8rem; }
  
  /* Portal cards */
  .portal-card { border-radius: var(--r-md); }
  .portal-card-body { padding: 14px; }
  .portal-card-name { font-size: 1rem; }
  .portal-card-detail { font-size: 0.82rem; }
  
  /* Material cards */
  .material-card { padding: 18px; border-radius: var(--r-md); }
  .material-title { font-size: 0.98rem; }
  .material-desc { font-size: 0.84rem; }
  
  /* Gallery */
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .gallery-item { aspect-ratio: 1; }
  
  /* Filter dropdowns */
  .filter-dropdowns { flex-direction: column; gap: 12px; }
  .filter-dropdown-trigger { padding: 10px 36px 10px 14px; font-size: 0.88rem; }
  .saved-toggle-wrap { width: 100%; }
  .saved-toggle { width: 100%; justify-content: center; }

  /* Filter tabs (legacy) */
  .filter-tabs { gap: 6px; margin-bottom: 20px; }
  .filter-tab { padding: 6px 14px; font-size: 0.82rem; }
  
  /* Contact */
  .contact-grid { grid-template-columns: 1fr; gap: 24px; }
  .contact-link { padding: 12px 16px; font-size: 0.88rem; }
  
  /* Admin */
  .admin-login-card { padding: 32px 20px; }
  .admin-section { padding: 18px; }
  .admin-form-row { flex-direction: column; gap: 8px; }
  .admin-form-row .form-group { width: 100%; }
  
  /* Footer */
  .footer { padding: 28px 0 16px; margin-top: 40px; }
  .footer p { font-size: 0.78rem; }
  .footer-links { gap: 12px; }
  .footer-links a { font-size: 0.78rem; }
  
  /* Buttons */
  .btn { padding: 10px 20px; font-size: 0.88rem; }
  .btn-sm { padding: 7px 14px; font-size: 0.82rem; }
  
  /* List items */
  .list-item { padding: 14px 16px; gap: 12px; }
  .list-item-title { font-size: 0.92rem; }
  .list-item-text { font-size: 0.84rem; }
  
  /* Info banner */
  .info-banner { padding: 14px 18px; font-size: 0.84rem; margin-bottom: 20px; }
  
  /* Search */
  .search-wrap { margin-bottom: 20px; }
  .search-wrap input { padding: 12px 16px 12px 42px; font-size: 0.88rem; }
  .search-wrap .search-icon { left: 14px; font-size: 1rem; }
  
  /* Tables */
  .hw-table { font-size: 0.82rem; }
  .hw-table th, .hw-table td { padding: 10px 12px; }
  
  /* Routine page mobile */
  .routine-container { border-radius: var(--r-lg); }
  .routine-header { padding: 16px 18px; gap: 10px; }
  .routine-header-icon { font-size: 1.3rem; }
  .routine-header-title { font-size: 1rem; }
  .routine-header-meta { font-size: 0.75rem; }
  .sub-badge { font-size: 0.72rem; padding: 2px 8px; }
  .time-badge { font-size: 0.65rem; padding: 2px 6px; }
  .teacher-name { font-size: 0.7rem; }
  
  /* Form groups */
  .form-group { margin-bottom: 14px; }
  .form-group label { font-size: 0.82rem; margin-bottom: 4px; }
  .form-group input, .form-group select, .form-group textarea { padding: 10px 12px; font-size: 0.88rem; }
  
  /* Toast */
  .toast { bottom: 16px; font-size: 0.82rem; padding: 12px 20px; }
}

/* Small mobile (360px-400px) */
@media (max-width: 400px) {
  .nav-inner { height: 50px; padding: 0 16px; }
  .nav-brand { font-size: 1.05rem; gap: 6px; }
  .nav-brand .brand-icon { width: 28px; height: 28px; }
  
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { padding: 16px 10px; }
  .stat-number { font-size: 1.5rem; }
  
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  
  .hero { padding: 80px 12px 32px; }
  .hero h1 { font-size: 1.5rem; }
  .hero-btn { padding: 10px 20px; font-size: 0.85rem; }
}

/* Nav mobile overlay improvements */
@media (max-width: 1100px) {
  .nav-links {
    position: fixed;
    top: var(--navbar-bottom, 80px); /* set by nav.js after measuring navbar */
    left: 0;
    right: 0;
    bottom: 0;
    height: auto; /* OVERRIDE: base rule sets height:var(--navbar-height,56px) which clips mobile panel to navbar height */
    background: rgba(8, 13, 31, 0.98);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 16px 16px 24px;
    gap: 0;
    z-index: 1001;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-12px);
    transition: all 0.35s var(--ease-spring);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .nav-links.open {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
  }
  .nav-links:not(.open) a {
    pointer-events: none;
  }
  .nav-links-primary {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
  .nav-links-divider {
    width: min(200px, 50vw);
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 8px 0;
  }
  .nav-links-secondary {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }
  .nav-links a {
    width: min(320px, 85vw);
    padding: 16px 24px;
    font-size: 1.05rem;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.35s var(--ease-spring);
    border-radius: var(--r-sm);
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }
  .nav-links a .nav-link-icon {
    font-size: 1.1rem;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
  }
  .nav-links a.nav-link-secondary {
    width: min(200px, 65vw);
    padding: 8px 16px;
    font-size: 0.82rem;
    background: rgba(255,255,255,0.03);
    border-color: rgba(255,255,255,0.04);
  }
  .nav-links.open a { opacity: 1; transform: translateY(0); }
  .nav-links-primary a:nth-child(1) { transition-delay: 0.05s; }
  .nav-links-primary a:nth-child(2) { transition-delay: 0.1s; }
  .nav-links-primary a:nth-child(3) { transition-delay: 0.15s; }
  .nav-links-primary a:nth-child(4) { transition-delay: 0.2s; }
  .nav-links-primary a:nth-child(5) { transition-delay: 0.25s; }
  .nav-links-primary a:nth-child(6) { transition-delay: 0.3s; }
  .nav-links-primary a:nth-child(7) { transition-delay: 0.35s; }
  .nav-links-primary a:nth-child(8) { transition-delay: 0.4s; }
  .nav-links-primary a:nth-child(9) { transition-delay: 0.45s; }
  .nav-links-primary a:nth-child(10) { transition-delay: 0.5s; }
  .nav-links-secondary a:nth-child(1) { transition-delay: 0.55s; }
}

/* ============================================
   MICRO-INTERACTIONS — Card shine sweep, cursor, reduced-motion
   ============================================ */

/* Shine sweep effect on glass cards */
.card,
.portal-card,
.material-card,
.stat-card,
.list-item,
.contact-link,
.ai-block,
.admin-section {
  position: relative;
  overflow: hidden;
}
.card::after,
.portal-card::after,
.material-card::after,
.stat-card::after,
.list-item::after,
.contact-link::after,
.ai-block::after,
.admin-section::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.04) 40%,
    rgba(255,255,255,0.08) 50%,
    rgba(255,255,255,0.04) 60%,
    transparent 100%
  );
  transition: left 0.6s ease;
  pointer-events: none;
  z-index: 1;
}
.card:hover::after,
.portal-card:hover::after,
.material-card:hover::after,
.stat-card:hover::after,
.list-item:hover::after,
.contact-link:hover::after,
.ai-block:hover::after,
.admin-section:hover::after {
  left: 120%;
}

/* Smooth hover transitions for all clickable elements */
a, button, .filter-dropdown-trigger, .filter-tab, .portal-tab, .subject-badge, .gallery-item,
.list-item, .card, .portal-card, .material-card, .stat-card,
.contact-link, .search-wrap input, .btn {
  transition: all 0.25s var(--ease-spring);
}

/* Cursor pointer on all interactive elements */
button, a, .filter-dropdown-trigger, .filter-tab, .portal-tab, .subject-badge, .gallery-item,
.hamburger, .lightbox-close,
input[type="text"], input[type="tel"], input[type="url"],
select, textarea {
  cursor: pointer;
}
input[type="text"]:read-only,
input[type="tel"]:read-only,
input[type="url"]:read-only {
  cursor: default;
}

/* ============================================
   PREFERS-REDUCED-MOTION — Kill animations for motion-sensitive users
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal,
  .js-loaded .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .hero h1.typing-cursor::after {
    animation: none;
    content: none;
  }
  .hero .tagline,
  .hero .hero-btn,
  .hero.typed .tagline,
  .hero.typed .hero-btn {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .hero-particle {
    display: none;
  }
  .card::after,
  .portal-card::after,
  .material-card::after,
  .stat-card::after,
  .list-item::after,
  .contact-link::after,
  .ai-block::after,
  .admin-section::after {
    display: none;
  }
}

/* ============================================
   LANDING PAGE — 8 Full-Viewport Sections
   ============================================ */

/* --- BASE --- */
.landing-page { overflow-x: hidden; }
.lp-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 100px 24px 60px;
  position: relative;
  overflow: hidden;
}

/* --- REVEAL ANIMATION --- */
.lp-section {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s var(--ease-spring), transform 0.6s var(--ease-spring);
}
.lp-section.lp-visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- SECTION 1: HERO --- */
.lp-hero {
  flex-direction: column;
  text-align: center;
  padding-top: 120px;
}
.lp-hero-content { position: relative; z-index: 1; }
.lp-eyebrow {
  display: inline-block;
  padding: 6px 18px;
  background: var(--gold-dim);
  border: 1px solid var(--border-accent);
  border-radius: var(--r-pill);
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 20px;
}
.lp-hero-title {
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 800;
  background: linear-gradient(135deg, var(--white), var(--gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
  line-height: 1.1;
}
.lp-hero-tagline {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 32px;
  line-height: 1.7;
}
.lp-scroll-cue {
  margin-top: 48px;
  color: var(--text-muted);
  font-size: 0.82rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.lp-scroll-chevron {
  font-size: 1.5rem;
  animation: lp-bounce 2s ease-in-out infinite;
}
@keyframes lp-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}
.lp-credit {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  color: rgba(255,255,255,0.25);
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* --- BUTTONS --- */
.lp-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: var(--r-pill);
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-body);
  text-decoration: none;
  transition: all 0.3s var(--ease-spring);
  cursor: pointer;
  border: none;
}
.lp-btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--navy-dark);
  box-shadow: 0 4px 20px var(--accent-glow);
}
.lp-btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 30px var(--accent-glow);
  color: var(--navy-dark);
}
.lp-btn-outline {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--gold);
}
.lp-btn-outline:hover {
  background: var(--gold-dim);
  border-color: rgba(245,158,11,0.3);
  box-shadow: 0 0 20px rgba(245,158,11,0.08);
}
.lp-btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--navy-dark);
  box-shadow: 0 4px 20px var(--accent-glow);
}
.lp-btn-gold:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 30px var(--accent-glow);
  color: var(--navy-dark);
}
.lp-btn-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* --- FEATURE SECTIONS --- */
.lp-feature-inner {
  max-width: 1000px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 60px;
}
.lp-feature-reverse { flex-direction: row-reverse; }
.lp-feature-text { flex: 1; }
.lp-feature-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
}
.lp-feature-text h2 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  margin-bottom: 12px;
  color: var(--text);
}
.lp-feature-text p {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 24px;
}
.lp-coming-soon-badge {
  display: inline-block;
  padding: 4px 14px;
  background: var(--gold-dim);
  border: 1px solid var(--border-accent);
  border-radius: var(--r-pill);
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 12px;
}

/* --- MOCK CARDS (Visual Previews) --- */
.lp-feature-visual {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 200px;
}

/* Portal mock */
.lp-mock-card {
  background: var(--glass-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 220px;
  backdrop-filter: blur(8px);
}
.lp-mock-offset { transform: translate(30px, 20px); }
.lp-mock-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-dim), rgba(5,150,105,0.15));
  border: 1px solid var(--glass-border);
  flex-shrink: 0;
}
.lp-mock-lines { flex: 1; }
.lp-mock-line {
  height: 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.08);
  margin-bottom: 6px;
}
.lp-mock-line-long { width: 100%; }
.lp-mock-line-short { width: 60%; }

/* Routine mock */
.lp-mock-routine {
  display: grid;
  grid-template-columns: 60px repeat(3, 1fr);
  gap: 6px;
  width: 260px;
}
.lp-mock-rh {
  background: rgba(245,158,11,0.15);
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: var(--r-sm);
  height: 28px;
}
.lp-mock-rc {
  background: var(--glass-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-sm);
  height: 44px;
}
.lp-mock-rd {
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.12);
  border-radius: var(--r-sm);
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  color: var(--gold);
  font-weight: 600;
}

/* Materials mock */
.lp-mock-stack {
  position: relative;
  width: 200px;
  height: 160px;
}
.lp-mock-book {
  position: absolute;
  width: 160px;
  height: 40px;
  border-radius: var(--r-sm);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(8px);
}
.lp-mock-book-1 {
  background: rgba(5,150,105,0.12);
  top: 0;
  left: 0;
}
.lp-mock-book-2 {
  background: rgba(245,158,11,0.12);
  top: 50px;
  left: 10px;
}
.lp-mock-book-3 {
  background: rgba(30,58,138,0.15);
  top: 100px;
  left: 20px;
}

/* Gallery mosaic */
.lp-mosaic {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 240px;
}
.lp-mosaic-placeholder {
  aspect-ratio: 1;
  background: var(--glass-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
}
.lp-mosaic-item {
  aspect-ratio: 1;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--glass-border);
}
.lp-mosaic-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- CTA SECTION --- */
.lp-cta {
  text-align: center;
}
.lp-cta-inner {
  max-width: 600px;
}
.lp-cta-inner h2 {
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--white), var(--gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.lp-cta-inner p {
  color: var(--text-muted);
  margin-bottom: 32px;
  font-size: 1.05rem;
}
.lp-cta-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
}

/* --- ADMIN SECTION --- */
.lp-admin {
  text-align: center;
}
.lp-admin-inner {
  max-width: 600px;
}
.lp-admin-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
}
.lp-admin-inner h2 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  margin-bottom: 12px;
}
.lp-admin-inner p {
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.7;
}
.lp-admin-cta {
  color: var(--text) !important;
  font-size: 1rem !important;
}
.lp-admin-cta strong { color: var(--gold); }

/* ============================================
   LANDING PAGE — MOBILE RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .lp-section {
    min-height: auto;
    padding: 80px 20px 60px;
  }
  .lp-feature-inner,
  .lp-feature-reverse {
    flex-direction: column;
    gap: 32px;
    text-align: center;
  }
  .lp-feature-visual { width: 100%; }
  .lp-cta-buttons { flex-direction: column; align-items: center; }
  .lp-btn { width: 100%; max-width: 300px; justify-content: center; }
  .lp-hero { padding-top: 100px; }
  .lp-credit { position: static; margin-top: 40px; transform: none; }
}
@media (max-width: 480px) {
  .lp-hero-title { font-size: 2.2rem; }
  .lp-mock-card { width: 180px; padding: 14px; }
  .lp-mock-routine { width: 200px; grid-template-columns: 40px repeat(3, 1fr); }
  .lp-mosaic { width: 200px; }
}

/* ============================================
   AD BANNERS — CONTAINERS (Sitewide Containment)
   Every ad container gets explicit reserved dimensions,
   overflow containment, and CSS containment to prevent
   layout collapse/overlap when ads load asynchronously.
   ============================================ */
.ad-banner-wrap {
  text-align: center;
  min-height: 250px;
}
.ad-banner-section {
  text-align: center;
  padding: 20px 0;
  position: relative;
}

/* --- Base ad container styles (shared) --- */
.ad-banner-section .ad-desktop,
.ad-banner-section .ad-mobile {
  position: relative;
  overflow: hidden;
  contain: layout paint;
  box-sizing: border-box;
}

/* Desktop: 300x250 or 728x90 — reserved space BEFORE ad loads */
.ad-banner-section .ad-desktop {
  display: block;
  min-height: 250px;
  min-width: 300px;
}

/* Mobile: 320x50 — reserved space BEFORE ad loads */
.ad-banner-section .ad-mobile {
  display: none;
  min-height: 50px;
  min-width: 320px;
}

/* Responsive swap */
@media (max-width: 768px) {
  .ad-banner-section .ad-desktop { display: none; }
  .ad-banner-section .ad-mobile { display: block; }
}

/* --- 728x90 desktop variant (routine.html, main.html) --- */
.ad-banner-section .ad-desktop[style*="min-height:90px"],
.ad-banner-section .ad-desktop[style*="min-height: 90px"] {
  min-height: 90px;
  min-width: 728px;
}

/* --- 300x250 desktop variant (most pages) --- */
.ad-banner-section .ad-desktop[style*="min-height:250px"],
.ad-banner-section .ad-desktop[style*="min-height: 250px"] {
  min-height: 250px;
  min-width: 300px;
}

/* --- Native ad card (materials grid injection) --- */
.ad-native-card {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  padding: 8px 0;
  overflow: hidden;
  position: relative;
  z-index: 0;
  contain: layout paint;
  min-height: 120px;
}

/* ============================================
   MATERIAL CARD — BUTTONS
   ============================================ */
.material-btns {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
  position: relative;
  z-index: 2;
}
.material-btns .btn {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  font-size: 0.82rem;
  padding: 10px 14px;
  white-space: nowrap;
}

/* ============================================
   VIEWER PAGE
   ============================================ */
.viewer-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 100px 24px 60px;
}
.viewer-notice {
  background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: var(--r-md);
  padding: 12px 18px;
  color: var(--gold);
  font-size: 0.88rem;
  margin-bottom: 16px;
  text-align: center;
}
.viewer-frame {
  width: 100%;
  height: 80vh;
  min-height: 500px;
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  background: #000;
}
.viewer-error {
  text-align: center;
  padding: 80px 24px;
}
.viewer-error h2 {
  color: var(--gold);
  margin-bottom: 12px;
}
.viewer-error p {
  color: var(--text-muted);
  margin-bottom: 20px;
}
.viewer-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
}

/* ============================================
   ORDER PAGE
   ============================================ */
.order-form-wrap {
  max-width: 480px;
  margin: 0 auto;
}
.order-form-wrap select {
  width: 100%;
  padding: 12px 16px;
  background: var(--surface);
  border: 1.5px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: 'Poppins', 'Hind Siliguri', sans-serif;
  outline: none;
  appearance: auto;
}
.order-form-wrap select:focus {
  border-color: var(--gold);
}

/* ============================================
   JOIN GROUP — PHONE VALIDATION
   ============================================ */
.phone-input-wrap {
  display: flex;
  align-items: stretch;
}
.phone-prefix {
  display: flex;
  align-items: center;
  padding: 0 14px;
  background: var(--surface);
  border: 1.5px solid rgba(255,255,255,0.06);
  border-right: none;
  border-radius: 8px 0 0 8px;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-family: 'Poppins', 'Hind Siliguri', sans-serif;
  white-space: nowrap;
}
.phone-input-wrap input {
  border-radius: 0 8px 8px 0 !important;
}
.phone-error {
  color: #f87171;
  font-size: 0.82rem;
  margin-top: 6px;
  display: none;
}
.phone-error.show { display: block; }
.phone-warning {
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.25);
  border-radius: var(--r-md);
  padding: 12px 16px;
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--gold);
  line-height: 1.6;
}
.roll-datalist {
  max-height: 200px;
  overflow-y: auto;
}

/* ============================================
   AD-BLOCKER DETECTION — OVERLAY
   ============================================ */
.adblock-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(8, 13, 31, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.adblock-card {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--r-lg);
  padding: 40px 32px;
  max-width: 460px;
  width: 100%;
  text-align: center;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 0 40px rgba(239, 68, 68, 0.12), var(--shadow-card);
}
.adblock-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}
.adblock-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--danger);
  margin-bottom: 16px;
}
.adblock-msg {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.75;
  margin-bottom: 12px;
}
.adblock-sig {
  color: var(--gold);
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 24px;
}
.adblock-reload-btn {
  font-size: 1rem;
  padding: 14px 28px;
}

/* ============================================
   AD-BLOCKER — SOFT NON-BLOCKING BANNER
   ============================================ */
.adblock-soft-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 99999;
  background: rgba(245, 158, 11, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #0f172a;
  text-align: center;
  padding: 12px 20px;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: 'Poppins', 'Hind Siliguri', sans-serif;
  box-shadow: 0 2px 12px rgba(245, 158, 11, 0.3);
}

/* ============================================
   EXAM COUNTDOWN TIMER
   ============================================ */

/* --- Timer card (detailed) --- */
.exam-timer-card {
  background: var(--glass-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-xl);
  backdrop-filter: blur(12px);
  padding: 32px 28px;
  text-align: center;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}
.exam-timer-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(245,158,11,0.06), rgba(5,150,105,0.04));
  pointer-events: none;
}
.timer-upcoming { border-color: rgba(245,158,11,0.2); }
.timer-ongoing { border-color: rgba(239,68,68,0.3); }
.timer-done { border-color: rgba(5,150,105,0.25); }

.timer-status {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
  position: relative;
}
.timer-subject {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  position: relative;
}
.timer-time-range {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  position: relative;
}
.timer-countdown-to {
  font-size: 0.88rem;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 16px;
  position: relative;
}

/* --- Countdown boxes --- */
.countdown-boxes {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 10px;
  position: relative;
}
.countdown-box {
  background: var(--glass-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  padding: 16px 12px 12px;
  min-width: 72px;
  text-align: center;
  backdrop-filter: blur(6px);
  transition: all 0.3s ease;
}
.countdown-box-days {
  min-width: 80px;
  padding: 18px 14px 12px;
}
.countdown-box-seconds {
  border-color: rgba(245,158,11,0.25);
}
.countdown-value {
  font-family: 'Poppins', 'Courier New', monospace;
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.countdown-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 6px;
}
.countdown-sep {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--gold);
  opacity: 0.4;
  padding-top: 14px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* Seconds pulse animation */
@keyframes countdownPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 rgba(245,158,11,0); }
  50% { transform: scale(1.04); box-shadow: 0 0 16px rgba(245,158,11,0.2); }
}
.countdown-box-seconds .countdown-value {
  animation: countdownPulse 1s ease-in-out infinite;
}

/* Compact countdown boxes */
.countdown-compact { gap: 6px; }
.countdown-compact .countdown-box {
  min-width: 52px;
  padding: 10px 8px 8px;
}
.countdown-compact .countdown-box-days {
  min-width: 56px;
  padding: 10px 8px 8px;
}
.countdown-compact .countdown-value {
  font-size: 1.3rem;
}
.countdown-compact .countdown-sep {
  font-size: 1.2rem;
  padding-top: 8px;
}

/* --- Live badge --- */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(239,68,68,0.15);
  color: #ef4444;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ef4444;
  animation: livePulse 1.5s ease-in-out infinite;
}
@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

/* --- Done state --- */
.timer-done-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  position: relative;
}
.timer-done-text {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--emerald);
  margin-bottom: 8px;
  position: relative;
}
.timer-done-sub {
  color: var(--text-muted);
  font-size: 0.95rem;
  position: relative;
}

/* --- Confetti --- */
.confetti-piece {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  top: -10px;
  opacity: 0;
  animation: confettiFall 3s ease-in forwards;
  pointer-events: none;
  z-index: 10;
}
@keyframes confettiFall {
  0% { opacity: 1; transform: translateY(0) rotate(0deg); }
  100% { opacity: 0; transform: translateY(300px) rotate(720deg); }
}

/* --- Compact timer card (main.html) --- */
.compact-timer-card {
  background: var(--glass-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  backdrop-filter: blur(10px);
  padding: 20px 24px;
  text-align: center;
}
.compact-timer-card.timer-ongoing {
  border-color: rgba(239,68,68,0.25);
}
.compact-timer-card.timer-done {
  border-color: rgba(5,150,105,0.2);
}
.compact-timer-header {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.compact-timer-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.compact-timer-text {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--emerald);
  margin-bottom: 8px;
}
.compact-timer-link {
  display: inline-block;
  margin-top: 12px;
  color: var(--gold);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s;
}
.compact-timer-link:hover { color: var(--gold-light); }

/* --- Mobile responsive --- */
@media (max-width: 480px) {
  .countdown-boxes { gap: 6px; }
  .countdown-box { min-width: 60px; padding: 12px 8px 10px; }
  .countdown-box-days { min-width: 64px; }
  .countdown-value { font-size: 1.6rem; }
  .countdown-sep { font-size: 1.4rem; padding-top: 10px; }
  .exam-timer-card { padding: 24px 16px; }
  .timer-subject { font-size: 1.2rem; }
}
