/* ============ MCA 2026-28 — theme ============ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
  --bg-0: #0b1020;
  --bg-1: #131a33;
  --ink: #eef2ff;
  --ink-dim: #9aa6c8;
  --gold: #ffd166;
  --violet: #a78bfa;
  --cyan: #5eead4;
  --danger: #ff8080;
  --ok: #7CFFB2;
  --glass: rgba(255, 255, 255, 0.06);
  --glass-strong: rgba(255, 255, 255, 0.11);
  --border: rgba(255, 255, 255, 0.14);
  --radius: 16px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Space Grotesk", var(--font);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { width: 100%; min-height: 100%; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg-0);
  position: relative;
  overflow-x: hidden;
}

/* animated aurora background on every page */
body::before {
  content: "";
  position: fixed;
  inset: -20%;
  z-index: -1;
  background:
    radial-gradient(40% 50% at 15% 20%, rgba(167, 139, 250, 0.28), transparent 60%),
    radial-gradient(45% 45% at 85% 15%, rgba(94, 234, 212, 0.20), transparent 60%),
    radial-gradient(50% 55% at 75% 85%, rgba(255, 209, 102, 0.18), transparent 60%),
    radial-gradient(45% 50% at 20% 90%, rgba(96, 165, 250, 0.22), transparent 60%),
    linear-gradient(160deg, var(--bg-1), var(--bg-0));
  background-size: 200% 200%;
  animation: aurora 26s ease-in-out infinite alternate;
}
@keyframes aurora {
  0%   { background-position: 0% 0%; }
  50%  { background-position: 100% 60%; }
  100% { background-position: 30% 100%; }
}
@media (prefers-reduced-motion: reduce) {
  body::before, .bubble { animation: none !important; }
}

/* ---------- Home (bubbles) ---------- */
body.home { overflow: hidden; height: 100%; }

#stage { position: fixed; inset: 0; overflow: hidden; }

.bubble {
  position: absolute;
  border-radius: 50%;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgba(255, 255, 255, 0.35);
  will-change: transform;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.22), rgba(140, 160, 210, 0.06) 45%, rgba(10, 14, 30, 0.15));
  backdrop-filter: blur(2px);
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.5),
    0 4px 10px rgba(0, 0, 0, 0.35),
    inset 0 3px 7px rgba(255, 255, 255, 0.6),
    inset 0 -14px 26px rgba(4, 8, 20, 0.5),
    inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
}
.bubble img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  opacity: 0.9;
}
/* glossy specular highlight + curved reflection = 3D glass sphere */
.bubble::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(58% 42% at 30% 20%, rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0.16) 46%, transparent 62%),
    radial-gradient(42% 34% at 78% 84%, rgba(150, 200, 255, 0.22), transparent 60%);
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 2;
}
/* inner rim light */
.bubble::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: 50%;
  box-shadow:
    inset 0 0 14px rgba(255, 255, 255, 0.28),
    inset 0 0 2px rgba(255, 255, 255, 0.55);
  pointer-events: none;
  z-index: 3;
}
.bubble.birthday {
  border-color: rgba(255, 209, 102, 0.75);
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.5),
    inset 0 3px 7px rgba(255, 255, 255, 0.6),
    inset 0 -14px 26px rgba(4, 8, 20, 0.45),
    0 0 0 3px rgba(255, 209, 102, 0.45),
    0 0 36px 9px rgba(255, 209, 102, 0.6);
}
.bubble .cake {
  position: absolute; top: -4px; right: -2px; font-size: 1.4rem;
  z-index: 4;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
}

header#home-header {
  position: fixed; left: 0; right: 0; top: 0; z-index: 10;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  padding: 26px 16px 20px;
  background: linear-gradient(180deg, rgba(6, 9, 20, 0.72), rgba(6, 9, 20, 0));
  pointer-events: none;
}
header#home-header h1 {
  pointer-events: auto;
  font-family: var(--display);
  font-size: clamp(2rem, 6.5vw, 3.6rem);
  font-weight: 700;
  letter-spacing: 1px;
  background: linear-gradient(90deg, #fff, var(--gold) 60%, var(--violet));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  text-align: center;
}
.header-buttons { pointer-events: auto; display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

#bday-banner {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  z-index: 10; max-width: 92vw; padding: 12px 22px; border-radius: 14px;
  background: linear-gradient(135deg, var(--gold), #ffb347);
  color: #221a0a; font-weight: 700; font-family: var(--display);
  text-align: center; box-shadow: 0 10px 34px rgba(0, 0, 0, 0.45);
  display: none;
}
.admin-link {
  position: fixed; right: 14px; bottom: 12px; z-index: 10;
  color: rgba(255, 255, 255, 0.35); font-size: 0.72rem; text-decoration: none; pointer-events: auto;
}
.admin-link:hover { color: rgba(255, 255, 255, 0.75); }

/* ---------- buttons ---------- */
.btn {
  --b1: var(--glass-strong); --b2: var(--glass);
  appearance: none;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, var(--b1), var(--b2));
  backdrop-filter: blur(10px);
  color: var(--ink);
  padding: 11px 20px;
  border-radius: 999px;
  font-family: var(--display);
  font-size: clamp(0.85rem, 2.4vw, 1rem);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px;
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4); }
.btn:active { transform: translateY(0); }
.btn.primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--gold), #ffb347);
  color: #221a0a;
}
.btn.primary:hover { filter: brightness(1.05); box-shadow: 0 10px 30px rgba(255, 209, 102, 0.4); }
.btn.violet {
  border-color: transparent;
  background: linear-gradient(135deg, var(--violet), #7c6cf0);
  color: #fff;
}
.btn.ghost { background: transparent; }
.btn.danger { border-color: rgba(255, 128, 128, 0.5); color: var(--danger); background: rgba(255, 128, 128, 0.08); }
.btn.sm { padding: 7px 13px; font-size: 0.82rem; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

/* ---------- generic page ---------- */
.page { position: relative; z-index: 1; max-width: 960px; margin: 0 auto; padding: 28px 18px 72px; }
.page-top { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.page-top h1 { font-family: var(--display); font-size: clamp(1.4rem, 5vw, 2.1rem); font-weight: 700; }
a.back { color: var(--gold); text-decoration: none; font-weight: 600; font-family: var(--display); }
a.back:hover { text-decoration: underline; }

.card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.card h2 { font-family: var(--display); font-size: 1.15rem; margin-bottom: 12px; }

label { display: block; font-weight: 600; margin: 14px 0 6px; font-size: 0.92rem; }
input[type="text"], input[type="password"], input[type="date"], select, textarea {
  width: 100%;
  padding: 12px 13px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.28);
  color: var(--ink);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.25);
}
textarea { min-height: 130px; resize: vertical; }
select option { color: #111; }

.checkbox-row { display: flex; align-items: flex-start; gap: 10px; margin-top: 14px; }
.checkbox-row input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--violet); }
.checkbox-row label { margin: 0; font-weight: 500; }

