/* ============================================================
   STYLES.CSS - Premium Princess Kingdom Theme
   Arleth Marina - 2 Años
   ============================================================ */

/* ---- IMPORTS ---- */
@import url('https://fonts.googleapis.com/css2?family=Great+Vibes&family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,400&family=Outfit:wght@300;400;500;600&display=swap');

/* ---- DESIGN TOKENS ---- */
:root {
  --pink: #F8C8DC;
  --pink-light: #FFE4EE;
  --pink-deep: #E8A0B8;
  --mint: #98D4BB;
  --mint-light: #B5EAD7;
  --mint-deep: #6CB89E;
  --gold: #D4A574;
  --gold-light: #E8C89E;
  --gold-shimmer: #FFD700;
  --pearl: #FFF8F0;
  --cream: #FFFAF5;
  --dark: #0A0A1A;
  --dark-purple: #1a0a2e;
  --text-dark: #3a2a3e;
  --text-muted: #7a6a7e;

  --font-display: 'Great Vibes', cursive;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Outfit', sans-serif;

  --shadow-soft: 0 4px 30px rgba(248, 200, 220, 0.2);
  --shadow-gold: 0 0 30px rgba(212, 165, 116, 0.3);
  --shadow-glow: 0 0 60px rgba(248, 200, 220, 0.4);

  --radius: 20px;
  --radius-sm: 12px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  color: var(--text-dark);
  background: var(--dark);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   SECTION 1: INTRO SCREEN
   ============================================================ */
#intro-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, var(--dark-purple) 0%, var(--dark) 70%);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

#intro-screen.fade-out {
  opacity: 0;
  transform: scale(1.05);
  pointer-events: none;
}

#particles-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.intro-content {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 2rem;
}

.intro-sparkle {
  font-size: 3rem;
  display: block;
  margin-bottom: 1rem;
  animation: float 3s ease-in-out infinite;
}

.intro-content h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 8vw, 4.5rem);
  color: var(--gold-light);
  text-shadow: 0 0 40px rgba(212, 165, 116, 0.5), 0 0 80px rgba(212, 165, 116, 0.2);
  margin-bottom: 0.5rem;
  animation: fadeInUp 1.5s ease both;
  line-height: 1.3;
}

.intro-subtitle {
  font-family: var(--font-serif);
  font-size: clamp(0.9rem, 3vw, 1.3rem);
  color: var(--pink);
  opacity: 0.8;
  margin-bottom: 2.5rem;
  animation: fadeInUp 1.5s ease 0.3s both;
  font-style: italic;
}

#enter-btn {
  position: relative;
  font-family: var(--font-serif);
  font-size: clamp(1rem, 3.5vw, 1.3rem);
  font-weight: 600;
  color: var(--dark);
  background: linear-gradient(135deg, var(--gold-light), var(--gold), var(--gold-light));
  border: 2px solid var(--gold-shimmer);
  padding: 1rem 2.5rem;
  border-radius: 50px;
  cursor: pointer;
  overflow: hidden;
  animation: fadeInUp 1.5s ease 0.6s both, pulse-glow 2.5s ease-in-out infinite 2s;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  letter-spacing: 0.5px;
}

#enter-btn:hover, #enter-btn:active {
  transform: scale(1.05);
  box-shadow: 0 0 40px rgba(255, 215, 0, 0.5), 0 0 80px rgba(212, 165, 116, 0.3);
}

#enter-btn::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -60%;
  width: 40%;
  height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  transform: skewX(-20deg);
  animation: shimmer 3s ease-in-out infinite;
}

/* ============================================================
   SECTION 2: CINEMATIC SCENE
   ============================================================ */
#scene-container {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  opacity: 0;
  transition: opacity 0.6s ease;
  overflow: hidden;
  background: #050315;
}
#scene-container.visible { display: block; opacity: 1; }

.scene-wrapper { position: absolute; inset: 0; }

