/* ==========================================================================
   DESIGN SYSTEM & VARIABLES
   ========================================================================== */
:root {
  --bg-dark: #070913;
  --bg-card: rgba(15, 23, 42, 0.55);
  --border-glass: rgba(255, 255, 255, 0.12);
  --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  
  --primary-blue: #00d2ff;
  --primary-purple: #9d4edd;
  --accent-gold: #ffd700;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  
  --glow-blue: 0 0 25px rgba(0, 210, 255, 0.5);
  --glow-purple: 0 0 25px rgba(157, 78, 221, 0.5);
  --glow-gold: 0 0 25px rgba(255, 215, 0, 0.5);
  
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', 'Outfit', sans-serif;
  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  overflow-x: hidden;
}

body {
  position: relative;
  min-height: 100vh;
  line-height: 1.6;
}

/* Ambient Canvas */
#bgCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2;
  pointer-events: none;
}

/* Fireworks Overlay Canvas */
#fireworksCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 99;
  pointer-events: none;
}

/* Custom Cursor Glow */
.cursor-glow {
  position: fixed;
  width: 350px;
  height: 350px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(157, 78, 221, 0.15) 0%, rgba(0, 210, 255, 0.08) 40%, transparent 70%);
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: -1;
  transition: transform 0.05s ease-out;
}

/* Audio Control Button */
.music-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 30px;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  transition: var(--transition-smooth);
}

.music-toggle:hover {
  border-color: var(--primary-blue);
  box-shadow: var(--glow-blue);
  transform: scale(1.05);
}

/* Glassmorphism Generic Card */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 24px;
  box-shadow: var(--shadow-glass);
  position: relative;
  overflow: hidden;
}

/* Typography Utility Classes */
.text-glow-gold {
  color: var(--accent-gold);
  text-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
}

.text-glow-blue {
  color: var(--primary-blue);
  text-shadow: 0 0 15px rgba(0, 210, 255, 0.6);
}

.text-glow-purple {
  color: var(--primary-purple);
  text-shadow: 0 0 15px rgba(157, 78, 221, 0.6);
}

.section-title {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 3rem;
}

/* Scroll Reveal Base */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

.main-hidden {
  opacity: 0;
  transition: opacity 1s ease-in;
}

.main-visible {
  opacity: 1;
}

/* ==========================================================================
   1. LOADING SCREEN
   ========================================================================== */
.loader-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-dark);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.loader-content {
  text-align: center;
  width: 90%;
  max-width: 400px;
}

.loader-ring {
  width: 70px;
  height: 70px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--primary-blue);
  border-right-color: var(--primary-purple);
  border-radius: 50%;
  margin: 0 auto 20px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loader-text {
  font-family: var(--font-sans);
  font-weight: 300;
  letter-spacing: 2px;
  margin-bottom: 20px;
  font-size: 1.1rem;
}

.progress-bar-container {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 10px;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--primary-blue), var(--primary-purple), var(--accent-gold));
  border-radius: 10px;
  transition: width 0.1s ease;
}

.loader-percentage {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ==========================================================================
   2. HERO SECTION
   ========================================================================== */
.hero-section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 40px 20px;
  position: relative;
}

.hero-avatar-wrapper {
  position: relative;
  width: 200px;
  height: 200px;
  margin-bottom: 30px;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  position: relative;
  z-index: 2;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.glow-ring {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: linear-gradient(45deg, var(--primary-blue), var(--primary-purple), var(--accent-gold));
  filter: blur(15px);
  z-index: 1;
  animation: pulseGlow 4s infinite alternate;
}

@keyframes pulseGlow {
  0% { transform: scale(0.95); opacity: 0.6; }
  100% { transform: scale(1.05); opacity: 0.9; }
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  margin-bottom: 15px;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 600px;
  margin-bottom: 40px;
}

/* Neon Glow Button */
.btn-neon {
  position: relative;
  padding: 16px 40px;
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: 50px;
  cursor: pointer;
  overflow: hidden;
  transition: var(--transition-smooth);
  backdrop-filter: blur(10px);
}

.btn-neon span {
  position: relative;
  z-index: 2;
}

.btn-glow {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(90deg, var(--primary-blue), var(--primary-purple));
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 1;
}

.btn-neon:hover {
  transform: translateY(-3px);
  box-shadow: var(--glow-purple);
  border-color: transparent;
}

.btn-neon:hover .btn-glow {
  opacity: 1;
}

.scroll-down-indicator {
  position: absolute;
  bottom: 30px;
  font-size: 1.8rem;
  color: var(--text-muted);
  text-decoration: none;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
  60% { transform: translateY(-5px); }
}

/* ==========================================================================
   3. BIRTHDAY WISH
   ========================================================================== */
.wish-section {
  padding: 100px 20px;
  max-width: 800px;
  margin: 0 auto;
}

.wish-card {
  padding: 50px 40px;
  text-align: center;
}

.card-glow-edge {
  position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary-blue), var(--primary-purple), transparent);
}

