@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;600;700&family=Montserrat:wght@300;400;500;600&family=Amiri:wght@400;700&display=swap');

:root {
  --primary: #D9B05E; /* Gold */
  --primary-light: #F2D59B;
  --text-dark: #333333; /* Dark for text on white cards */
  --text-light: #666666; 
  --bg-color: #9C0005; /* Deep Red */
  --white: #ffffff;
  --nav-height: 65px;
  --font-heading: 'Cormorant Garamond', serif;
  --font-body: 'Montserrat', sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  width: 100%; height: 100%; height: 100dvh;
  overflow: hidden; /* No global scroll */
  background: var(--bg-color);
  color: var(--text-dark);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

/* Background Decorations */
.bg-decoration {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none; overflow: hidden;
  background: url('img/background untuk overlay.webp') center center no-repeat;
  background-size: cover;
  opacity: 0.05;
}
.bg-decoration .blob { display: none; } /* Hide old blobs */

/* Butterfly Animation */
.butterfly {
  position: absolute;
  width: 40px; height: 40px;
  animation: flutter 6s ease-in-out infinite;
  opacity: 0.8;
}
.butterfly svg { width: 100%; height: 100%; fill: var(--primary); }
.butterfly-1 { top: 15%; right: 10%; }
.butterfly-2 { bottom: 25%; left: 5%; animation-duration: 8s; transform: scale(0.7) scaleX(-1); }

/* Flower Animation */
.flower {
  position: absolute;
  transform-origin: bottom center;
  animation: sway 5s ease-in-out infinite alternate;
  opacity: 0.6;
}
.flower-tl { top: -20px; left: -20px; width: 150px; transform-origin: top left; }
.flower-br { bottom: 60px; right: -20px; width: 120px; transform-origin: bottom right; }

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(20px, 30px) scale(1.1); }
}
@keyframes flutter {
  0% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(-10px, -15px) rotate(-10deg); }
  50% { transform: translate(5px, -20px) rotate(5deg); }
  75% { transform: translate(15px, -10px) rotate(15deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}
@keyframes sway {
  0% { transform: rotate(-5deg); }
  100% { transform: rotate(5deg); }
}

/* App Container */
.app-container {
  position: relative;
  width: 100%; height: 100%;
  max-width: 480px; /* Mobile constraint */
  margin: 0 auto;
  background: transparent;
  box-shadow: 0 0 30px rgba(0,0,0,0.05);
  overflow: hidden;
  z-index: 1;
}

/* Pages / Sections */
.page-section {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: var(--nav-height);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 30px 45px 120px 45px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(15px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  z-index: 1;
}
.page-section.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  z-index: 10;
}

/* Typography */
h1, h2, h3, h4 { font-family: var(--font-heading); margin: 0 0 15px; color: var(--primary); line-height: 1.2; }
p { margin: 0 0 15px; line-height: 1.6; color: rgba(255,255,255,0.9); }
.text-center { text-align: center; }

/* Bottom Navbar */
.bottom-nav {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: rgba(156, 0, 5, 0.95); /* Deep red translucent */
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 2px solid var(--primary); /* Gold border */
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1002;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: rgba(217, 176, 94, 0.5); /* Faded gold */
  text-decoration: none;
  font-size: 10px;
  font-weight: 600;
  transition: all 0.3s ease;
  width: 20%;
  height: 100%;
  cursor: pointer;
}
.nav-item svg {
  width: 20px; height: 20px;
  margin-bottom: 4px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: all 0.3s ease;
}
.nav-item.active {
  color: var(--primary);
}
.nav-item.active svg {
  transform: translateY(-3px);
  stroke-width: 2.5;
}

/* Card Styles for Content */
.card {
  position: relative;
  background: rgba(156, 0, 5, 0.2); /* Transparent red */
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--primary); /* Gold border for cards */
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 8px 32px rgba(92,138,185,0.08);
  text-align: center;
  overflow: hidden;
  opacity: 0; /* For animation */
}
.page-section.active > .card:nth-of-type(odd),
.page-section.active .timeline-item:nth-child(odd) .card {
  animation: slideInLeft 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: 0.2s;
}
.page-section.active > .card:nth-of-type(even),
.page-section.active .timeline-item:nth-child(even) .card {
  animation: slideInRight 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: 0.4s;
}
@keyframes slideInLeft {
  0% { opacity: 0; transform: translateX(-30px); }
  100% { opacity: 1; transform: translateX(0); }
}
@keyframes slideInRight {
  0% { opacity: 0; transform: translateX(30px); }
  100% { opacity: 1; transform: translateX(0); }
}
@keyframes fadeUpText {
  0% { opacity: 0; transform: translateY(15px); }
  100% { opacity: 1; transform: translateY(0); }
}
.page-section.active h2 {
  opacity: 0;
  animation: fadeUpText 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: 0.3s;
}
.page-section.active p:not(.animate-words) {
  opacity: 0;
  animation: fadeUpText 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: 0.5s;
}
.page-section.active .btn {
  opacity: 0;
  animation: fadeUpText 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: 0.7s;
}