.scene-layer {
  position: absolute; inset: 0;
  opacity: 0;
  transition: opacity 1.5s ease;
}
.scene-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}

.vignette {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(5,3,15,0.6) 100%);
  pointer-events: none; z-index: 2;
}

/* --- FOREST --- */
.phase-forest .forest-layer { opacity: 1; }
.phase-forest .forest-img { animation: forest-fly 4s ease-in-out forwards; }

.forest-text-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 4;
  pointer-events: none;
  gap: 0.5rem;
}
.forest-line {
  font-family: var(--font-display);
  color: #fff;
  opacity: 0;
  text-shadow: 0 0 30px rgba(255,220,180,0.8), 0 0 60px rgba(255,215,0,0.4), 0 3px 20px rgba(0,0,0,0.7);
}
.forest-line.l1 { font-size: clamp(2rem, 7vw, 4rem); }
.forest-line.l2 { font-size: clamp(1.2rem, 4vw, 2.2rem); font-family: var(--font-serif); font-style: italic; }

.phase-forest .forest-line.l1 { animation: story-text-in 2s ease 0.5s forwards; }
.phase-forest .forest-line.l2 { animation: story-text-in 2s ease 1.5s forwards; }

/* --- CASTLE --- */
.phase-castle .castle-layer { opacity: 1; }
.phase-castle .castle-img {
  animation: castle-approach 5.5s ease-out forwards;
  filter: brightness(1.05) saturate(1.15);
}

.castle-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 4; pointer-events: none;
  padding-bottom: 10%;
}
.castle-overlay > * { opacity: 0; }

.castle-pre-text {
  font-family: var(--font-serif);
  font-size: clamp(1rem, 3.5vw, 1.6rem);
  color: rgba(255,255,255,0.9);
  font-style: italic;
  text-shadow: 0 2px 15px rgba(0,0,0,0.6);
  margin-bottom: 0.3rem;
}
.phase-castle .castle-pre-text { animation: text-glow-in 1.5s ease 1s forwards; }
.phase-castle .castle-number-wrap { animation: text-glow-in 1.5s ease 1.8s forwards; }
.phase-castle .castle-label { animation: text-glow-in 1.5s ease 2.8s forwards; }
.phase-castle .castle-sub { animation: text-glow-in 1.5s ease 3.5s forwards; }

.castle-number-wrap { text-align: center; }
.castle-number {
  font-family: var(--font-display);
  font-size: clamp(6rem, 22vw, 14rem);
  color: #FFD700;
  text-shadow: 0 0 50px rgba(255,215,0,0.8), 0 0 120px rgba(255,215,0,0.4), 0 5px 25px rgba(0,0,0,0.5);
  line-height: 1;
}
.castle-label {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 9vw, 5rem);
  color: #fff;
  text-shadow: 0 0 40px rgba(255,200,220,0.9), 0 0 80px rgba(248,200,220,0.5), 0 4px 20px rgba(0,0,0,0.7);
}
.castle-sub {
  font-family: var(--font-serif);
  font-size: clamp(1rem, 3.5vw, 1.6rem);
  color: rgba(255,255,255,0.9);
  font-style: italic;
  margin-top: 0.5rem;
  text-shadow: 0 2px 15px rgba(0,0,0,0.6);
}

.castle-sparkles { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.sparkle-dot {
  position: absolute;
  background: #FFD700;
  border-radius: 50%;
  box-shadow: 0 0 8px 3px rgba(255,215,0,0.5);
  animation: sparkle-twinkle ease-in-out infinite;
}

/* --- DOORS --- */
.phase-doors .doors-layer { opacity: 1; }
.phase-doors .doors-img {
  animation: doors-zoom 3s ease-out forwards;
  filter: brightness(1.1) saturate(1.1);
}

.doors-text-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4;
  pointer-events: none;
}
.doors-line {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 6vw, 3.5rem);
  color: #FFD700;
  opacity: 0;
  text-shadow: 0 0 40px rgba(255,215,0,0.8), 0 0 80px rgba(255,245,220,0.5), 0 4px 20px rgba(0,0,0,0.6);
}
.phase-doors .doors-line { animation: text-glow-in 1.5s ease 0.5s forwards; }

