/* ===========================
   Romantic Valentine Theme
   =========================== */

/* ===========================
   Splash Screen
   =========================== */
#splash {
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#splash.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-content {
  animation: splashFadeIn 1s ease forwards;
}

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

.splash-pulse {
  animation: splashPulse 2s ease-in-out infinite;
}

@keyframes splashPulse {
  0%, 100% {
    opacity: 0.7;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
}

/* Background Gradient */
body {
  background: linear-gradient(135deg, #fce4ec 0%, #f8bbd0 25%, #f48fb1 50%, #ec407a 75%, #e91e63 100%);
  background-attachment: fixed;
}

/* ===========================
   Fade-in Animation on Load
   =========================== */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.8s ease forwards;
}

.fade-in:nth-child(1) { animation-delay: 0.1s; }
.fade-in:nth-child(2) { animation-delay: 0.2s; }
.fade-in:nth-child(3) { animation-delay: 0.3s; }
.fade-in:nth-child(4) { animation-delay: 0.4s; }
.fade-in:nth-child(5) { animation-delay: 0.5s; }

header.fade-in { animation-delay: 0s; }
footer.fade-in { animation-delay: 0.7s; }

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

/* ===========================
   3D Flip Card
   =========================== */
.flip-card {
  width: 250px;
  height: 350px;
  perspective: 1000px;
  cursor: pointer;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.7s cubic-bezier(0.4, 0.0, 0.2, 1);
  transform-style: preserve-3d;
}

.flip-card.flipped .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.15),
    0 0 20px rgba(236, 64, 122, 0.15);
}

/* Front Face */
.flip-card-front {
  background: #fff;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-front-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.45) 0%, transparent 50%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 1.25rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.flip-card:hover .card-front-overlay {
  opacity: 1;
}

.card-title {
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  letter-spacing: 0.02em;
  transform: translateY(8px);
  transition: transform 0.3s ease;
}

.flip-card:hover .card-title {
  transform: translateY(0);
}

/* Back Face */
.flip-card-back {
  background: linear-gradient(135deg, #fce4ec, #f8bbd0, #f48fb1);
  transform: rotateY(180deg);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.4);
}

.back-content {
  padding: 2rem 1.5rem;
  text-align: center;
  color: #880e4f;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.heart-icon {
  font-size: 2.5rem;
  color: #e91e63;
  animation: heartbeat 1.5s ease-in-out infinite;
}

.heart-divider {
  font-size: 1.5rem;
  color: #ec407a;
  opacity: 0.6;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.15); }
  30% { transform: scale(1); }
  45% { transform: scale(1.1); }
}

/* Hover Scale Effect */
.flip-card {
  transition: transform 0.3s ease;
}

.flip-card:hover {
  transform: scale(1.05);
}

/* ===========================
   Floating Hearts Background
   =========================== */
.floating-heart {
  position: absolute;
  bottom: -50px;
  color: rgba(255, 255, 255, 0.15);
  font-size: 1.5rem;
  animation: floatUp linear infinite;
  pointer-events: none;
  user-select: none;
}

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

/* ===========================
   Toast Notification
   =========================== */
.toast-show {
  animation: toastIn 0.5s ease forwards;
}

.toast-hide {
  animation: toastOut 0.5s ease forwards;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(30px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateX(-50%) translateY(30px) scale(0.9);
  }
}

.toast-inner {
  animation: toastGlow 2s ease-in-out infinite;
}

@keyframes toastGlow {
  0%, 100% {
    box-shadow: 0 4px 20px rgba(233, 30, 99, 0.15);
  }
  50% {
    box-shadow: 0 4px 30px rgba(233, 30, 99, 0.35);
  }
}

/* ===========================
   Music Player
   =========================== */
#music-player.playing {
  background: rgba(233, 30, 99, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
  animation: pulse-glow 2s ease-in-out infinite;
}

#music-player.playing #music-toggle {
  background: rgba(255, 255, 255, 0.4);
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 10px rgba(233, 30, 99, 0.3);
  }
  50% {
    box-shadow: 0 0 25px rgba(233, 30, 99, 0.5);
  }
}

/* Volume Slider */
.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  outline: none;
  transition: background 0.2s;
}

.volume-slider:hover {
  background: rgba(255, 255, 255, 0.45);
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s;
}

.volume-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.volume-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  border: none;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
}

.volume-slider::-moz-range-track {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  height: 4px;
}

/* ===========================
   Responsive Adjustments
   =========================== */
@media (max-width: 640px) {
  .flip-card {
    width: 280px;
    height: 380px;
  }
}

@media (min-width: 641px) and (max-width: 1023px) {
  .flip-card {
    width: 240px;
    height: 340px;
  }
}

/* ===========================
   Scrollbar Styling (Back Card)
   =========================== */
.back-content::-webkit-scrollbar {
  width: 4px;
}

.back-content::-webkit-scrollbar-track {
  background: transparent;
}

.back-content::-webkit-scrollbar-thumb {
  background: rgba(136, 14, 79, 0.3);
  border-radius: 2px;
}

/* ===========================
   Next Page Button
   =========================== */
#next-page-btn {
  animation: fadeInUp 0.8s ease forwards;
}

.reveal-btn {
  animation: revealPulse 2.5s ease-in-out infinite;
}

@keyframes revealPulse {
  0%, 100% {
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
  }
  50% {
    box-shadow: 0 0 35px rgba(255, 255, 255, 0.5);
  }
}

/* ===========================
   Reveal Page (7th Image)
   =========================== */
#reveal-page.visible {
  display: block;
}

.reveal-content {
  opacity: 0;
  transform: translateY(40px) scale(0.95);
  animation: revealContentIn 1s ease 0.3s forwards;
}

@keyframes revealContentIn {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.reveal-image-wrapper {
  max-width: 450px;
  width: 100%;
}

.reveal-image {
  width: 100%;
  height: auto;
  object-fit: cover;
  max-height: 60vh;
  border: 3px solid rgba(255, 255, 255, 0.3);
}

@media (max-width: 640px) {
  .reveal-image-wrapper {
    max-width: 320px;
  }
}
