/* ===================================
   Halloween Surprise for Tanu
   Custom Styles - October 31, 2024
   =================================== */

/* CSS Variables */
:root {
  --bg: #0a0814;
  --fg: #ffffff;
  --accent: #ff69b4;
  --accent2: #ffd700;
  --card: #1a1625;
  --glow: #ff69b440;
  --halloween: #ff6b35;
  --purple: #9b59b6;
}

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

html, body {
  height: 100%;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: linear-gradient(135deg, #0a0814 0%, #1a0f2e 50%, #0a0814 100%);
  color: var(--fg);
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: 
    radial-gradient(circle at 20% 50%, var(--glow) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, #ffd70020 0%, transparent 50%);
  pointer-events: none;
  z-index: 1;
}

/* ===== ANIMATIONS ===== */
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50% { transform: translateY(-20px) rotate(5deg); }
}

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

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

@keyframes glow {
  0%, 100% { box-shadow: 0 0 20px rgba(255,105,180,0.5); }
  50% { box-shadow: 0 0 40px rgba(255,105,180,0.8); }
}

@keyframes sparkle-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}

@keyframes confetti-fall {
  0% {
    transform: translateY(-100vh) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

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

/* ===== LAYOUT ===== */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem;
  position: relative;
  z-index: 2;
}

/* ===== BACKGROUND ELEMENTS ===== */
.floating-hearts {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.heart-bg {
  position: absolute;
  font-size: 20px;
  animation: float 6s ease-in-out infinite;
  opacity: 0.1;
}

/* ===== HERO SECTION ===== */
.hero-card {
  background: linear-gradient(135deg, rgba(255,105,180,0.1), rgba(255,215,0,0.05));
  border: 1px solid rgba(255,105,180,0.2);
  border-radius: 24px;
  padding: 2.5rem;
  margin-bottom: 2rem;
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
  animation: slideInDown 0.8s ease-out;
}

.title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1rem;
  line-height: 1.1;
}

.subtitle {
  color: rgba(255,255,255,0.8);
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.handwritten {
  font-family: 'Caveat', cursive;
  font-size: 1.3rem;
  color: var(--accent);
  margin: 0.5rem 0;
}

/* ===== DISTANCE INFO ===== */
.distance-info {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
  margin: 1.5rem 0;
}

.location-badge {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 100px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
}

.location-badge:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(255,105,180,0.3);
}

.pulse {
  animation: pulse 2s infinite;
}

/* ===== PHOTO SECTION ===== */
.photo-section {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin: 2rem 0;
  flex-wrap: wrap;
}

.photo-frame {
  width: 180px;
  height: 240px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  padding: 3px;
  position: relative;
  animation: glow 3s ease-in-out infinite;
  transform: rotate(-2deg);
  transition: transform 0.3s ease;
}

.photo-frame:hover {
  transform: rotate(0deg) scale(1.05);
}

.photo-inner {
  width: 100%;
  height: 100%;
  border-radius: 17px;
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.tanu-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(1.05) contrast(1.05);
}

.photo-sparkle {
  position: absolute;
  top: -10px;
  right: -10px;
  font-size: 2rem;
  animation: sparkle-rotate 3s linear infinite;
}

/* ===== TASK CARDS ===== */
.task-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeInUp 0.6s ease-out forwards;
  position: relative;
  overflow: hidden;
}

.task-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s ease;
}

.task-card.completed::before {
  transform: scaleX(1);
}

.task-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.task-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.2rem;
}

.task-title {
  flex: 1;
  font-size: 1.2rem;
  font-weight: 600;
}

.halloween-badge {
  background: linear-gradient(135deg, var(--halloween), var(--purple));
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 500;
}

/* ===== STARS CANVAS ===== */
.stars-container {
  position: relative;
  height: 400px;
  border-radius: 20px;
  background: radial-gradient(ellipse at center, #1a0f2e 0%, #0a0814 100%);
  overflow: hidden;
  cursor: pointer;
  margin: 1rem 0;
}

#starsCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.stars-overlay {
  position: absolute;
  bottom: 20px;
  left: 20px;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(10px);
  padding: 1rem;
  border-radius: 12px;
  font-size: 0.9rem;
}

.star-count {
  color: var(--accent2);
  font-weight: bold;
}