.note {
  font-size: 0.9rem; line-height: 1.55;
  background: linear-gradient(135deg, rgba(94, 234, 212, 0.12), rgba(167, 139, 250, 0.1));
  border: 1px solid rgba(94, 234, 212, 0.3);
  border-radius: 12px;
  padding: 13px 15px;
  margin-bottom: 18px;
}
.msg { margin-top: 14px; font-weight: 600; min-height: 1.2em; }
.msg.ok { color: var(--ok); }
.msg.err { color: var(--danger); }

.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1 1 180px; }

/* ---------- birthday calendar ---------- */
.cal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.cal-head strong { font-family: var(--display); font-size: 1.1rem; }
.cal-head button {
  background: var(--glass-strong); border: 1px solid var(--border); color: var(--ink);
  border-radius: 10px; padding: 8px 15px; cursor: pointer; font-size: 1rem;
}
.cal-head button:hover { background: rgba(255, 255, 255, 0.18); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-grid .dow { text-align: center; font-weight: 700; color: var(--ink-dim); font-size: 0.78rem; padding: 6px 0; font-family: var(--display); }
.cal-cell {
  min-height: 66px; border-radius: 11px; border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.22); padding: 6px; font-size: 0.78rem;
}
.cal-cell.empty { background: transparent; border: none; }
.cal-cell .date { font-weight: 700; color: var(--ink-dim); }
.cal-cell.today { outline: 2px solid var(--gold); outline-offset: -1px; }
.cal-cell.has-bday { background: linear-gradient(135deg, rgba(255, 209, 102, 0.22), rgba(167, 139, 250, 0.14)); }
.cal-cell .who { display: block; margin-top: 3px; line-height: 1.25; }
.cal-cell.today.has-bday { background: rgba(255, 209, 102, 0.4); color: #201a08; }
.today-list { list-style: none; }
.today-list li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.today-list li:last-child { border-bottom: none; }
.today-list img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold); }

/* ---------- login ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card .brand { font-family: var(--display); font-weight: 700; font-size: 1.5rem; text-align: center; margin-bottom: 4px;
  background: linear-gradient(90deg, #fff, var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-card .sub { text-align: center; color: var(--ink-dim); font-size: 0.9rem; margin-bottom: 18px; }

/* ---------- admin ---------- */
.admin-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.tab-btn {
  border: 1px solid var(--border); background: var(--glass); color: var(--ink-dim);
  padding: 9px 16px; border-radius: 999px; cursor: pointer; font-family: var(--display); font-weight: 600; font-size: 0.9rem;
}
.tab-btn.active { color: #221a0a; background: linear-gradient(135deg, var(--gold), #ffb347); border-color: transparent; }
.panel { display: none; }
.panel.active { display: block; }

.list-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px;
  border: 1px solid var(--border); border-radius: 12px; background: rgba(0, 0, 0, 0.2); margin-bottom: 8px;
}
.list-item .avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--glass-strong);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-family: var(--display); flex-shrink: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .grow b { display: block; }
.list-item .grow span { color: var(--ink-dim); font-size: 0.85rem; }

.msg-item { border: 1px solid var(--border); border-radius: 12px; background: rgba(0, 0, 0, 0.22); padding: 14px; margin-bottom: 10px; }
.msg-item .meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; font-size: 0.8rem; }
.chip { border-radius: 999px; padding: 3px 10px; font-weight: 600; font-size: 0.75rem; border: 1px solid var(--border); }
.chip.general { background: rgba(96, 165, 250, 0.18); }
.chip.teachers { background: rgba(167, 139, 250, 0.2); }
.chip.students { background: rgba(94, 234, 212, 0.18); }
.chip.inform { background: rgba(255, 209, 102, 0.22); color: var(--gold); }
.chip.time { color: var(--ink-dim); border-color: transparent; }
.msg-item .body { white-space: pre-wrap; line-height: 1.5; }
.msg-item .from { margin-top: 8px; font-size: 0.82rem; color: var(--ink-dim); }

.modal-back {
  position: fixed; inset: 0; background: rgba(4, 6, 14, 0.7); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50;
}
.modal { width: 100%; max-width: 440px; max-height: 90vh; overflow-y: auto; }

.muted { color: var(--ink-dim); font-size: 0.88rem; }
.spacer { height: 8px; }

@media (max-width: 520px) {
  .cal-cell { min-height: 54px; font-size: 0.68rem; }
  .cal-cell .who { font-size: 0.62rem; }
  .page { padding: 20px 14px 60px; }
}
