/* ============================================
   DESIGN TOKENS
   ============================================ */
:root {
  --primary: #38b6ff;
  --primary-deep: #1e90ff;
  --accent: #ff4757;
  --cyan: #00d9ff;
  --purple: #a78bfa;
  --golden: #ffd60a;
  --golden-warm: #f59e0b;
  --text-light: #f4f4f9;
  --text-muted: #cbd5e1;
  --glass-bg: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-highlight: rgba(255, 255, 255, 0.15);
  --shadow-color: rgba(0, 0, 0, 0.25);
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 32px;
  --radius-pill: 50px;
}

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

body {
  font-family: "Plus Jakarta Sans", "Inter", sans-serif;
  background: #0a0e1a;
  color: white;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
  position: relative;
  overflow-x: hidden;
}

/* ============================================
   BACKGROUND LAYERS
   ============================================ */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    url("background.png") center / cover no-repeat fixed;
  filter: brightness(0.25) saturate(0.6);
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(56, 182, 255, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 80%, rgba(167, 139, 250, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 50%, rgba(255, 71, 87, 0.06) 0%, transparent 70%);
  z-index: 0;
  animation: ambientShift 20s ease infinite alternate;
}

@keyframes ambientShift {
  0% { opacity: 0.7; }
  50% { opacity: 1; }
  100% { opacity: 0.8; }
}

/* ============================================
   FLOATING ORBS
   ============================================ */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.3;
  z-index: 0;
  pointer-events: none;
}

.orb-1 {
  width: 400px;
  height: 400px;
  background: var(--primary);
  top: -100px;
  left: -100px;
  animation: orbFloat1 25s ease-in-out infinite;
}

.orb-2 {
  width: 300px;
  height: 300px;
  background: var(--purple);
  bottom: -50px;
  right: -50px;
  animation: orbFloat2 30s ease-in-out infinite;
}

.orb-3 {
  width: 250px;
  height: 250px;
  background: var(--golden);
  top: 50%;
  left: 60%;
  opacity: 0.15;
  animation: orbFloat3 20s ease-in-out infinite;
}

@keyframes orbFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(80px, 60px) scale(1.1); }
  66% { transform: translate(-40px, 100px) scale(0.95); }
}

@keyframes orbFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-60px, -80px) scale(1.15); }
  66% { transform: translate(50px, -40px) scale(0.9); }
}

@keyframes orbFloat3 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-100px, -60px); }
}

/* ============================================
   PARTICLES
   ============================================ */
.particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 3px;
  height: 3px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  animation: particleRise linear infinite;
}

@keyframes particleRise {
  0% {
    transform: translateY(100vh) scale(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 0.6;
  }
  100% {
    transform: translateY(-10vh) scale(1);
    opacity: 0;
  }
}

/* ============================================
   MAIN GLASS CONTAINER
   ============================================ */
.glass-container {
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 56px 48px;
  width: 100%;
  max-width: 920px;
  text-align: center;
  box-shadow:
    0 32px 64px -16px var(--shadow-color),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset,
    0 1px 0 rgba(255, 255, 255, 0.1) inset;
  position: relative;
  z-index: 1;
  animation: containerReveal 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
}

@keyframes containerReveal {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.97);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

/* Corner accents */
.corner-accent {
  position: absolute;
  width: 40px;
  height: 40px;
  pointer-events: none;
}

.corner-accent::before,
.corner-accent::after {
  content: "";
  position: absolute;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  border-radius: 2px;
  opacity: 0.4;
}

.top-left { top: 16px; left: 16px; }
.top-left::before { width: 24px; height: 2px; top: 0; left: 0; }
.top-left::after { width: 2px; height: 24px; top: 0; left: 0; }

.top-right { top: 16px; right: 16px; }
.top-right::before { width: 24px; height: 2px; top: 0; right: 0; }
.top-right::after { width: 2px; height: 24px; top: 0; right: 0; }

.bottom-left { bottom: 16px; left: 16px; }
.bottom-left::before { width: 24px; height: 2px; bottom: 0; left: 0; }
.bottom-left::after { width: 2px; height: 24px; bottom: 0; left: 0; }

.bottom-right { bottom: 16px; right: 16px; }
.bottom-right::before { width: 24px; height: 2px; bottom: 0; right: 0; }
.bottom-right::after { width: 2px; height: 24px; bottom: 0; right: 0; }

/* ============================================
   HEADER & LOGO
   ============================================ */
.logo-badge {
  position: relative;
  display: inline-block;
  margin-bottom: 16px;
}

.logo-badge img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 18px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  padding: 4px;
  background: rgba(255, 255, 255, 0.05);
  position: relative;
  z-index: 1;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.logo-badge:hover img {
  transform: scale(1.08) rotate(-3deg);
}

.logo-glow {
  position: absolute;
  inset: -8px;
  background: radial-gradient(circle, rgba(56, 182, 255, 0.3), transparent 70%);
  border-radius: 24px;
  z-index: 0;
  animation: logoGlow 3s ease-in-out infinite alternate;
}

@keyframes logoGlow {
  from { opacity: 0.5; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1.05); }
}

