/* ========================================
   CSS: Complete Styles for Birthday App
   ======================================== */

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

body, html {
  width: 100%;
  height: 100%;
  background: #0a0a0a;
  overflow: hidden;
  font-family: 'Quicksand', sans-serif;
}

/* ---- FIREWORKS CANVAS ---- */
#c {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* ---- OPENING OVERLAY ---- */
.opening-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(10, 10, 10, 0.3);
  transition: opacity 1.5s ease;
}

.opening-text {
  font-family: 'Dancing Script', cursive;
  font-size: clamp(28px, 5vw, 56px);
  color: #ffd700;
  text-align: center;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.5), 0 0 40px rgba(255, 215, 0, 0.3);
  max-width: 80%;
  line-height: 1.6;
  min-height: 120px;
}

.opening-text .cursor {
  display: inline-block;
  width: 3px;
  height: 1em;
  background: #ffd700;
  animation: blink 0.7s infinite;
  vertical-align: text-bottom;
  margin-left: 4px;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.prayer-btn-container {
  margin-top: 40px;
  text-align: center;
  animation: fadeInUp 1s ease forwards;
}

.prayer-prompt {
  font-family: 'Handlee', cursive;
  font-size: clamp(18px, 3vw, 26px);
  color: #ffb6c1;
  margin-bottom: 25px;
  text-shadow: 0 0 10px rgba(255, 182, 193, 0.4);
}

/* ---- BUTTONS ---- */
.glow-btn {
  padding: 16px 40px;
  font-family: 'Quicksand', sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #ff6b9d, #c44569);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(255, 107, 157, 0.4), 0 0 30px rgba(255, 107, 157, 0.2);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.glow-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.5s ease;
}

.glow-btn:hover::before {
  left: 100%;
}

.glow-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 30px rgba(255, 107, 157, 0.6), 0 0 50px rgba(255, 107, 157, 0.3);
}

.glow-btn:active {
  transform: translateY(-1px);
}

.surprise-btn {
  margin-top: 30px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4), 0 0 30px rgba(102, 126, 234, 0.2);
}

.surprise-btn:hover {
  box-shadow: 0 6px 30px rgba(102, 126, 234, 0.6), 0 0 50px rgba(102, 126, 234, 0.3);
}

/* ---- PRAYER SCREEN ---- */
.prayer-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 20;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(5, 5, 15, 0.95);
  animation: fadeIn 1s ease;
}

.prayer-content {
  text-align: center;
  max-width: 500px;
  padding: 40px;
}

.candle-glow {
  font-size: 80px;
  animation: candleFlicker 2s ease-in-out infinite;
  filter: drop-shadow(0 0 30px rgba(255, 200, 100, 0.8));
  margin-bottom: 20px;
}

@keyframes candleFlicker {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 30px rgba(255, 200, 100, 0.8)); }
  25% { transform: scale(1.05); filter: drop-shadow(0 0 40px rgba(255, 200, 100, 1)); }
  50% { transform: scale(0.98); filter: drop-shadow(0 0 25px rgba(255, 200, 100, 0.6)); }
  75% { transform: scale(1.02); filter: drop-shadow(0 0 35px rgba(255, 200, 100, 0.9)); }
}

.prayer-title {
  font-family: 'Dancing Script', cursive;
  font-size: clamp(32px, 5vw, 48px);
  color: #ffd700;
  margin-bottom: 15px;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

.prayer-subtitle {
  font-family: 'Handlee', cursive;
  font-size: clamp(14px, 2vw, 20px);
  color: #e0e0e0;
  margin-bottom: 40px;
}

.prayer-progress {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 40px;
}

.prayer-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ffd700, #ff6b9d);
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* Prayer visual particles */
.prayer-visual {
  position: relative;
  height: 150px;
}

.floating-particle {
  position: absolute;
  width: 6px;
  height: 6px;
  background: #ffd700;
  border-radius: 50%;
  opacity: 0;
  animation: particleFloat 3s ease-in-out infinite;
}

.floating-particle:nth-child(1) { left: 20%; animation-delay: 0s; }
.floating-particle:nth-child(2) { left: 40%; animation-delay: 0.5s; }
.floating-particle:nth-child(3) { left: 60%; animation-delay: 1s; }
.floating-particle:nth-child(4) { left: 80%; animation-delay: 1.5s; }
.floating-particle:nth-child(5) { left: 50%; animation-delay: 2s; }

@keyframes particleFloat {
  0% { bottom: 0; opacity: 0; transform: scale(0.5); }
  20% { opacity: 1; transform: scale(1); }
  80% { opacity: 1; transform: scale(1); }
  100% { bottom: 100%; opacity: 0; transform: scale(0.5); }
}

/* ---- POST-PRAYER SCREEN ---- */
.post-prayer-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 20;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(10, 5, 15, 0.95);
  animation: fadeIn 1s ease;
}

