/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Caveat', cursive;
  background: linear-gradient(135deg, #8B0000 0%, #FF69B4 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Password screen */
.password-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #8B0000 0%, #FF69B4 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.password-card {
  background: linear-gradient(to bottom, #fffef9, #f5f0e1);
  padding: 40px;
  border-radius: 4px;
  text-align: center;
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.1),
    0 10px 40px rgba(0, 0, 0, 0.2);
}

.password-prompt {
  font-family: 'Caveat', cursive;
  font-size: 1.8rem;
  color: #4a3728;
  margin-bottom: 20px;
}

.password-input {
  font-family: 'Caveat', cursive;
  font-size: 1.4rem;
  padding: 10px 20px;
  border: 2px solid rgba(139, 0, 0, 0.3);
  border-radius: 25px;
  outline: none;
  text-align: center;
  width: 200px;
}

.password-input:focus {
  border-color: #8B0000;
}

.password-submit {
  margin-left: 10px;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #8B0000, #c41e3a);
  color: white;
  font-size: 18px;
  cursor: pointer;
  transition: transform 0.3s;
}

.password-submit:hover {
  transform: scale(1.1);
}

.password-error {
  color: #8B0000;
  font-size: 1rem;
  margin-top: 15px;
  height: 20px;
}

/* Music player */
.music-player {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
}

.music-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.2);
  color: white;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  transition: all 0.3s;
}

.music-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

/* Sparkle layer */
.sparkles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.sparkle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: white;
  border-radius: 50%;
  opacity: 0;
  animation: sparkle 3s infinite;
}

@keyframes sparkle {
  0%, 100% { opacity: 0; transform: scale(0); }
  50% { opacity: 0.8; transform: scale(1); }
}

/* Floating polaroids container */
.floating-polaroids {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}

.floating-polaroid {
  position: absolute;
  pointer-events: none;
  opacity: 0.7;
  animation: floatDrift 25s infinite linear;
  animation-fill-mode: backwards;
}

.polaroid-frame {
  background: white;
  padding: 8px 8px 30px 8px;
  box-shadow:
    0 4px 8px rgba(0, 0, 0, 0.3),
    0 0 20px rgba(0, 0, 0, 0.1);
  border-radius: 2px;
}

.polaroid-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@keyframes floatDrift {
  0% {
    transform: translateY(110vh) rotate(var(--start-rotation, -10deg));
  }
  100% {
    transform: translateY(-120vh) rotate(var(--end-rotation, 10deg));
  }
}

/* Letter container */
.letter-container {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
}

/* Letter card */
.letter-card {
  background: linear-gradient(to bottom, #fffef9, #f5f0e1);
  max-width: 600px;
  width: 100%;
  padding: 30px;
  border-radius: 4px;
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.1),
    0 10px 40px rgba(0, 0, 0, 0.2),
    inset 0 0 60px rgba(139, 69, 19, 0.05);
  position: relative;
}

.letter-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 1px solid rgba(139, 69, 19, 0.1);
  border-radius: 4px;
  pointer-events: none;
}

/* Slides container */
.slides-container {
  position: relative;
}

.slide {
  display: none;
  color: #4a3728;
  font-size: 1.4rem;
  line-height: 1.8;
}

.slide.active {
  display: block;
  animation: fadeIn 0.4s ease-out;
}

.slide p {
  margin-bottom: 1em;
}

.slide .greeting {
  font-size: 2.5rem;
  text-align: center;
  margin: 30px 0;
}

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

/* Slide navigation */
.slide-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid rgba(139, 69, 19, 0.1);
}

.nav-arrow {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #8B0000;
  background: transparent;
  color: #8B0000;
  cursor: pointer;
  font-size: 18px;
  transition: all 0.3s;
}

.nav-arrow:hover:not(:disabled) {
  background: #8B0000;
  color: white;
}