.school-name {
  font-family: "Barlow", "Montserrat", sans-serif;
  font-weight: 800;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 20px;
}

/* Header divider */
.header-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
}

.header-divider::before,
.header-divider::after {
  content: "";
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.divider-diamond {
  width: 8px;
  height: 8px;
  background: var(--golden);
  transform: rotate(45deg);
  border-radius: 2px;
  box-shadow: 0 0 12px rgba(255, 214, 10, 0.4);
}

header h1 {
  font-family: "Montserrat", "Barlow", sans-serif;
  font-weight: 900;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
  line-height: 1.15;
}

.title-line {
  display: block;
  font-size: 2rem;
  color: rgba(255, 255, 255, 0.85);
}

.title-gradient {
  font-size: 2.8rem;
  background: linear-gradient(135deg, #ffffff 0%, var(--cyan) 40%, var(--golden) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 8px rgba(56, 182, 255, 0.3));
}

.subtitle {
  margin-bottom: 40px;
}

.year-badge {
  display: inline-block;
  padding: 6px 20px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* ============================================
   COUNTDOWN
   ============================================ */
.countdown-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
  margin-bottom: 8px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  animation: pulseDot 2s ease-in-out infinite;
  box-shadow: 0 0 8px rgba(255, 71, 87, 0.5);
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.6; }
}

.timer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: 28px 0 32px;
  flex-wrap: wrap;
}

.time-separator {
  font-family: "Montserrat", sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.25);
  line-height: 1;
  padding-bottom: 24px;
}

.time-box {
  position: relative;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
  padding: 24px 18px 16px;
  border-radius: var(--radius-md);
  min-width: 100px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

.time-box::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(56, 182, 255, 0.1) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.4s ease;
  border-radius: inherit;
}

.time-box:hover {
  transform: translateY(-6px);
  border-color: rgba(56, 182, 255, 0.3);
  box-shadow: 0 16px 48px rgba(56, 182, 255, 0.15), 0 0 0 1px rgba(56, 182, 255, 0.1) inset;
}

.time-box:hover::before {
  opacity: 1;
}

.time-value-wrapper {
  position: relative;
}

.time-value {
  display: block;
  font-family: "Barlow", "Montserrat", sans-serif;
  font-size: 3.2rem;
  font-weight: 900;
  letter-spacing: 2px;
  color: #ffffff;
  line-height: 1.1;
  position: relative;
  z-index: 1;
}

.time-box label {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 600;
  letter-spacing: 2px;
  margin-top: 8px;
  display: block;
  position: relative;
  z-index: 1;
}

/* ============================================
   INFO CARD
   ============================================ */
.info-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, rgba(255, 214, 10, 0.08) 0%, rgba(245, 158, 11, 0.08) 100%);
  border: 1px solid rgba(255, 214, 10, 0.2);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--golden);
}

.info-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.8;
}

.info-card strong {
  font-weight: 700;
}

/* ============================================
   RESULT SECTION
   ============================================ */
.hidden {
  display: none !important;
}

#result-section {
  animation: resultReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes resultReveal {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100;
}

.congrats-icon {
  font-size: 4rem;
  margin-bottom: 12px;
  animation: bounceIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 4px 16px rgba(255, 214, 10, 0.3));
}

@keyframes bounceIn {
  0% { transform: scale(0) rotate(-20deg); opacity: 0; }
  60% { transform: scale(1.2) rotate(5deg); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.congrats-text h2 {
  font-family: "Montserrat", sans-serif;
  font-weight: 900;
  color: #ffffff;
  font-size: 2.6rem;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.ampersand {
  background: linear-gradient(135deg, var(--golden), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-style: italic;
}

.congrats-text p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.05rem;
  margin-bottom: 32px;
  font-weight: 400;
}

/* ============================================
   PDF WRAPPER
   ============================================ */
.pdf-wrapper {
  margin: 0 0 28px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  background: rgba(0, 0, 0, 0.2);
}

.pdf-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
}

.pdf-header svg {
  opacity: 0.5;
}

.pdf-wrapper iframe {
  display: block;
  border: none;
}

/* ============================================
   DOWNLOAD BUTTON
   ============================================ */
.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-deep) 100%);
  color: white;
  text-decoration: none;
  padding: 16px 36px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 8px 24px rgba(56, 182, 255, 0.3);
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  letter-spacing: 0.3px;
  position: relative;
  overflow: hidden;
}

