/* ==========================================================================
   Happy Birthday ANIK - Stylesheet
   ========================================================================== */

/* --- CSS Variables --- */
:root {
  --bg-gradient: linear-gradient(135deg, #0b0312 0%, #1a0826 35%, #2a0822 70%, #120317 100%);
  --primary-color: #ff3366;
  --primary-glow: rgba(255, 51, 102, 0.6);
  --primary-hover: #ff4d79;
  --accent-gold: #ffd700;
  --accent-rose: #ff69b4;
  --text-light: #ffffff;
  --text-dim: #f0c3d4;
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.5);
  --font-main: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-bangla: 'Hind Siliguri', 'Poppins', sans-serif;
  --font-accent: 'Caveat', cursive;
  --transition-speed: 0.5s;
}

/* --- Global Reset & Base Styles --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-gradient);
  font-family: var(--font-main);
  color: var(--text-light);
  position: relative;
}

/* --- Canvas Animations Background --- */
#particles-canvas,
#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

#confetti-canvas {
  z-index: 99;
}

/* --- Music Control Floating Button --- */
.music-toggle-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  color: #fff;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

.music-toggle-btn:hover {
  transform: scale(1.12);
  background: rgba(255, 255, 255, 0.2);
}

.music-toggle-btn.playing {
  animation: pulse-music 2s infinite ease-in-out;
}

@keyframes pulse-music {
  0%, 100% { box-shadow: 0 0 10px var(--primary-glow); }
  50% { box-shadow: 0 0 24px var(--primary-color); }
}

/* --- Main Layout & Screen Transitions --- */
#app-container {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 10;
}

.page-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.95);
  transition: opacity var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1),
              transform var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1),
              visibility var(--transition-speed);
}

.page-screen.active {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.page-screen.hidden {
  opacity: 0;
  visibility: hidden;
  transform: scale(1.05);
  pointer-events: none;
}

.flex-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.bangla-font {
  font-family: var(--font-bangla);
}

/* --- Buttons Styles --- */
.btn-primary {
  background: linear-gradient(135deg, #ff3366 0%, #ff5e62 100%);
  color: #ffffff;
  border: none;
  padding: 16px 44px;
  font-size: 1.25rem;
  font-weight: 700;
  border-radius: 50px;
  cursor: pointer;
  letter-spacing: 1.5px;
  box-shadow: 0 10px 30px rgba(255, 51, 102, 0.45);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
  outline: none;
}

.btn-primary:hover, .btn-primary:focus {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 16px 36px rgba(255, 51, 102, 0.65);
}

.btn-primary:active {
  transform: translateY(1px) scale(0.97);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid var(--glass-border);
  padding: 16px 44px;
  font-size: 1.25rem;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  letter-spacing: 1.5px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  outline: none;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.22);
}

.glow-effect {
  animation: glowing-btn 2.5s infinite;
}

@keyframes glowing-btn {
  0%, 100% {
    box-shadow: 0 0 20px var(--primary-glow), 0 0 40px rgba(255, 51, 102, 0.35);
  }
  50% {
    box-shadow: 0 0 38px var(--primary-glow), 0 0 65px rgba(255, 51, 102, 0.65);
  }
}

.pulse-btn {
  animation: pulse-anim 2s infinite ease-in-out;
}

@keyframes pulse-anim {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

/* --- SCREEN 1: OPEN SURPRISE --- */
.open-btn {
  font-size: 1.9rem;
  padding: 22px 68px;
  border-radius: 60px;
  letter-spacing: 4px;
  text-transform: uppercase;
}

/* --- Glass Card Container (Screen 2) --- */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: 28px;
  padding: 42px 32px;
  width: 90%;
  max-width: 440px;
  text-align: center;
}

/* --- SCREEN 2: YOU ARE MC --- */
.heading-mc {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 32px;
  background: linear-gradient(135deg, #ffffff 0%, #f0c3d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 1px;
  text-shadow: 0 4px 20px rgba(255, 51, 102, 0.3);
}

.btn-group {
  display: flex;
  gap: 20px;
  justify-content: center;
  width: 100%;
}

.btn-group button {
  flex: 1;
  max-width: 140px;
}

/* --- SCREEN 4: BIRTHDAY REVEAL --- */
.reveal-container {
  text-align: center;
  max-width: 650px;
  padding: 20px;
}

.cake-badge {
  font-size: 4.2rem;
  margin-bottom: 20px;
  animation: bounce 2.2s infinite ease-in-out;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-16px); }
}