.nav-arrow:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.slide-dots {
  display: flex;
  gap: 8px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(139, 0, 0, 0.3);
  cursor: pointer;
  transition: all 0.3s;
}

.dot.active {
  background: #8B0000;
  transform: scale(1.2);
}

.dot:hover {
  background: rgba(139, 0, 0, 0.6);
}

/* Valentine prompt (in last slide) */
.valentine-prompt {
  text-align: center;
  margin-top: 30px;
}

.prompt-text {
  font-size: 1.8rem;
  color: #8B0000;
  margin-bottom: 20px;
}

.buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
}

/* Audio player */
.audio-player {
  margin: 20px 0;
  padding: 15px;
  background: rgba(139, 0, 0, 0.05);
  border-radius: 8px;
}

.audio-label {
  font-size: 1rem;
  color: #8B0000;
  margin-bottom: 10px;
  text-align: center;
  font-family: 'Caveat', cursive;
}

.audio-controls {
  display: flex;
  align-items: center;
  gap: 15px;
}

.play-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #8B0000;
  background: white;
  color: #8B0000;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.play-btn:hover {
  background: #8B0000;
  color: white;
}

.progress-container {
  flex: 1;
  height: 6px;
  background: rgba(139, 0, 0, 0.2);
  border-radius: 3px;
  cursor: pointer;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: #8B0000;
  border-radius: 3px;
  transition: width 0.1s;
}

/* Valentine prompt */
.valentine-prompt {
  text-align: center;
  margin-top: 30px;
}

.prompt-text {
  font-size: 1.8rem;
  color: #8B0000;
  margin-bottom: 20px;
}

.buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
}

.btn {
  padding: 12px 40px;
  font-family: 'Caveat', cursive;
  font-size: 1.3rem;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-yes {
  background: linear-gradient(135deg, #8B0000, #c41e3a);
  color: white;
  box-shadow: 0 4px 15px rgba(139, 0, 0, 0.3);
}

.btn-yes:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(139, 0, 0, 0.4);
}

.btn-no {
  background: #f0f0f0;
  color: #666;
  position: relative;
  transition: left 0.1s, top 0.1s;
}

.btn-no:hover {
  background: #e0e0e0;
}

.btn-no.bounce {
  animation: bounce 0.6s cubic-bezier(0.28, 0.84, 0.42, 1);
}

@keyframes bounce {
  0% { transform: scale(1) translateY(0); }
  15% { transform: scale(1.1, 0.85) translateY(0); }
  30% { transform: scale(0.9, 1.1) translateY(-25px); }
  45% { transform: scale(1.05, 0.95) translateY(0); }
  60% { transform: scale(0.97, 1.03) translateY(-10px); }
  75% { transform: scale(1.02, 0.98) translateY(0); }
  90% { transform: scale(0.99, 1.01) translateY(-3px); }
  100% { transform: scale(1) translateY(0); }
}

/* Success message */
.success-message {
  display: none;
  text-align: center;
  margin-top: 20px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 10px;
}

.success-message.show {
  display: block;
  animation: fadeInUp 0.5s forwards;
}

.success-message p {
  font-size: 2rem;
  color: #8B0000;
}

/* Brighter mode after "Yes" */
body.celebration {
  background: linear-gradient(135deg, #FF69B4 0%, #FFB6C1 100%);
}

/* Celebration video in card */
.video-container {
  display: flex;
  justify-content: center;
}

.celebration-video {
  max-width: 100%;
  max-height: 400px;
  border-radius: 4px;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  html, body {
    overflow-y: auto;
  }

  .letter-card {
    padding: 25px;
    margin: 20px;
  }

  .letter-content {
    font-size: 1.25rem;
  }

  .prompt-text {
    font-size: 1.5rem;
  }

  .btn {
    padding: 10px 30px;
    font-size: 1.1rem;
  }

  .floating-polaroid {
    opacity: 0.5;
  }

  .polaroid-frame {
    padding: 5px 5px 20px 5px;
  }
}
