/* ===================================
   GLOBAL STYLES & VARIABLES
   =================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #ff6b9d;
  --secondary-color: #feca57;
  --accent-color: #48dbfb;
  --dark-color: #2f3542;
  --light-color: #f1f2f6;
}

html,
body {
  width: 100%;
  height: 100%;
  font-family: "Arial", sans-serif;
  overflow: hidden;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* ===================================
   PAGE STRUCTURE
   =================================== */

.page {
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  opacity: 0;
  animation: pageTransition 0.8s ease-in-out forwards;
}

@keyframes pageTransition {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ===================================
   PAGE 1: WELCOME PAGE
   =================================== */

.welcome-page {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  flex-direction: column;
}

.background-animation {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}

.particle {
  position: absolute;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  animation: twinkle 3s infinite;
}

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

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

.welcome-container {
  position: relative;
  z-index: 10;
  text-align: center;
  width: 100%;
}

.birthday-text-container {
  margin-bottom: 40px;
}

.birthday-title {
  font-size: 4rem;
  font-weight: bold;
  color: white;
  letter-spacing: 8px;
  text-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px;
}

.letter {
  display: inline-block;
  animation: bounce 0.6s ease-in-out infinite;
}

.letter:nth-child(1) {
  animation-delay: 0s;
}
.letter:nth-child(2) {
  animation-delay: 0.1s;
}
.letter:nth-child(3) {
  animation-delay: 0.2s;
}
.letter:nth-child(4) {
  animation-delay: 0.3s;
}
.letter:nth-child(5) {
  animation-delay: 0.4s;
}
.letter:nth-child(6) {
  animation-delay: 0.5s;
}
.letter:nth-child(7) {
  animation-delay: 0.6s;
}
.letter:nth-child(8) {
  animation-delay: 0.7s;
}
.letter:nth-child(9) {
  animation-delay: 0.8s;
}
.letter:nth-child(10) {
  animation-delay: 0.9s;
}
.letter:nth-child(11) {
  animation-delay: 1s;
}
.letter:nth-child(12) {
  animation-delay: 1.1s;
}
.letter:nth-child(13) {
  animation-delay: 1.2s;
}
.letter:nth-child(14) {
  animation-delay: 1.3s;
}

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

/* Floating Hearts */
.floating-hearts {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
}

.heart {
  position: absolute;
  width: 30px;
  height: 30px;
  background: radial-gradient(circle at 30% 30%, #ffb6c1, #ff69b4);
  bottom: -50px;
  animation: floatUp 6s ease-in infinite;
}

.heart::before,
.heart::after {
  content: "";
  position: absolute;
  width: 30px;
  height: 50px;
  background: inherit;
  border-radius: 30px 30px 0 0;
  top: -25px;
}

.heart::before {
  left: -15px;
}

.heart::after {
  right: -15px;
}

@keyframes floatUp {
  0% {
    bottom: -50px;
    opacity: 1;
    transform: translateX(0) rotateZ(0deg);
  }
  100% {
    bottom: 110vh;
    opacity: 0;
    transform: translateX(100px) rotateZ(45deg);
  }
}

.heart:nth-child(1) {
  left: 10%;
  animation-delay: 0s;
}
.heart:nth-child(2) {
  left: 20%;
  animation-delay: 0.2s;
}
.heart:nth-child(3) {
  left: 30%;
  animation-delay: 0.4s;
}
.heart:nth-child(4) {
  left: 40%;
  animation-delay: 0.6s;
}
.heart:nth-child(5) {
  left: 50%;
  animation-delay: 0.8s;
}
.heart:nth-child(6) {
  left: 60%;
  animation-delay: 1s;
}
.heart:nth-child(7) {
  left: 70%;
  animation-delay: 1.2s;
}
.heart:nth-child(8) {
  left: 80%;
  animation-delay: 1.4s;
}

/* Confetti Canvas */
#confetti {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Gift Button */
.gift-button {
  position: relative;
  z-index: 20;
  padding: 18px 50px;
  font-size: 1.3rem;
  font-weight: bold;
  color: white;
  background: linear-gradient(135deg, #ff6b9d 0%, #ee5a6f 100%);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  margin-top: 30px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.gift-button:hover {
  transform: scale(1.1);
  box-shadow: 0 15px 40px rgba(255, 107, 157, 0.4);
}

.gift-button:active {
  transform: scale(0.95);
}

/* ===================================
   PAGE 2: MOBILE ALBUM PAGE
   =================================== */

.album-page {
  background: linear-gradient(135deg, #ffeaa7 0%, #fab1a0 100%);
  flex-direction: column;
  overflow-y: auto;
  padding: 20px 15px;
}

.album-background {
  position: absolute;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 255, 255, 0.3) 0%,
    rgba(255, 182, 193, 0.2) 100%
  );
  z-index: 0;
}

/* Album Header */
.album-header {
  position: relative;
  z-index: 10;
  text-align: center;
  margin-bottom: 20px;
  animation: slideDown 0.6s ease-out;
}

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

.album-title {
  font-size: 2rem;
  font-weight: bold;
  color: white;
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
  margin: 0 0 10px 0;
  letter-spacing: 1px;
}

.album-subtitle {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  margin: 0;
}

/* Album Container */
.album-container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 500px;
  margin: 0 auto 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 1;
}

.photo-card {
  width: 100%;
  background: white;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
  animation: photoEntry 0.5s ease-out;
}

@keyframes photoEntry {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.photo-card img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  display: block;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.photo-info {
  padding: 15px;
  text-align: center;
  background: linear-gradient(
    135deg,
    rgba(255, 107, 157, 0.1),
    rgba(255, 180, 0, 0.1)
  );
}

.photo-caption {
  margin: 0;
  font-size: 1rem;
  color: #2f3542;
  font-weight: 600;
}

/* Album Controls */
.album-controls {
  display: flex;
  justify-content: center;
  gap: 15px;
  position: relative;
  z-index: 10;
  margin-bottom: 20px;
}

.album-nav-button {
  padding: 12px 25px;
  font-size: 1rem;
  font-weight: bold;
  color: white;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  min-width: 120px;
}

.album-nav-button:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

.album-nav-button:active:not(:disabled) {
  transform: translateY(-1px);
}

.album-nav-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Dots Indicator */
.album-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  position: relative;
  z-index: 10;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.dot.active {
  background: white;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
  transform: scale(1.3);
}

.dot:hover {
  background: rgba(255, 255, 255, 0.8);
}

/* Book-related styles (kept for compatibility) */
.book-page {
  background: linear-gradient(135deg, #ffeaa7 0%, #fab1a0 100%);
  flex-direction: column;
}

.book-background {
  display: none;
}

.book-container {
  display: none;
}

.book-spine {
  display: none;
}

.page-content {
  display: none;
}

.page-number {
  display: none;
}

.book-controls {
  display: none;
}

.book-page-left,
.book-page-right {
  display: none;
}

/* Next Surprise Button */
.next-surprise-button {
  position: fixed;
  bottom: 30px;
  right: 30px;
  padding: 15px 40px;
  font-size: 1.1rem;
  font-weight: bold;
  color: white;
  background: linear-gradient(135deg, #ff6b9d 0%, #ee5a6f 100%);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  z-index: 25;
}

.next-surprise-button:hover {
  transform: scale(1.1);
  box-shadow: 0 15px 40px rgba(255, 107, 157, 0.4);
}

/* Floating Flowers */
.floating-flowers {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 5;
}

.flower {
  position: absolute;
  width: 40px;
  height: 40px;
  bottom: -50px;
  animation: floatUpSlow 8s ease-in infinite;
}

.flower::before {
  content: "🌸";
  font-size: 2rem;
}

@keyframes floatUpSlow {
  0% {
    bottom: -50px;
    opacity: 1;
  }
  100% {
    bottom: 110vh;
    opacity: 0;
  }
}

.flower:nth-child(1) {
  left: 15%;
  animation-delay: 0s;
}
.flower:nth-child(2) {
  left: 50%;
  animation-delay: 2s;
}
.flower:nth-child(3) {
  left: 80%;
  animation-delay: 4s;
}

/* ===================================
   PAGE 3: FINAL PAGE
   =================================== */

.final-page {
  background: linear-gradient(135deg, #ff9a56 0%, #ff6b9d 100%);
  flex-direction: column;
}

.final-background {
  position: absolute;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0.05) 100%
  );
}

.final-container {
  position: relative;
  z-index: 10;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
}

/* Cake Animation */
.cake-container {
  margin-bottom: 20px;
  animation: cakeBounce 1s ease-in-out infinite;
}

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

.cake {
  position: relative;
  width: 120px;
  height: 140px;
}

.cake-layer {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 0 0 20px 20px;
}

.cake-layer.bottom {
  width: 120px;
  height: 50px;
  background: linear-gradient(135deg, #ff6b9d 0%, #ee5a6f 100%);
  bottom: 0;
  box-shadow:
    inset 0 2px 5px rgba(255, 255, 255, 0.3),
    0 10px 20px rgba(0, 0, 0, 0.2);
}

.cake-layer.middle {
  width: 100px;
  height: 45px;
  background: linear-gradient(135deg, #feca57 0%, #ff9f43 100%);
  bottom: 45px;
  border-radius: 10px 10px 20px 20px;
}

.cake-layer.top {
  width: 80px;
  height: 40px;
  background: linear-gradient(135deg, #48dbfb 0%, #0abde3 100%);
  bottom: 85px;
  border-radius: 15px 15px 20px 20px;
}

.candle {
  position: absolute;
  width: 8px;
  height: 50px;
  background: #f4e4c1;
  left: 50%;
  top: -50px;
  transform: translateX(-50%);
  border-radius: 5px;
}

.flame {
  position: absolute;
  width: 15px;
  height: 20px;
  background: radial-gradient(ellipse at center, #ffeb3b 0%, #ff9800 100%);
  left: 50%;
  top: -60px;
  transform: translateX(-50%);
  border-radius: 50% 50% 50% 0;
  animation: flameFlicker 0.5s ease-in-out infinite;
}

@keyframes flameFlicker {
  0%,
  100% {
    transform: translateX(-50%) rotate(0deg);
  }
  25% {
    transform: translateX(-50%) rotate(5deg);
  }
  50% {
    transform: translateX(-50%) rotate(-5deg);
  }
  75% {
    transform: translateX(-50%) rotate(3deg);
  }
}

/* Final Message */
.message-container {
  animation: messageSlideIn 0.8s ease-out;
}

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

.final-title {
  font-size: 3.5rem;
  font-weight: bold;
  color: white;
  text-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
  margin-bottom: 20px;
  letter-spacing: 3px;
}

.final-message {
  font-size: 1.3rem;
  color: white;
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
  margin: 10px 0;
  font-weight: 500;
}

.final-message.special {
  font-size: 1.5rem;
  margin-top: 20px;
  animation: pulse 2s ease-in-out infinite;
}

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

/* Floating Hearts Final */
.floating-hearts-final {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
}

.heart-final {
  position: absolute;
  width: 25px;
  height: 25px;
  background: radial-gradient(circle at 30% 30%, #ffb6c1, #ff69b4);
  bottom: -50px;
  animation: floatUp 5s ease-in infinite;
}

.heart-final::before,
.heart-final::after {
  content: "";
  position: absolute;
  width: 25px;
  height: 40px;
  background: inherit;
  border-radius: 25px 25px 0 0;
  top: -20px;
}

.heart-final::before {
  left: -12px;
}

.heart-final::after {
  right: -12px;
}

.heart-final:nth-child(1) {
  left: 15%;
  animation-delay: 0s;
}
.heart-final:nth-child(2) {
  left: 35%;
  animation-delay: 0.3s;
}
.heart-final:nth-child(3) {
  left: 50%;
  animation-delay: 0.6s;
}
.heart-final:nth-child(4) {
  left: 65%;
  animation-delay: 0.9s;
}
.heart-final:nth-child(5) {
  left: 85%;
  animation-delay: 1.2s;
}

/* Floating Balloons */
.floating-balloons {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 5;
}

.balloon {
  position: absolute;
  width: 50px;
  height: 60px;
  bottom: -100px;
  border-radius: 50% 50% 50% 0;
  animation: floatBalloon 6s ease-in infinite;
  transform: rotate(-45deg);
}

.balloon::after {
  content: "";
  position: absolute;
  width: 2px;
  height: 80px;
  background: #ccc;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
}

.balloon.red {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
}
.balloon.blue {
  background: linear-gradient(135deg, #48dbfb 0%, #0abde3 100%);
}
.balloon.yellow {
  background: linear-gradient(135deg, #feca57 0%, #ff9f43 100%);
}
.balloon.pink {
  background: linear-gradient(135deg, #ff9a56 0%, #ff6b9d 100%);
}
.balloon.purple {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

@keyframes floatBalloon {
  0% {
    bottom: -100px;
    opacity: 1;
    transform: rotate(-45deg) translateX(0);
  }
  100% {
    bottom: 110vh;
    opacity: 0;
    transform: rotate(-45deg) translateX(100px);
  }
}

/* Replay Button */
.replay-button {
  position: relative;
  z-index: 20;
  padding: 15px 40px;
  font-size: 1.1rem;
  font-weight: bold;
  color: white;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  margin-top: 20px;
}

.replay-button:hover {
  transform: scale(1.1);
  box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

.replay-button:active {
  transform: scale(0.95);
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */

@media (max-width: 768px) {
  .birthday-title {
    font-size: 2.5rem;
    letter-spacing: 3px;
  }

  .gift-button {
    padding: 15px 35px;
    font-size: 1rem;
  }

  /* Album responsive */
  .album-title {
    font-size: 1.8rem;
  }

  .photo-card img {
    height: 350px;
  }

  .album-nav-button {
    padding: 10px 20px;
    font-size: 0.9rem;
    min-width: 100px;
  }

  .final-title {
    font-size: 2.5rem;
  }

  .final-message {
    font-size: 1.1rem;
  }

  .next-surprise-button {
    padding: 12px 30px;
    font-size: 0.95rem;
    bottom: 20px;
    right: 20px;
  }
}

@media (max-width: 480px) {
  .birthday-title {
    font-size: 2rem;
    letter-spacing: 2px;
  }

  .gift-button {
    padding: 12px 25px;
    font-size: 0.9rem;
  }

  /* Mobile Album Styles */
  .album-page {
    padding: 15px 10px;
  }

  .album-title {
    font-size: 1.5rem;
    margin-bottom: 8px;
  }

  .album-subtitle {
    font-size: 0.95rem;
  }

  .album-container {
    margin-bottom: 20px;
  }

  .photo-card img {
    height: 300px;
  }

  .photo-info {
    padding: 12px;
  }

  .photo-caption {
    font-size: 0.95rem;
  }

  .album-controls {
    gap: 10px;
    margin-bottom: 15px;
  }

  .album-nav-button {
    padding: 10px 15px;
    font-size: 0.85rem;
    min-width: 90px;
  }

  .dot {
    width: 10px;
    height: 10px;
  }

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

  .final-message {
    font-size: 1rem;
  }

  .cake-container {
    transform: scale(0.8);
  }

  .next-surprise-button {
    padding: 12px 25px;
    font-size: 0.9rem;
    position: static;
    margin-top: 15px;
  }
}