.reveal-title {
  font-size: clamp(2.3rem, 8.5vw, 4rem);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #ffffff 0%, #ffd700 45%, #ff3366 90%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 18px rgba(255, 51, 102, 0.45));
}

.glow-text {
  animation: text-glow 3s infinite alternate;
}

@keyframes text-glow {
  from {
    filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.4)) drop-shadow(0 0 22px rgba(255, 51, 102, 0.4));
  }
  to {
    filter: drop-shadow(0 0 24px rgba(255, 215, 0, 0.85)) drop-shadow(0 0 40px rgba(255, 51, 102, 0.85));
  }
}

.reveal-subtitle {
  font-size: 1.15rem;
  color: var(--text-dim);
  margin-bottom: 36px;
  font-weight: 400;
}

#btn-click-now {
  font-size: 1.45rem;
  padding: 18px 52px;
  letter-spacing: 1px;
}

/* --- SCREEN 5: BIRTHDAY LETTER --- */
.letter-wrapper {
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 10px 10px 25px 10px;
  border-radius: 26px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 51, 102, 0.5) transparent;
}

.letter-wrapper::-webkit-scrollbar {
  width: 6px;
}

.letter-wrapper::-webkit-scrollbar-thumb {
  background-color: rgba(255, 51, 102, 0.5);
  border-radius: 10px;
}

.letter-card {
  background: rgba(18, 8, 28, 0.82);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1.5px solid rgba(255, 105, 180, 0.35);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6), inset 0 0 25px rgba(255, 51, 102, 0.18);
  border-radius: 26px;
  padding: clamp(26px, 6vw, 42px);
  color: #fff;
  position: relative;
  overflow: hidden;
}

.letter-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, #ff3366, #ffd700, #ff69b4, #ff3366);
}

.letter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.22);
  padding-bottom: 14px;
}

.letter-decoration {
  font-size: 1.6rem;
}

.letter-salutation {
  font-size: clamp(1.55rem, 5vw, 1.85rem);
  color: var(--accent-gold);
  font-weight: 700;
}

.letter-body {
  font-size: clamp(1.05rem, 3.8vw, 1.18rem);
  line-height: 1.85;
  color: #fce4ec;
  font-weight: 400;
}

.letter-body p {
  margin-bottom: 16px;
}

.letter-highlight {
  background: rgba(255, 51, 102, 0.14);
  padding: 16px 20px;
  border-left: 4px solid var(--primary-color);
  border-radius: 12px;
  margin: 20px 0;
  text-align: center;
}

.highlight-title {
  font-size: 1rem;
  color: var(--text-dim);
  margin-bottom: 4px !important;
}

.highlight-wishes {
  font-size: clamp(1.25rem, 4.5vw, 1.55rem);
  color: var(--accent-gold);
  font-weight: 700;
}

.letter-footer {
  margin-top: 28px;
  text-align: right;
  border-top: 1px dashed rgba(255, 255, 255, 0.22);
  padding-top: 16px;
}

.letter-signature {
  font-size: clamp(1.15rem, 4vw, 1.35rem);
  font-weight: 700;
  color: var(--accent-gold);
}

/* --- Utility Animations --- */
.hidden {
  display: none !important;
}

/* --- Mobile Responsiveness --- */
@media (max-width: 480px) {
  .page-screen {
    padding: 15px;
  }

  .glass-card {
    padding: 32px 22px;
  }

  .open-btn {
    font-size: 1.55rem;
    padding: 18px 52px;
  }

  .heading-mc {
    font-size: 2.1rem;
  }

  .btn-primary, .btn-secondary {
    padding: 14px 30px;
    font-size: 1.1rem;
  }

  .letter-card {
    padding: 24px 20px;
  }
}