.typing-text {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  line-height: 2;
  white-space: pre-wrap;
  color: var(--text-main);
}

/* ==========================================================================
   4. MEMORY GALLERY
   ========================================================================== */
.gallery-section {
  padding: 100px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.memory-card {
  cursor: pointer;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.5s ease;
}

.memory-card:hover {
  transform: translateY(-12px) rotate(1.5deg);
  box-shadow: 0 20px 40px rgba(0, 210, 255, 0.25);
  border-color: rgba(0, 210, 255, 0.4);
}

.memory-img-wrapper {
  width: 100%;
  height: 280px;
  overflow: hidden;
  border-radius: 20px 20px 0 0;
}

.memory-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.memory-card:hover .memory-img-wrapper img {
  transform: scale(1.08);
}

.memory-info {
  padding: 20px;
  text-align: center;
}

.memory-info h3 {
  font-size: 1.2rem;
  color: var(--accent-gold);
  margin-bottom: 5px;
}

.memory-info p {
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* ==========================================================================
   5. REASONS YOU'RE AWESOME
   ========================================================================== */
.reasons-section {
  padding: 100px 20px;
  max-width: 1100px;
  margin: 0 auto;
}

.reasons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
}

.reason-card {
  padding: 35px 25px;
  text-align: center;
  transition: var(--transition-smooth);
}

.reason-card:hover {
  transform: translateY(-8px);
  border-color: var(--primary-purple);
  box-shadow: var(--glow-purple);
}

.reason-icon {
  font-size: 3rem;
  margin-bottom: 15px;
  display: inline-block;
}

.reason-card h3 {
  margin-bottom: 10px;
  font-size: 1.25rem;
}

.reason-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Card staggered scroll animation handled by JS adding active class */
.reveal-item {
  opacity: 0;
  transform: translateY(30px);
  transition: var(--transition-smooth);
}

.reveal-item.active {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   6. SPECIAL COUNTDOWN
   ========================================================================== */
.countdown-section {
  padding: 80px 20px;
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.countdown-card {
  padding: 50px 30px;
}

.countdown-title {
  font-family: var(--font-heading);
  margin-bottom: 25px;
  font-size: 1.8rem;
}

.timer-display {
  display: inline-block;
  padding: 20px 40px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 20px;
  border: 1px solid var(--border-glass);
  margin-bottom: 15px;
}

.timer-number {
  font-size: 4rem;
  font-weight: 800;
  color: var(--primary-blue);
  text-shadow: var(--glow-blue);
}

.timer-status {
  color: var(--text-muted);
  font-size: 1rem;
}

/* ==========================================================================
   7. BIRTHDAY CAKE (PURE CSS)
   ========================================================================== */
.cake-section {
  padding: 100px 20px;
  text-align: center;
}

.cake-container {
  height: 300px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  margin-bottom: 40px;
}

.cake {
  position: relative;
  width: 220px;
}

.plate {
  width: 260px;
  height: 14px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  position: absolute;
  bottom: -10px;
  left: -20px;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

.layer {
  position: absolute;
  width: 100%;
  border-radius: 12px 12px 0 0;
}

.layer-bottom {
  height: 70px;
  bottom: 0;
  background: linear-gradient(180deg, #4a154b, #2c0b2e);
}

.layer-middle {
  height: 60px;
  bottom: 70px;
  width: 180px;
  left: 20px;
  background: linear-gradient(180deg, #6b1740, #420d26);
}

.layer-top {
  height: 50px;
  bottom: 130px;
  width: 140px;
  left: 40px;
  background: linear-gradient(180deg, #8f1d56, #5c1137);
}

.icing {
  position: absolute;
  top: 70px;
  left: 40px;
  width: 140px;
  height: 15px;
  background: #fce4ec;
  border-radius: 10px;
}

.candles {
  position: absolute;
  top: 40px;
  left: 55px;
  width: 110px;
  display: flex;
  justify-content: space-around;
}

.candle {
  width: 12px;
  height: 35px;
  background: linear-gradient(180deg, #00d2ff, #0077b6);
  border-radius: 4px;
  position: relative;
}

.flame {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 18px;
  background: #ff9800;
  border-radius: 50% 50% 20% 20%;
  box-shadow: 0 0 12px #ff9800, 0 0 25px #ff5722;
  animation: flicker 0.6s infinite alternate;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.flame.extinguished {
  opacity: 0;
  transform: translateX(-50%) scale(0);
}

@keyframes flicker {
  0% { transform: translateX(-50%) scale(1) rotate(-2deg); }
  100% { transform: translateX(-50%) scale(1.1) rotate(2deg); }
}

.btn-cake {
  margin-top: 20px;
}

/* ==========================================================================
   8. FINAL PHOTO SECTION
   ========================================================================== */
.final-photo-section {
  padding: 100px 20px;
  display: flex;
  justify-content: center;
}

.final-photo-container {
  position: relative;
  max-width: 550px;
  width: 100%;
}

.sparkles-container {
  position: absolute;
  inset: -30px;
  pointer-events: none;
  z-index: 1;
}

.sparkle, .floating-heart {
  position: absolute;
  animation: floatUp 4s infinite ease-in-out;
  pointer-events: none;
}

@keyframes floatUp {
  0% { transform: translateY(0) scale(0.8); opacity: 0; }
  50% { opacity: 0.8; }
  100% { transform: translateY(-80px) scale(1.2); opacity: 0; }
}

.animated-border-wrap {
  position: relative;
  padding: 8px;
  border-radius: 30px;
  background: linear-gradient(60deg, var(--primary-blue), var(--primary-purple), var(--accent-gold), var(--primary-blue));
  background-size: 300% 300%;
  animation: borderGradient 6s linear infinite;
  box-shadow: 0 0 50px rgba(157, 78, 221, 0.35);
}

@keyframes borderGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.final-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 24px;
}

/* ==========================================================================
   9. FINAL MESSAGE
   ========================================================================== */
.final-message-section {
  padding: 100px 20px;
  max-width: 850px;
  margin: 0 auto;
  text-align: center;
}

.final-msg-card {
  padding: 60px 40px;
}

.final-heading {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--accent-gold);
  margin-bottom: 30px;
  text-shadow: var(--glow-gold);
}

.final-body p {
  font-size: 1.15rem;
  color: var(--text-main);
  margin-bottom: 20px;
  line-height: 1.8;
}

.highlight-quote {
  font-style: italic;
  color: var(--primary-blue);
  font-size: 1.25rem !important;
}

.final-signature {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  margin-top: 35px;
  color: #fff;
}

/* ==========================================================================
   10. ENDING ANIMATION & FOOTER
   ========================================================================== */
.ending-footer {
  padding: 100px 20px 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.balloon-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.balloon {
  position: absolute;
  bottom: -100px;
  width: 45px;
  height: 55px;
  border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
  animation: floatBalloon 8s ease-in infinite;
  opacity: 0.8;
}

.balloon::after {
  content: "";
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 15px;
  background: rgba(255, 255, 255, 0.4);
}

@keyframes floatBalloon {
  0% { transform: translateY(0) rotate(0deg); opacity: 0; }
  20% { opacity: 0.85; }
  100% { transform: translateY(-700px) rotate(15deg); opacity: 0; }
}

.ending-glow-text {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  background: linear-gradient(90deg, var(--primary-blue), var(--accent-gold), var(--primary-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 3s infinite linear;
  position: relative;
  z-index: 2;
}

@keyframes shimmer {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

/* ==========================================================================
   LIGHTBOX MODAL
   ========================================================================== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 15, 0.92);
  backdrop-filter: blur(20px);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-img {
  max-width: 85vw;
  max-height: 80vh;
  border-radius: 16px;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
  border: 1px solid var(--border-glass);
}

.lightbox-caption {
  margin-top: 20px;
  color: var(--text-main);
  font-size: 1.1rem;
}

.lightbox-close {
  position: absolute;
  top: 30px;
  right: 40px;
  font-size: 3rem;
  color: #fff;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.lightbox-close:hover {
  transform: scale(1.2);
  color: var(--accent-gold);
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 768px) {
  .section-title {
    font-size: 2rem;
  }

  .wish-card, .final-msg-card, .countdown-card {
    padding: 30px 20px;
  }

  .typing-text {
    font-size: 1.15rem;
    line-height: 1.7;
  }

  .timer-number {
    font-size: 3rem;
  }

  .cake {
    transform: scale(0.85);
  }

  .cursor-glow {
    display: none; /* Mobile performance optimization */
  }
}