.light-overlay {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 50%, transparent 30%, transparent 100%);
  z-index: 5; pointer-events: none;
  transition: background 1.5s ease;
}
.phase-light .light-overlay {
  background: radial-gradient(ellipse at 50% 50%, rgba(255,255,255,1) 0%, rgba(255,248,230,0.95) 40%, rgba(255,245,220,0.8) 100%);
}

/* --- KEYFRAMES --- */
@keyframes forest-fly {
  0% { transform: scale(1) translateZ(0); filter: brightness(0.3); }
  20% { filter: brightness(1); }
  100% { transform: scale(1.8) translateZ(0); filter: brightness(1.3) blur(3px); }
}

@keyframes castle-approach {
  0% { transform: scale(1.5) translateZ(0); filter: blur(8px) brightness(0.5); }
  35% { filter: blur(0) brightness(0.9); }
  100% { transform: scale(1.05) translateZ(0); filter: blur(0) brightness(1.05); }
}

@keyframes text-glow-in {
  0% { opacity: 0; transform: translateY(30px) scale(0.85); filter: blur(6px); }
  100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

@keyframes story-text-in {
  0% { opacity: 0; transform: translateY(20px); filter: blur(4px); }
  50% { opacity: 1; transform: translateY(0); filter: blur(0); }
  100% { opacity: 1; transform: translateY(0); filter: blur(0); }
}

@keyframes doors-zoom {
  0% { transform: scale(1) translateZ(0); }
  100% { transform: scale(1.3) translateZ(0); }
}

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

/* ============================================================
   SECTION 3: INVITATION
   ============================================================ */
#invitation-section {
  display: none;
  min-height: 100vh;
  background: linear-gradient(180deg, var(--pearl) 0%, var(--pink-light) 50%, var(--mint-light) 100%);
  padding: 2rem 1rem;
  position: relative;
  overflow: hidden;
}

#invitation-section.visible {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  padding-top: 3rem;
  padding-bottom: 4rem;
}

/* Floating decorative elements */
#invitation-section::before {
  content: '✨';
  position: fixed;
  top: 10%;
  left: 5%;
  font-size: 1.5rem;
  animation: float 4s ease-in-out infinite;
  opacity: 0.4;
  pointer-events: none;
}

#invitation-section::after {
  content: '🌸';
  position: fixed;
  top: 15%;
  right: 8%;
  font-size: 1.2rem;
  animation: float 5s ease-in-out infinite 1s;
  opacity: 0.4;
  pointer-events: none;
}

