@import url('https://fonts.googleapis.com/css2?family=Alex+Brush&family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400&family=Montserrat:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,500;0,700;1,400&display=swap');

:root {
  --primary-red: #9E1B1B;
  --dark-red: #701111;
  --light-bg: #FAF7F2;
  --card-bg: #FFFFFF;
  --text-dark: #333333;
  --text-muted: #666666;
  --gold-accent: #C5A059;
  --border-red: #9E1B1B;
  --shadow-color: rgba(158, 27, 27, 0.12);
  --font-serif: 'Playfair Display', serif;
  --font-cursive: 'Alex Brush', cursive;
  --font-classic: 'Cormorant Garamond', serif;
  --font-sans: 'Montserrat', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: #121212;
}

body {
  font-family: var(--font-sans);
  color: var(--text-dark);
  background: radial-gradient(circle at center, #2a2020 0%, #110d0d 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-x: hidden;
}

/* App Wrapper for Mobile Preview on Desktop */
.app-container {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  background-color: var(--light-bg);
  position: relative;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.6);
  overflow-x: hidden;
}

/* Scroll Lock on Initial Cover */
body.locked {
  overflow: hidden;
}

/* --- COVER SCREEN (ENVELOPE 2.png) --- */
.cover-screen {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: 100vh;
  height: 100dvh;
  z-index: 9999;
  background-color: #FAF7F2;
  overflow: hidden;
  transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1), opacity 0.8s ease;
  cursor: pointer;
}

.cover-screen.opened {
  transform: translate(-50%, -100%);
  opacity: 0;
  pointer-events: none;
}

.cover-content-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.cover-overlay-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
}

/* Guest Name: Pure Black Font, Positioned Higher Up directly below "Kepada Yth..." */
.guest-name-text {
  position: absolute;
  top: 22.5%;
  left: 50%;
  transform: translateX(-50%);
  width: 88%;
  text-align: center;
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 700;
  color: #000000;
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
  margin: 0;
  line-height: 1.2;
}

/* Wax Seal Button exact overlay on top of 2.png "OPEN INVITATION" heart seal */
.open-seal-button {
  position: absolute;
  top: 57.2%;
  left: 48.1%;
  transform: translate(-50%, -50%);
  width: 52%;
  height: 28%;
  background: transparent;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  outline: none;
  z-index: 10;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.open-seal-button:hover {
  transform: translate(-50%, -50%) scale(1.05);
  filter: drop-shadow(0 0 18px rgba(158, 27, 27, 0.7));
}

.open-seal-button:active {
  transform: translate(-50%, -50%) scale(0.95);
}

.open-seal-button::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 80%;
  height: 80%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(158, 27, 27, 0.5);
  animation: seal-pulse 2s infinite;
  pointer-events: none;
}

@keyframes seal-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(158, 27, 27, 0.5);
  }
  70% {
    box-shadow: 0 0 0 25px rgba(158, 27, 27, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(158, 27, 27, 0);
  }
}

/* --- MAIN CONTENT SECTIONS --- */
.main-invitation {
  opacity: 0;
  transition: opacity 0.6s ease;
  padding-bottom: 50px;
}

.main-invitation.visible {
  opacity: 1;
}

/* Base Card Section Style */
.invitation-section {
  position: relative;
  width: 100%;
  background-color: var(--card-bg);
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px var(--shadow-color);
}

.invitation-section img.full-img {
  width: 100%;
  height: auto;
  display: block;
}

/* SECTION 3: COUPLE (6.png with animated aset-pita.png & shifted aset-bintang.png) */
.couple-section-container {
  position: relative;
}

/* aset-pita.png with gentle swinging animation */
.overlay-pita {
  position: absolute;
  top: 5.5%;
  right: 14%;
  width: 32%;
  height: auto;
  z-index: 5;
  pointer-events: none;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.15));
  transform-origin: top center;
  animation: pita-sway 3.2s ease-in-out infinite;
}

@keyframes pita-sway {
  0%, 100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(8deg);
  }
  75% {
    transform: rotate(-8deg);
  }
}