.post-prayer-content {
  text-align: center;
  max-width: 600px;
  padding: 40px;
}

.big-heart {
  font-size: 100px;
  animation: heartbeat 1.5s ease-in-out infinite;
  margin-bottom: 20px;
  filter: drop-shadow(0 0 30px rgba(255, 105, 180, 0.6));
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  14% { transform: scale(1.15); }
  28% { transform: scale(1); }
  42% { transform: scale(1.15); }
  70% { transform: scale(1); }
}

.birthday-wish-title {
  font-family: 'Dancing Script', cursive;
  font-size: clamp(32px, 5vw, 52px);
  color: #ff69b4;
  margin-bottom: 20px;
  text-shadow: 0 0 20px rgba(255, 105, 180, 0.4);
}

.post-prayer-text {
  font-family: 'Handlee', cursive;
  font-size: clamp(18px, 3vw, 24px);
  color: #f0e6ff;
  line-height: 1.6;
  margin-bottom: 30px;
}

/* ---- STACKED PHOTO DECK ---- */
.photo-deck-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 30;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #0a0a15 0%, #1a0a1a 50%, #0a0a15 100%);
  animation: fadeIn 1s ease;
  overflow: hidden;
}

.deck-header {
  text-align: center;
  padding: 20px 20px 10px;
  flex-shrink: 0;
  z-index: 5;
}

.deck-title {
  font-family: 'Dancing Script', cursive;
  font-size: clamp(26px, 4.5vw, 44px);
  color: #ffd700;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
  margin-bottom: 6px;
}

.deck-subtitle {
  font-family: 'Handlee', cursive;
  font-size: clamp(13px, 2.2vw, 18px);
  color: rgba(255, 182, 193, 0.75);
}

/* ---- DECK CONTAINER ---- */
.deck-container {
  flex: 1;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 1200px;
  padding: 10px 20px 20px;
  overflow: hidden;
}

/* Individual photo card in the stack */
.deck-card {
  position: absolute;
  width: min(85vw, 420px);
  max-width: 420px;
  transition: all 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  user-select: none;
}

/* Card frame with polaroid style */
.deck-card-frame {
  background: #fff;
  padding: 12px 12px 55px 12px;
  border-radius: 10px;
  box-shadow: 
    0 15px 50px rgba(0,0,0,0.5),
    0 0 60px rgba(255, 107, 157, 0.06);
  position: relative;
  overflow: hidden;
}

/* Tape effect */
.deck-card-frame::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(-3deg);
  width: 55px;
  height: 16px;
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(2px);
  border-radius: 2px;
  z-index: 5;
}

/* Image area */
.deck-card-frame img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}

/* Text overlay - ABOVE the image */
.deck-card-text {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  padding: 18px 16px 30px;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.6) 0%,
    rgba(0, 0, 0, 0.35) 60%,
    transparent 100%
  );
  border-radius: 6px 6px 0 0;
  z-index: 3;
  pointer-events: none;
}

.deck-card-text p {
  font-family: 'Handlee', cursive;
  font-size: clamp(14px, 2.2vw, 18px);
  color: #fff;
  line-height: 1.5;
  text-shadow: 0 1px 6px rgba(0,0,0,0.7);
  margin: 0;
}

/* ---- STACK POSITIONS ---- */
/* Top card (active/current) */
.deck-card[data-position="top"] {
  z-index: 10;
  transform: translateY(0) rotate(0deg) scale(1);
  opacity: 1;
}

/* Second card (peek behind) */
.deck-card[data-position="behind-1"] {
  z-index: 9;
  transform: translateY(18px) rotate(1.5deg) scale(0.96);
  opacity: 0.85;
}

/* Third card */
.deck-card[data-position="behind-2"] {
  z-index: 8;
  transform: translateY(34px) rotate(-1deg) scale(0.92);
  opacity: 0.65;
}