/* ---- INVITATION CARD ---- */
.invitation-card {
  position: relative;
  width: 100%;
  max-width: 520px;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(212, 165, 116, 0.3);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-soft), var(--shadow-gold);
  text-align: center;
  opacity: 0;
  transform: translateY(40px) scale(0.95);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.invitation-card.animate-in {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Floral corner decorations */
.floral-corner {
  position: absolute;
  width: 80px;
  height: 80px;
  opacity: 0.6;
}

.floral-corner::before,
.floral-corner::after {
  content: '';
  position: absolute;
  border-radius: 50%;
}

.top-left {
  top: -5px;
  left: -5px;
}
.top-left::before {
  width: 30px; height: 30px;
  background: radial-gradient(circle, var(--pink) 30%, transparent 70%);
  top: 8px; left: 8px;
}
.top-left::after {
  width: 20px; height: 20px;
  background: radial-gradient(circle, var(--mint) 30%, transparent 70%);
  top: 25px; left: 28px;
}

.top-right {
  top: -5px;
  right: -5px;
}
.top-right::before {
  width: 30px; height: 30px;
  background: radial-gradient(circle, var(--pink) 30%, transparent 70%);
  top: 8px; right: 8px;
}
.top-right::after {
  width: 20px; height: 20px;
  background: radial-gradient(circle, var(--mint) 30%, transparent 70%);
  top: 25px; right: 28px;
}

.bottom-left {
  bottom: -5px;
  left: -5px;
}
.bottom-left::before {
  width: 25px; height: 25px;
  background: radial-gradient(circle, var(--mint) 30%, transparent 70%);
  bottom: 8px; left: 8px;
}
.bottom-left::after {
  width: 18px; height: 18px;
  background: radial-gradient(circle, var(--pink) 30%, transparent 70%);
  bottom: 22px; left: 28px;
}

.bottom-right {
  bottom: -5px;
  right: -5px;
}
.bottom-right::before {
  width: 25px; height: 25px;
  background: radial-gradient(circle, var(--mint) 30%, transparent 70%);
  bottom: 8px; right: 8px;
}
.bottom-right::after {
  width: 18px; height: 18px;
  background: radial-gradient(circle, var(--pink) 30%, transparent 70%);
  bottom: 22px; right: 28px;
}

/* Gold top border accent */
.invitation-card::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), var(--gold-shimmer), var(--gold), transparent);
  border-radius: 2px;
}

.crown-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  animation: float 3s ease-in-out infinite;
}

.card-subtitle {
  font-family: var(--font-serif);
  font-size: clamp(1rem, 3.5vw, 1.2rem);
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.card-highlight {
  font-family: var(--font-serif);
  font-size: clamp(1.2rem, 4vw, 1.6rem);
  color: var(--text-dark);
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.card-highlight .age-number {
  font-family: var(--font-display);
  font-size: 1.4em;
  color: var(--gold);
  text-shadow: 0 0 10px rgba(212, 165, 116, 0.3);
}

.divider {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 1rem auto;
}

.child-name {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 8vw, 3.5rem);
  color: var(--gold);
  text-shadow: 0 2px 10px rgba(212, 165, 116, 0.2);
  margin-bottom: 0.3rem;
  line-height: 1.2;
}

.invite-text {
  font-family: var(--font-serif);
  font-size: clamp(1rem, 3vw, 1.2rem);
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 1.5rem;
}

/* Event details */
.event-details {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-top: 1rem;
}

.detail-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 1rem;
  background: rgba(248, 200, 220, 0.12);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(212, 165, 116, 0.15);
  text-align: left;
}

.detail-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  width: 2.2rem;
  height: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--pink-light), var(--mint-light));
  border-radius: 50%;
}

.detail-info {
  display: flex;
  flex-direction: column;
}

.detail-label {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
}

.detail-value {
  font-family: var(--font-serif);
  font-size: clamp(0.95rem, 2.5vw, 1.1rem);
  font-weight: 600;
  color: var(--text-dark);
}

/* ============================================================
   RSVP SECTION
   ============================================================ */
.rsvp-section {
  width: 100%;
  max-width: 520px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(152, 212, 187, 0.3);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.rsvp-section.animate-in {
  opacity: 1;
  transform: translateY(0);
}

.rsvp-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  color: var(--gold);
  text-align: center;
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1.2rem;
}

.form-group label:not(.radio-option) {
  display: block;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.4rem;
}

.form-group input[type="text"],
.form-group select {
  width: 100%;
  padding: 0.85rem 1rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  border: 1.5px solid rgba(212, 165, 116, 0.3);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.6);
  color: var(--text-dark);
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  -webkit-appearance: none;
}

.form-group input[type="text"]:focus,
.form-group select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.15);
}

.form-group select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23D4A574' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

/* Radio buttons */
.radio-group {
  display: flex;
  gap: 0.8rem;
  margin-top: 0.4rem;
}