.btn-download::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.btn-download:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 16px 40px rgba(56, 182, 255, 0.45);
}

.btn-download:hover::before {
  transform: translateX(100%);
}

.btn-download:active {
  transform: translateY(-2px) scale(0.98);
}

/* ============================================
   FOOTER
   ============================================ */
footer {
  margin-top: 48px;
}

.footer-divider {
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  margin: 0 auto 16px;
}

footer p {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.3);
  font-weight: 400;
  letter-spacing: 0.5px;
}

/* ============================================
   ADMIN NOTICE CARD
   ============================================ */
.admin-notice {
  margin-top: 36px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(245, 158, 11, 0.25);
  background: linear-gradient(160deg, rgba(245, 158, 11, 0.06) 0%, rgba(255, 71, 87, 0.04) 100%);
  overflow: hidden;
  text-align: left;
  animation: resultReveal 0.8s 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.notice-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  background: rgba(245, 158, 11, 0.1);
  border-bottom: 1px solid rgba(245, 158, 11, 0.15);
  color: var(--golden-warm);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.3px;
}

.notice-header svg {
  flex-shrink: 0;
}

.notice-body {
  padding: 24px;
}

.notice-intro {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 16px;
}

.lulus-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--golden), var(--golden-warm));
  color: #1a1a2e;
  padding: 2px 12px;
  border-radius: 6px;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 3px;
  margin: 0 2px;
}

.notice-date {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  background: rgba(56, 182, 255, 0.08);
  border: 1px solid rgba(56, 182, 255, 0.2);
  color: var(--cyan);
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.notice-date svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.notice-list {
  list-style: none;
  counter-reset: notice-counter;
  padding: 0;
  margin: 0;
}

.notice-list li {
  counter-increment: notice-counter;
  position: relative;
  padding: 14px 16px 14px 52px;
  margin-bottom: 8px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  line-height: 1.6;
  transition: background 0.3s ease;
}

.notice-list li:hover {
  background: rgba(255, 255, 255, 0.06);
}

.notice-list li::before {
  content: counter(notice-counter);
  position: absolute;
  left: 14px;
  top: 14px;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: white;
  font-weight: 700;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notice-list li:last-child {
  margin-bottom: 0;
  border-color: rgba(255, 71, 87, 0.2);
  background: rgba(255, 71, 87, 0.05);
}

.notice-list li:last-child:hover {
  background: rgba(255, 71, 87, 0.08);
}

.notice-note {
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.82rem;
  font-style: italic;
  margin-top: 4px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 640px) {
  body {
    padding: 12px;
  }

  .glass-container {
    padding: 36px 20px;
    border-radius: 24px;
  }

  .school-name {
    font-size: 0.7rem;
    letter-spacing: 2px;
  }

  .title-line {
    font-size: 1.5rem;
  }

  .title-gradient {
    font-size: 2rem;
  }

  .timer {
    gap: 6px;
    margin: 20px 0 24px;
  }

  .time-separator {
    font-size: 1.5rem;
    padding-bottom: 20px;
  }

  .time-box {
    min-width: 68px;
    padding: 16px 10px 12px;
  }

  .time-value {
    font-size: 2rem;
  }

  .time-box label {
    font-size: 0.6rem;
    letter-spacing: 1px;
  }

  .congrats-text h2 {
    font-size: 2rem;
  }

  .congrats-icon {
    font-size: 3rem;
  }

  .pdf-wrapper iframe {
    height: 380px;
  }

  .btn-download {
    padding: 14px 28px;
    font-size: 0.85rem;
  }

  .corner-accent { display: none; }
  .orb-3 { display: none; }
}

@media (max-width: 380px) {
  .timer {
    gap: 4px;
  }

  .time-box {
    min-width: 58px;
    padding: 12px 8px 10px;
  }

  .time-value {
    font-size: 1.6rem;
  }

  .time-separator {
    font-size: 1.2rem;
  }
}

/* ============================================
   COUNTDOWN ACTIVE STATE
   ============================================ */
#countdown-section.active {
  animation: sectionReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes sectionReveal {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   SECOND TICK ANIMATION
   ============================================ */
.time-box.tick .time-value {
  animation: tickPulse 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes tickPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}