/* Fourth card */
.deck-card[data-position="behind-3"] {
  z-index: 7;
  transform: translateY(48px) rotate(2deg) scale(0.88);
  opacity: 0.45;
}

/* Hidden cards */
.deck-card[data-position="hidden"] {
  z-index: 1;
  transform: translateY(60px) rotate(0deg) scale(0.85);
  opacity: 0;
  pointer-events: none;
}

/* Card exit animation (swiping away) */
.deck-card.exiting {
  animation: cardExit 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes cardExit {
  0% { transform: translateY(0) rotate(0deg) scale(1); opacity: 1; }
  100% { transform: translateY(-120%) rotate(-8deg) scale(0.8); opacity: 0; }
}

/* Card enter animation (coming from below) */
.deck-card.entering {
  animation: cardEnter 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes cardEnter {
  0% { transform: translateY(100px) rotate(5deg) scale(0.9); opacity: 0; }
  100% { transform: translateY(0) rotate(0deg) scale(1); opacity: 1; }
}

/* ---- DECK CONTROLS ---- */
.deck-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  padding: 15px 20px 30px;
  flex-shrink: 0;
  z-index: 5;
  background: linear-gradient(to top, rgba(10,10,21,0.95) 0%, transparent 100%);
}

.deck-btn {
  padding: 12px 26px;
  font-family: 'Quicksand', sans-serif;
  font-size: clamp(13px, 2vw, 15px);
  font-weight: 600;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  white-space: nowrap;
}

.deck-btn-back {
  color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
}

.deck-btn-back:hover {
  background: rgba(255,255,255,0.15);
  transform: translateY(-2px);
}

.deck-btn-next {
  color: #fff;
  background: linear-gradient(135deg, #ff6b9d, #c44569);
  box-shadow: 0 4px 20px rgba(255, 107, 157, 0.35);
}

.deck-btn-next:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(255, 107, 157, 0.5);
}

.deck-btn-next:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.deck-counter {
  font-family: 'Quicksand', sans-serif;
  font-size: clamp(13px, 2vw, 15px);
  color: rgba(255,255,255,0.5);
  letter-spacing: 2px;
  min-width: 60px;
  text-align: center;
}

/* ---- SWIPE HINT ---- */
.deck-swipe-hint {
  position: absolute;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Handlee', cursive;
  font-size: 14px;
  color: rgba(255,255,255,0.3);
  animation: hintPulse 2s ease-in-out infinite;
  pointer-events: none;
  z-index: 20;
}

@keyframes hintPulse {
  0%, 100% { opacity: 0.3; transform: translateX(-50%) translateY(0); }
  50% { opacity: 0.6; transform: translateX(-50%) translateY(-5px); }
}

/* ---- RESPONSIVE ---- */
@media (max-width: 480px) {
  .deck-container {
    padding: 5px 15px 15px;
  }

  .deck-card {
    width: 90vw;
  }

  .deck-card-frame {
    padding: 10px 10px 45px 10px;
  }

  .deck-card-text {
    top: 10px;
    left: 10px;
    right: 10px;
    padding: 14px 12px 25px;
  }

  .deck-card-text p {
    font-size: 14px;
  }

  .deck-controls {
    gap: 12px;
    padding: 12px 15px 25px;
  }

  .deck-btn {
    padding: 10px 18px;
    font-size: 13px;
  }

  /* Adjust stack spacing for small screens */
  .deck-card[data-position="behind-1"] {
    transform: translateY(12px) rotate(1.5deg) scale(0.96);
  }

  .deck-card[data-position="behind-2"] {
    transform: translateY(22px) rotate(-1deg) scale(0.92);
  }

  .deck-card[data-position="behind-3"] {
    transform: translateY(30px) rotate(2deg) scale(0.88);
  }
}

@media (min-width: 768px) {
  .deck-card {
    width: min(70vw, 480px);
    max-width: 480px;
  }

  .deck-card-frame {
    padding: 16px 16px 65px 16px;
  }

  .deck-card-text {
    top: 16px;
    left: 16px;
    right: 16px;
    padding: 22px 20px 35px;
  }

  .deck-card-text p {
    font-size: 18px;
  }
}

@media (min-width: 1200px) {
  .deck-card {
    width: min(55vw, 520px);
    max-width: 520px;
  }

  .deck-card-frame {
    padding: 18px 18px 70px 18px;
  }

  .deck-card-text p {
    font-size: 20px;
  }
}

/* ---- FINAL WISH ---- */
.final-wish {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 50;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(5, 5, 15, 0.95);
  animation: fadeIn 1.5s ease;
}

.final-content {
  text-align: center;
  max-width: 600px;
  padding: 40px;
}

.final-title {
  font-family: 'Dancing Script', cursive;
  font-size: clamp(36px, 6vw, 60px);
  color: #ffd700;
  margin-bottom: 25px;
  text-shadow: 0 0 30px rgba(255, 215, 0, 0.5), 0 0 60px rgba(255, 215, 0, 0.3);
  animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% { text-shadow: 0 0 30px rgba(255, 215, 0, 0.5), 0 0 60px rgba(255, 215, 0, 0.3); }
  50% { text-shadow: 0 0 50px rgba(255, 215, 0, 0.8), 0 0 100px rgba(255, 215, 0, 0.5); }
}

.final-message {
  font-family: 'Handlee', cursive;
  font-size: clamp(18px, 3vw, 24px);
  color: #e8d5f2;
  line-height: 1.7;
  margin-bottom: 30px;
}

.final-hearts {
  font-size: 40px;
  margin-bottom: 30px;
  animation: bounceHearts 1s ease-in-out infinite;
}

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

.final-hearts span {
  display: inline-block;
  margin: 0 5px;
  animation: heartFloat 2s ease-in-out infinite;
}

.final-hearts span:nth-child(1) { animation-delay: 0s; }
.final-hearts span:nth-child(2) { animation-delay: 0.2s; }
.final-hearts span:nth-child(3) { animation-delay: 0.4s; }
.final-hearts span:nth-child(4) { animation-delay: 0.6s; }
.final-hearts span:nth-child(5) { animation-delay: 0.8s; }

@keyframes heartFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-8px) rotate(-5deg); }
  75% { transform: translateY(-5px) rotate(5deg); }
}