.radio-option {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border: 1.5px solid rgba(212, 165, 116, 0.3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.5);
}

.radio-option:has(input:checked) {
  border-color: var(--gold);
  background: linear-gradient(135deg, rgba(212, 165, 116, 0.1), rgba(248, 200, 220, 0.15));
  box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.1);
}

.radio-option input[type="radio"] {
  accent-color: var(--gold);
  width: 16px;
  height: 16px;
}

/* Submit button */
#rsvp-submit {
  width: 100%;
  padding: 1rem;
  margin-top: 0.5rem;
  font-family: var(--font-serif);
  font-size: clamp(1rem, 3vw, 1.15rem);
  font-weight: 600;
  color: var(--dark);
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  border: none;
  border-radius: 50px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  letter-spacing: 0.3px;
}

#rsvp-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(212, 165, 116, 0.4);
}

#rsvp-submit:active:not(:disabled) {
  transform: translateY(0);
}

#rsvp-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

#rsvp-submit::after {
  content: '';
  position: absolute;
  top: -50%; left: -60%;
  width: 40%; height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
  transform: skewX(-20deg);
  animation: shimmer 3s ease-in-out infinite;
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(58, 42, 62, 0.2);
  border-top-color: var(--dark);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}

/* Success message */
#rsvp-success {
  text-align: center;
  padding: 2rem 0;
  position: relative;
  overflow: hidden;
}

#rsvp-success.hidden { display: none; }
#rsvp-success.visible { display: block; animation: fadeInUp 0.8s ease both; }

.success-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  animation: float 2s ease-in-out infinite;
}

#rsvp-success h3 {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 5vw, 2rem);
  color: var(--gold);
  margin-bottom: 0.5rem;
}

#rsvp-success p {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--text-muted);
  font-style: italic;
}

/* RSVP error */
.rsvp-error {
  background: rgba(220, 80, 80, 0.1);
  border: 1px solid rgba(220, 80, 80, 0.3);
  color: #c44;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  text-align: center;
  animation: fadeInUp 0.3s ease;
}

/* Confetti */
.confetti-piece {
  position: absolute;
  top: -10px;
  border-radius: 3px;
  animation: confetti-fall linear forwards;
  pointer-events: none;
}

/* ============================================================
   KEYFRAME ANIMATIONS
   ============================================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 15px rgba(212, 165, 116, 0.3); }
  50% { box-shadow: 0 0 35px rgba(255, 215, 0, 0.5), 0 0 60px rgba(212, 165, 116, 0.2); }
}

@keyframes shimmer {
  0% { left: -60%; }
  100% { left: 120%; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

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

/* ============================================================
   PHOTO GALLERY
   ============================================================ */
.photo-gallery {
  position: relative;
  width: 100%;
  max-width: 400px;
  aspect-ratio: 3/4;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(248,200,220,0.35), var(--shadow-gold);
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.photo-gallery.animate-in { opacity: 1; transform: translateY(0); }

.gallery-track { position: relative; width: 100%; height: 100%; }

.gallery-slide {
  position: absolute; inset: 0;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.gallery-slide.active { opacity: 1; transform: scale(1); z-index: 2; }

.princess-photo {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: var(--radius);
}

.gallery-dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}

.gallery-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.8);
  background: transparent;
  cursor: pointer;
  transition: all 0.3s ease;
}
.gallery-dot.active {
  background: var(--gold-shimmer);
  border-color: var(--gold-shimmer);
  transform: scale(1.3);
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px; height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(8px);
  font-size: 1.4rem;
  color: var(--gold);
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-nav:hover { background: rgba(255,255,255,0.95); transform: translateY(-50%) scale(1.1); }
.gallery-prev { left: 10px; }
.gallery-next { right: 10px; }

/* ============================================================
   COUNTDOWN
   ============================================================ */
.countdown-section {
  width: 100%;
  max-width: 520px;
  text-align: center;
  padding: 2rem;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(212,165,116,0.3);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.countdown-section.animate-in { opacity: 1; transform: translateY(0); }

.countdown-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 4vw, 2rem);
  color: var(--gold);
  margin-bottom: 1.2rem;
}