/* aset-bintang.png shifted slightly right with subtle twinkle */
.overlay-bintang {
  position: absolute;
  top: 49.5%;
  left: 13.5%;
  width: 28%;
  height: auto;
  z-index: 5;
  pointer-events: none;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.15));
  animation: star-twinkle 2.5s ease-in-out infinite;
}

@keyframes star-twinkle {
  0%, 100% {
    transform: scale(1) rotate(0deg);
    opacity: 0.9;
  }
  50% {
    transform: scale(1.08) rotate(5deg);
    opacity: 1;
  }
}

/* Gallery Section Grid */
.gallery-section-wrapper {
  position: relative;
  background-color: #8B1E1E;
  padding: 30px 20px 40px 20px;
  text-align: center;
}

.gallery-header-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
}

.gallery-header-box img.ribbon {
  height: 28px;
  width: auto;
}

.gallery-title {
  font-family: var(--font-cursive);
  font-size: 3rem;
  color: #FFFFFF;
  line-height: 1;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 440px;
  margin: 0 auto;
}

.gallery-item {
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  position: relative;
  border: 2px solid rgba(255, 255, 255, 0.3);
  cursor: default;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* SECTION 7: LOKASI & GIFT (lokasi-acara.png with button-maps.png & matching compact button-rekening.png) */
.location-section-wrapper {
  position: relative;
}

.btn-maps-overlay {
  position: absolute;
  top: 34.5%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 54%;
  max-width: 250px;
  display: block;
  z-index: 10;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.btn-maps-overlay img {
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
}

.btn-maps-overlay:hover {
  transform: translate(-50%, -50%) scale(1.05);
  filter: drop-shadow(0 4px 12px rgba(158, 27, 27, 0.3));
}

/* Identical compact size for both Salin No. Rekening buttons */
.btn-rekening-overlay {
  position: absolute;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 38%;
  max-width: 175px;
  background: none;
  border: none;
  cursor: pointer;
  outline: none;
  z-index: 10;
  padding: 0;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.btn-rekening-overlay img {
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
}

.btn-rekening-overlay:hover {
  transform: translate(-50%, -50%) scale(1.05);
  filter: drop-shadow(0 4px 12px rgba(158, 27, 27, 0.3));
}

.btn-rekening-overlay:active {
  transform: translate(-50%, -50%) scale(0.95);
}

.btn-milea {
  top: 71.8%;
}

.btn-dilan {
  top: 89.8%;
}

/* SECTION 8: RSVP & WISHES CARD (13.png with button-rsvp.png overlay) */
.rsvp-section-wrapper {
  position: relative;
}

.btn-rsvp-overlay {
  position: absolute;
  top: 47.6%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 54%;
  max-width: 260px;
  background: none;
  border: none;
  cursor: pointer;
  outline: none;
  z-index: 10;
  padding: 0;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.btn-rsvp-overlay img {
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
}

.btn-rsvp-overlay:hover {
  transform: translate(-50%, -50%) scale(1.06);
  filter: drop-shadow(0 6px 18px rgba(158, 27, 27, 0.4));
}

.btn-rsvp-overlay:active {
  transform: translate(-50%, -50%) scale(0.95);
}

/* RSVP POPUP MODAL DIALOG */
.rsvp-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.rsvp-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.rsvp-modal-card {
  width: 100%;
  max-width: 440px;
  max-height: 88vh;
  overflow-y: auto;
  background-color: var(--light-bg);
  border-radius: 20px;
  padding: 30px 22px 28px 22px;
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  transform: translateY(30px);
  transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.rsvp-modal-overlay.active .rsvp-modal-card {
  transform: translateY(0);
}

.modal-close-btn {
  position: absolute;
  top: 14px;
  right: 18px;
  background: rgba(158, 27, 27, 0.1);
  color: var(--primary-red);
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 1.4rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease, color 0.3s ease;
}

.modal-close-btn:hover {
  background: var(--primary-red);
  color: #FFFFFF;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: var(--primary-red);
  color: #FFFFFF;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 30px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(158, 27, 27, 0.3);
  transition: all 0.3s ease;
  width: 100%;
  max-width: 280px;
}

.btn-primary:hover {
  background-color: var(--dark-red);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(158, 27, 27, 0.4);
}

/* Interactive RSVP & Wishes Form in Modal */
.rsvp-header {
  text-align: center;
  margin-bottom: 24px;
}

.rsvp-title {
  font-family: var(--font-classic);
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-red);
}

.rsvp-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.rsvp-form {
  background-color: var(--card-bg);
  border: 1px solid var(--shadow-color);
  border-radius: 16px;
  padding: 20px 18px;
  box-shadow: 0 4px 15px var(--shadow-color);
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary-red);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 11px 14px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  border: 1px solid #E0E0E0;
  border-radius: 8px;
  background-color: #FAFAFA;
  outline: none;
  transition: border-color 0.3s ease;
}

.form-control:focus {
  border-color: var(--primary-red);
  background-color: #FFFFFF;
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

.radio-group {
  display: flex;
  gap: 8px;
}

.radio-label {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 10px 6px;
  border: 1px solid #E0E0E0;
  border-radius: 8px;
  cursor: pointer;
  background-color: #FAFAFA;
  transition: all 0.3s ease;
}

.radio-label input[type="radio"] {
  accent-color: var(--primary-red);
}

.radio-label:has(input:checked) {
  border-color: var(--primary-red);
  background-color: rgba(158, 27, 27, 0.08);
  font-weight: 600;
  color: var(--primary-red);
}

/* Wishes List Feed */
.wishes-container {
  background-color: var(--card-bg);
  border-radius: 16px;
  padding: 18px;
  border: 1px solid var(--shadow-color);
  box-shadow: 0 4px 15px var(--shadow-color);
}

.wishes-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--primary-red);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wishes-badge {
  background-color: var(--primary-red);
  color: white;
  font-size: 0.75rem;
  font-family: var(--font-sans);
  padding: 2px 8px;
  border-radius: 12px;
}

.wishes-feed {
  max-height: 280px;
  overflow-y: auto;
  padding-right: 6px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wishes-feed::-webkit-scrollbar {
  width: 4px;
}

.wishes-feed::-webkit-scrollbar-thumb {
  background: var(--primary-red);
  border-radius: 4px;
}

.wish-card {
  background-color: var(--light-bg);
  border-left: 3px solid var(--primary-red);
  padding: 12px 14px;
  border-radius: 0 8px 8px 0;
}

.wish-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.wish-author {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary-red);
}

.wish-status {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.status-hadir {
  background: #E8F5E9;
  color: #2E7D32;
}

.status-absent {
  background: #FFEBEE;
  color: #C62828;
}

.status-ragu {
  background: #FFF3E0;
  color: #E65100;
}

.wish-text {
  font-size: 0.85rem;
  color: var(--text-dark);
  line-height: 1.4;
}

.wish-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
  text-align: right;
}

/* Floating Audio Player Only */
.floating-controls {
  position: fixed;
  bottom: 24px;
  left: calc(50% - 220px);
  z-index: 9000;
  pointer-events: none;
}

@media (max-width: 480px) {
  .floating-controls {
    left: 20px;
  }
}

.music-btn {
  pointer-events: auto;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: var(--primary-red);
  color: white;
  border: 2px solid white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
  transition: transform 0.3s ease;
}

.music-btn:hover {
  transform: scale(1.08);
}

.music-btn.playing {
  animation: spin-slow 8s linear infinite;
}

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

/* Toast Notification */
.toast-msg {
  position: fixed;
  top: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: var(--dark-red);
  color: white;
  padding: 10px 24px;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 10000;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
}

.toast-msg.show {
  transform: translateX(-50%) translateY(0);
}

/* Responsive adjust */
@media (max-width: 480px) {
  body {
    background: var(--light-bg);
  }
  .app-container {
    box-shadow: none;
  }
}