/* ===== GARDEN ===== */
.garden {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding: 2rem;
  min-height: 200px;
  background: linear-gradient(180deg, transparent, rgba(34,139,34,0.1));
  border-radius: 20px;
  justify-content: center;
  align-items: center;
}

.tulip {
  font-size: 3rem;
  cursor: pointer;
  transition: all 0.3s ease;
  user-select: none;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.tulip:hover:not(.picked) {
  transform: translateY(-5px) scale(1.1);
  filter: drop-shadow(0 8px 16px rgba(255,105,180,0.5));
}

.tulip.picked {
  opacity: 0.3;
  transform: translateY(10px) scale(0.8);
  filter: grayscale(1);
  cursor: not-allowed;
}

/* ===== INTERACTION BOXES ===== */
.interaction-box {
  background: rgba(255,105,180,0.05);
  border: 2px dashed rgba(255,105,180,0.3);
  border-radius: 20px;
  padding: 2rem;
  text-align: center;
  margin: 1rem 0;
}

.mic-visual {
  width: 100px;
  height: 100px;
  margin: 1rem auto;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.mic-visual:hover {
  transform: scale(1.1);
  box-shadow: 0 0 30px rgba(255,105,180,0.6);
}

.mic-visual.listening {
  animation: pulse 1s infinite;
}

/* ===== CAMERA SECTION ===== */
.camera-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1rem 0;
}

.camera-box {
  background: #000;
  border-radius: 12px;
  padding: 1rem;
  position: relative;
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#videoElement {
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.heart-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.heart-guide {
  width: 150px;
  height: 150px;
  border: 3px dashed rgba(255,105,180,0.5);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  opacity: 0.5;
}

/* ===== LETTER & GIFT ===== */
.letter-container {
  background: linear-gradient(135deg, rgba(255,105,180,0.05), rgba(255,215,0,0.05));
  border: 1px solid rgba(255,105,180,0.2);
  border-radius: 20px;
  padding: 2.5rem;
  margin: 2rem 0;
  position: relative;
  overflow: hidden;
}

.letter-container::before {
  content: '💌';
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 2rem;
  opacity: 0.3;
}

.letter-text {
  font-family: 'Caveat', cursive;
  font-size: 1.5rem;
  line-height: 1.8;
  color: rgba(255,255,255,0.9);
  white-space: pre-wrap;
}

.gift-card-section {
  background: linear-gradient(135deg, #ff6b35, #ffd700);
  border-radius: 20px;
  padding: 2rem;
  text-align: center;
  margin: 2rem 0;
  position: relative;
  overflow: hidden;
}

.gift-card-section::before {
  content: '🌮';
  position: absolute;
  font-size: 10rem;
  opacity: 0.1;
  right: -2rem;
  bottom: -2rem;
  transform: rotate(-15deg);
}

.gift-code {
  background: rgba(0,0,0,0.3);
  border: 2px dashed rgba(255,255,255,0.5);
  border-radius: 12px;
  padding: 1.5rem;
  font-size: 1.5rem;
  font-family: monospace;
  letter-spacing: 2px;
  margin: 1rem 0;
  color: white;
  font-weight: bold;
  position: relative;
  z-index: 1;
}

/* ===== BUTTONS ===== */
.btn {
  background: linear-gradient(135deg, var(--accent), var(--purple));
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 100px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  margin: 0.5rem;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(255,105,180,0.4);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent);
}

/* ===== PROGRESS BAR ===== */
.progress-bar {
  height: 8px;
  background: rgba(255,255,255,0.1);
  border-radius: 100px;
  overflow: hidden;
  margin: 1rem 0;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 100px;
  width: 0%;
  transition: width 0.5s ease;
}

/* ===== UTILITY CLASSES ===== */
.hidden {
  display: none !important;
}

.fade-in {
  animation: fadeIn 1s ease-out;
}

.confetti {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
}

/* ===== FOOTER ===== */
.footer {
  text-align: center;
  padding: 2rem;
  color: rgba(255,255,255,0.5);
  font-size: 0.9rem;
}

.footer-heart {
  color: var(--accent);
  animation: heartbeat 1.5s ease-in-out infinite;
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  .hero-card {
    padding: 1.5rem;
  }

  .title {
    font-size: 2rem;
  }

  .photo-section {
    justify-content: center;
  }

  .distance-info {
    justify-content: center;
  }

  .camera-section {
    grid-template-columns: 1fr;
  }
}