.countdown-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.countdown-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 60px;
}

.countdown-number {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 8vw, 3.5rem);
  font-weight: 600;
  color: var(--text-dark);
  line-height: 1;
  transition: transform 0.15s ease, opacity 0.15s ease;
  background: linear-gradient(135deg, var(--pink-light), rgba(255,255,255,0.8));
  width: 65px; height: 65px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid rgba(212,165,116,0.2);
}

.countdown-label {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

.countdown-sep {
  font-family: var(--font-serif);
  font-size: 2rem;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 1.2rem;
  animation: pulse-glow 1.5s ease-in-out infinite;
}

/* ============================================================
   MAP SECTION
   ============================================================ */
.map-section {
  width: 100%;
  max-width: 520px;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(152,212,187,0.3);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.map-section.animate-in { opacity: 1; transform: translateY(0); }

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 4vw, 2rem);
  color: var(--gold);
  text-align: center;
  margin-bottom: 1rem;
}

.map-container {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.map-directions-btn {
  display: block;
  text-align: center;
  margin-top: 1rem;
  padding: 0.85rem 1.5rem;
  background: linear-gradient(135deg, var(--mint-light), var(--mint));
  color: var(--dark);
  text-decoration: none;
  border-radius: 50px;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s ease;
}
.map-directions-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(152,212,187,0.4);
}

/* ============================================================
   COMPANION FIELDS + TEXTAREA
   ============================================================ */
.companion-field {
  opacity: 0;
}

.form-group textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  border: 1.5px solid rgba(212,165,116,0.3);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.6);
  color: var(--text-dark);
  outline: none;
  resize: vertical;
  min-height: 80px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.form-group textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212,165,116,0.15);
}

.calendar-btn {
  display: inline-block;
  margin-top: 1.2rem;
  padding: 0.85rem 2rem;
  background: linear-gradient(135deg, #4285F4, #34A853);
  color: white;
  border: none;
  border-radius: 50px;
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  animation: float 3s ease-in-out infinite;
}
.calendar-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(66,133,244,0.4);
}

/* ============================================================
   FOOTER
   ============================================================ */
.invitation-footer {
  text-align: center;
  padding: 2rem 1rem;
  font-family: var(--font-serif);
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.9rem;
  opacity: 0.7;
}

/* ============================================================
   DETAIL ITEM INTERACTION
   ============================================================ */
.detail-item {
  cursor: pointer;
  transition: all 0.3s ease;
}
.detail-item:hover {
  transform: translateX(5px);
  border-color: var(--gold);
  box-shadow: 0 2px 12px rgba(212,165,116,0.15);
}

/* ============================================================
   MUSIC BOX WIDGET
   ============================================================ */
.music-box-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 200;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: transform 0.3s ease;
}
.music-box-widget:hover { transform: scale(1.1); }