.final-signature {
  font-family: 'Dancing Script', cursive;
  font-size: clamp(20px, 3vw, 28px);
  color: #ff69b4;
  text-shadow: 0 0 15px rgba(255, 105, 180, 0.4);
}

/* ---- FLOATING HEARTS ---- */
#heartsContainer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100;
  overflow: hidden;
}

.floating-heart {
  position: absolute;
  font-size: 24px;
  pointer-events: none;
  animation: floatUp 5s linear forwards;
}

@keyframes floatUp {
  0% { transform: translateY(100vh) scale(0.5) rotate(0deg); opacity: 1; }
  100% { transform: translateY(-10vh) scale(1.3) rotate(360deg); opacity: 0; }
}

/* ---- UTILITY ANIMATIONS ---- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* ---- RESPONSIVE ---- */
@media (max-width: 600px) {
  .notebook {
    height: 500px;
  }

  .page-content {
    padding: 30px 20px 30px 40px;
  }

  .photo-frame {
    aspect-ratio: 3/4;
  }

  .photo-nav {
    flex-direction: column;
    gap: 10px;
  }

  .notebook-nav {
    flex-direction: column;
    gap: 10px;
    bottom: -100px;
  }
}

/* ---- HIDE/SHOW UTILITIES ---- */
.hidden {
  display: none !important;
}

.fade-out {
  opacity: 0 !important;
  pointer-events: none;
}


/* ---- PHOTO MODAL MOBILE FIXES ---- */
@media (max-width: 768px) {
  .photo-modal {
    padding: 10px;
    align-items: flex-start;
    padding-top: 40px;
  }

  .photo-modal-content {
    gap: 12px;
  }

  .photo-main-area {
    gap: 8px;
  }

  .photo-arrow {
    width: 40px;
    height: 40px;
  }

  .photo-arrow svg {
    width: 18px;
    height: 18px;
  }

  .photo-frame {
    border-radius: 14px;
    max-width: 100%;
  }

  .photo-caption {
    font-size: 15px;
    padding: 0 10px;
  }

  .photo-counter {
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .photo-arrow {
    width: 36px;
    height: 36px;
    border-width: 1.5px;
  }

  .photo-arrow svg {
    width: 16px;
    height: 16px;
  }

  .photo-frame {
    aspect-ratio: 3/4;
  }
}