.card > * {
  position: relative;
  z-index: 1;
}

.mempelai-img {
  object-fit: cover;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  background: rgba(255,255,255,0.1);
  transition: transform 0.3s;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  background: var(--primary);
  color: var(--bg-color);
  padding: 12px 24px;
  border-radius: 30px;
  border: none;
  font-weight: 600; font-size: 14px;
  cursor: pointer; text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
  font-family: var(--font-body);
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(92,138,185,0.3);
}

/* Envelope Button */
.btn-envelope {
  position: relative;
  border-radius: 6px;
  padding: 14px 28px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(92,138,185,0.4);
}
.btn-envelope::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  background: rgba(255, 255, 255, 0.15);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  pointer-events: none;
  transition: background 0.3s;
}
.btn-envelope:hover::before {
  background: rgba(255, 255, 255, 0.25);
}

/* Gallery Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.gallery-grid img {
  width: 100%; height: 150px;
  object-fit: cover;
  border-radius: 12px;
}

/* Form Styles */
.form-group { margin-bottom: 15px; text-align: left; }
.form-label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 500; color: var(--primary); }
.form-control {
  width: 100%; padding: 12px 16px;
  border: 1px solid rgba(217, 176, 94, 0.5); border-radius: 12px;
  font-family: var(--font-body); font-size: 14px;
  background: rgba(255,255,255,0.05);
  color: var(--white);
  outline: none; transition: border-color 0.2s;
}
.form-control:focus { border-color: var(--primary); }

/* Open Screen (Front Cover) overlay before entering app */
.intro-overlay {
  position: absolute; inset: 0;
  background: transparent;
  z-index: 1000;
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  padding: 30px;
  text-align: center;
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.intro-overlay.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-20px) scale(1.05);
}
.intro-names { font-size: 3rem; color: var(--primary); margin: 20px 0; }
.intro-to { font-size: 14px; margin-bottom: 30px; }

/* Custom Scrollbar for inner sections */
.page-section::-webkit-scrollbar { width: 4px; }
.page-section::-webkit-scrollbar-track { background: transparent; }
.page-section::-webkit-scrollbar-thumb { background: rgba(217,176,94,0.3); border-radius: 4px; }

/* Border Animations */
@keyframes borderSlideInRight {
  0% { transform: translateX(100vw); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}
@keyframes borderSlideInLeft {
  0% { transform: translateX(-100vw); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}
@keyframes borderSlideInTop {
  0% { transform: translateY(-100%); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}
#borderRight {
  animation: borderSlideInRight 2.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
#borderLeft {
  animation: borderSlideInLeft 2.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
#ondelWanita.active {
  animation: borderSlideInRight 2.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
#rumahBetawi.active, #ondelPria.active {
  animation: borderSlideInLeft 2.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
#borderAtas.active {
  animation: borderSlideInTop 2.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.content-decor { opacity: 0; }
.content-decor.active { opacity: 1; }