.music-box-body {
  width: 55px;
  height: 45px;
  background: linear-gradient(135deg, #8B5A2B, #D2691E, #CD853F);
  border-radius: 6px 6px 4px 4px;
  position: relative;
  box-shadow: 0 4px 15px rgba(139,90,43,0.4), inset 0 1px 0 rgba(255,255,255,0.2);
  overflow: hidden;
}

.music-box-lid {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 12px;
  background: linear-gradient(135deg, #A0522D, #DEB887);
  border-radius: 6px 6px 0 0;
  border-bottom: 1px solid rgba(0,0,0,0.2);
  transition: transform 0.5s ease;
  transform-origin: top center;
}
.music-box-widget.playing .music-box-lid {
  transform: rotateX(-30deg) translateY(-3px);
}

.music-box-cylinder {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 8px;
  background: linear-gradient(90deg, #FFD700, #DAA520, #FFD700);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: space-around;
}
.music-box-widget.playing .music-box-cylinder {
  animation: cylinder-rotate 2s linear infinite;
}

.cylinder-pin {
  width: 2px;
  height: 4px;
  background: #B8860B;
  border-radius: 1px;
}

.music-box-notes {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.music-box-widget.playing .music-box-notes { opacity: 1; }

.music-box-notes .note {
  font-size: 12px;
  color: var(--gold-shimmer);
  animation: note-float 1.5s ease-in-out infinite;
}
.note:nth-child(2) { animation-delay: 0.3s; }
.note:nth-child(3) { animation-delay: 0.6s; }

.music-box-label {
  font-family: var(--font-sans);
  font-size: 0.6rem;
  color: var(--text-muted);
  text-align: center;
  background: rgba(255,255,255,0.8);
  padding: 2px 8px;
  border-radius: 8px;
  backdrop-filter: blur(4px);
}

@keyframes cylinder-rotate {
  to { transform: translateX(-50%) rotateZ(360deg); }
}

@keyframes note-float {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(-8px); opacity: 1; }
}

/* ============================================================
   COMPANION ENTRIES
   ============================================================ */
.form-section-label {
  display: block;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.6rem;
}

.companion-entry {
  margin-bottom: 0.6rem;
}

.companion-input-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.companion-num {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pink-light), var(--mint-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-dark);
  flex-shrink: 0;
}

.companion-input {
  flex: 1;
  padding: 0.7rem 0.9rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  border: 1.5px solid rgba(212,165,116,0.3);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.6);
  color: var(--text-dark);
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.companion-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212,165,116,0.15);
}

.remove-companion {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1.5px solid rgba(220,80,80,0.3);
  background: rgba(220,80,80,0.08);
  color: #c44;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.remove-companion:hover {
  background: rgba(220,80,80,0.2);
  border-color: #c44;
}

.add-companion-btn {
  display: block;
  width: 100%;
  padding: 0.7rem;
  margin-top: 0.5rem;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gold);
  background: rgba(212,165,116,0.08);
  border: 2px dashed rgba(212,165,116,0.4);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.3s ease;
}
.add-companion-btn:hover {
  background: rgba(212,165,116,0.15);
  border-color: var(--gold);
  transform: scale(1.02);
}

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

/* ============================================================
   FLOATING STICKERS
   ============================================================ */
.floating-sticker {
  position: fixed;
  font-size: 1.5rem;
  opacity: 0.25;
  pointer-events: none;
  z-index: 0;
  transition: transform 0.3s ease;
}
.s1 { top: 20%; left: 3%; }
.s2 { top: 40%; right: 4%; }
.s3 { top: 60%; left: 5%; }
.s4 { top: 75%; right: 6%; }
.s5 { top: 90%; left: 4%; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 480px) {
  .invitation-card { padding: 2rem 1.4rem; }
  .rsvp-section { padding: 1.5rem 1.2rem; }
  .detail-item { padding: 0.7rem 0.8rem; }
  .radio-group { flex-direction: column; gap: 0.5rem; }
  .floral-corner { width: 50px; height: 50px; }
  .photo-gallery { max-width: 320px; }
  .countdown-number { width: 52px; height: 52px; font-size: 1.6rem; }
  .gallery-nav { width: 32px; height: 32px; font-size: 1.1rem; }
  .music-box-widget { bottom: 12px; right: 12px; }
  .music-box-body { width: 45px; height: 38px; }
}

@media (min-width: 768px) {
  #invitation-section.visible { padding-top: 4rem; gap: 2.5rem; }
  .invitation-card { padding: 3rem 2.5rem; }
  .floral-corner { width: 100px; height: 100px; }
  .photo-gallery { max-width: 450px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--pearl); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--pink), var(--mint));
  border-radius: 3px;
}
