@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;1,400&family=Lora:ital,wght@0,400;0,500;1,400&family=Montserrat:wght@300;400;500;600&family=Great+Vibes&display=swap');

:root {
  --pf-text: #333333;
  --pf-muted: #666666;
  --pf-accent: #5a7c5a; /* Deep sage green */
  --font-title: 'Playfair Display', serif;
  --font-text: 'Lora', serif;
  --font-sans: 'Montserrat', sans-serif;
  --font-script: 'Great Vibes', cursive;
}

body, html {
  margin: 0; padding: 0;
  font-family: var(--font-text);
  color: var(--pf-text);
  background-color: #f5f8f5; /* Fallback pale green */
  overflow-x: hidden;
  scroll-behavior: smooth;

  height: 100%;
  overflow-y: hidden; /* Safe scroll setup */
}

body::before {
  content: '';
  position: fixed;
  top: -20px; left: -20px; right: -20px; bottom: -20px;
  background: url('assets/background.webp') center/cover no-repeat;
  filter: blur(4px);
  z-index: -2;
}

/* Corner Flowers (Fixed to Screen) */
.flower-tl, .flower-br {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  max-width: 400px;
  width: 55vw;
  filter: drop-shadow(0 5px 10px rgba(0,0,0,0.1));
}
@keyframes sway {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(3deg); }
}

.flower-tl {
  top: -15px;
  left: -15px;
  transform-origin: top left;
  animation: sway 8s ease-in-out infinite;
}

.flower-br {
  bottom: -15px;
  right: -15px;
  transform-origin: bottom right;
  animation: sway 9s ease-in-out infinite reverse;
}

/* Base Layout */
.invitation-root {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  z-index: 1;
}

/* Section block */
.section-block {
  position: relative;
  padding: 40px 15px;
  text-align: center;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  margin: 15px auto;
  max-width: 85%;
}

.section-block::before,
.section-block::after {
  content: '';
  position: absolute;
  width: 140px;
  height: 140px;
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}
.section-block::before {
  top: -20px;
  left: -20px;
  background-image: url('assets/pojok%20kiri%20atas.webp');
  background-position: top left;
}
.section-block::after {
  bottom: -20px;
  right: -20px;
  background-image: url('assets/pojok%20kanan%20bawah.webp');
  background-position: bottom right;
}


.cover-section {
  min-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding-top: 30px;
  padding-bottom: 30px;
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  margin: 15px auto;
  max-width: 85%;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-title);
  margin: 0;
}
.eyebrow {
  font-family: var(--font-sans);
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 0.75rem;
  color: var(--pf-muted);
  margin-bottom: 5px;
  font-weight: 500;
}

.title-large {
  font-size: 3.2rem;
  font-weight: 600;
  margin: 0 0 20px;
  line-height: 1.1;
  text-transform: uppercase;
}

.section-title {
  font-family: var(--font-script);
  font-size: 3.5rem;
  color: var(--pf-accent);
  margin-bottom: 20px;
  font-weight: 400;
  line-height: 1.2;
}

.text-muted {
  color: var(--pf-muted);
}

/* Cover Frame */
.cover-frame-wrapper {
  position: relative;
  width: clamp(200px, 55vw, 260px);
  aspect-ratio: 280 / 280;
  height: auto;
  margin: 5px auto 10px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.cover-frame-img {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}
.cover-photo {
  position: absolute;
  width: 61.1%;
  height: 71.8%;
  object-fit: cover;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
}

/* Mempelai Frame */
.mempelai-frame-wrapper {
  position: relative;
  width: 220px;
  height: 295px;
  margin: 20px auto;
  display: flex;
  justify-content: center;
  align-items: center;
}
.mempelai-frame-img {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  object-fit: contain;
}
.mempelai-photo {
  position: absolute;
  width: 138px;
  height: 171px;
  object-fit: cover;
  top: 50.3%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 5px;
  z-index: 1;
}

/* Buttons */
.btn-primary {
  background: var(--pf-accent);
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 0.75rem;
  cursor: pointer;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: 0.3s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-weight: 600;
}
.btn-primary:hover {
  background: #4a684a;
}

.btn-outline {
  background: transparent;
  color: var(--pf-accent);
  border: 1px solid var(--pf-accent);
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  transition: 0.3s;
}
.btn-outline:hover {
  background: rgba(90, 124, 90, 0.1);
}

/* Utilities */
.text-center { text-align: center; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mt-20 { margin-top: 20px; }
.w-100 { width: 100%; }

/* Event Card */
.event-card {
  background: rgba(255,255,255,0.85);
  border: 1px solid rgba(90, 124, 90, 0.2);
  padding: 30px 20px;
  border-radius: 15px;
  margin-bottom: 20px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.03);
}

/* Countdown */
.countdown {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin-top: 30px;
  margin-bottom: 30px;
}
.cd-box {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-width: 45px;
}
.cd-box:not(:last-child)::after {
  content: '';
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  height: 25px;
  width: 1px;
  background-color: rgba(74, 104, 74, 0.3);
}
.cd-num {
  font-size: 1.8rem;
  font-family: var(--font-title);
  color: var(--pf-accent);
  display: block;
  line-height: 1;
  margin-bottom: 8px;
  font-weight: 400;
}
.cd-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--pf-text);
  font-family: var(--font-sans);
  display: block;
}

/* Forms */
.form-group {
  text-align: left;
}
.form-label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 8px;
  color: var(--pf-text);
  font-family: var(--font-sans);
}
.form-control {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(90, 124, 90, 0.3);
  background: rgba(255,255,255,0.8);
  color: var(--pf-text);
  font-family: var(--font-sans);
  box-sizing: border-box;
  margin-bottom: 15px;
}
.form-control:focus {
  outline: none;
  border-color: var(--pf-accent);
}
.radio-group {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  margin-bottom: 15px;
}
.radio-label {
  font-size: 0.85rem;
  font-family: var(--font-sans);
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Timeline */
.story-timeline {
  border-left: 2px solid var(--pf-accent);
  padding-left: 20px;
  margin-left: 10px;
  text-align: left;
}
.story-item {
  position: relative;
  margin-bottom: 30px;
}
.story-item::before {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--pf-accent);
  border-radius: 50%;
  left: -27px;
  top: 5px;
}

/* Ucapan List */
.ucapan-list {
  max-height: 400px;
  overflow-y: auto;
  text-align: left;
  padding-right: 5px;
}
.ucapan-list::-webkit-scrollbar {
  width: 5px;
}
.ucapan-list::-webkit-scrollbar-thumb {
  background: rgba(90, 124, 90, 0.5);
  border-radius: 5px;
}
.ucapan-item {
  background: rgba(255,255,255,0.7);
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 10px;
  border: 1px solid rgba(90, 124, 90, 0.2);
}

/* Gallery Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.gallery-item {
  display: block;
}
.gallery-item img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

/* Opening Screen Cover Overlay */
#opening-cover {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 1s ease, visibility 1s;
}
.opening-content {
  text-align: center;
  width: 78%;
  max-width: 350px;
  padding: 15px 10px;
  max-height: 90vh;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  margin: auto;
}

/* Horizontal Swipe Container */
.swipe-container {
  display: flex;
  overflow-x: auto;
  gap: 15px;
  padding: 10px 5px 30px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.swipe-container::-webkit-scrollbar {
  height: 6px;
}
.swipe-container::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.05);
  border-radius: 10px;
}
.swipe-container::-webkit-scrollbar-thumb {
  background: var(--pf-accent);
  border-radius: 10px;
}
.swipe-item {
  flex: 0 0 85%;
  max-width: 320px;
  scroll-snap-align: center;
  margin-bottom: 0 !important;
}

/* Modal Popup */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 10000;
  justify-content: center;
  align-items: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
  box-sizing: border-box;
}
.modal-overlay.active {
  display: flex;
  opacity: 1;
}
.modal-box {
  background: #fff;
  padding: 40px 20px 30px;
  border-radius: 20px;
  text-align: center;
  max-width: 350px;
  width: 100%;
  position: relative;
  transform: translateY(20px);
  transition: transform 0.3s ease;
  background-image: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.8) 100%), url('assets/background.webp');
}

/* Horizontal Swipe Container */
.swipe-container {
  display: flex;
  overflow-x: auto;
  gap: 15px;
  padding: 10px 5px 30px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.swipe-container::-webkit-scrollbar {
  height: 6px;
}
.swipe-container::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.05);
  border-radius: 10px;
}
.swipe-container::-webkit-scrollbar-thumb {
  background: var(--pf-accent);
  border-radius: 10px;
}
.swipe-item {
  flex: 0 0 85%;
  max-width: 320px;
  scroll-snap-align: center;
  margin-bottom: 0 !important;
}

/* Modal Popup */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 10000;
  justify-content: center;
  align-items: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
  box-sizing: border-box;
}
.modal-overlay.active {
  display: flex;
  opacity: 1;
}
.modal-box {
  background: #fff;
  padding: 40px 20px 30px;
  border-radius: 20px;
  text-align: center;
  max-width: 350px;
  width: 100%;
  position: relative;
  transform: translateY(20px);
  transition: transform 0.3s ease;
  background-image: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.8) 100%), url('assets/background.webp');
  background-size: cover;
}
.modal-overlay.active .modal-box {
  transform: translateY(0);
}
.modal-close {
  position: absolute;
  top: 15px; right: 20px;
  background: none; border: none;
  font-size: 1.8rem;
  color: var(--pf-muted);
  cursor: pointer;
  line-height: 1;
}

/* Music Toggle */
.music-toggle {
  position: fixed;
  bottom: 85px;
  right: 20px;
  width: 45px;
  height: 45px;
  background: var(--pf-accent);
  color: #fff;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  z-index: 10002;
  cursor: pointer;
  animation: spin 4s linear infinite;
  transition: transform 0.3s ease;
}
.music-toggle.paused {
  animation: none;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

/* Guest Card - Torn Paper & Tape Effect */
.guest-card {
  position: relative;
  margin: 5px auto 10px;
  padding: 8px 10px;
  background-color: #fffdf5;
  box-shadow: 0 4px 15px rgba(0,0,0,0.06);
  max-width: 95%;
  display: inline-block;
  transform: rotate(1deg);
  border-radius: 255px 15px 225px 15px/15px 225px 15px 255px;
  border: 1px solid rgba(0,0,0,0.02);
}

.guest-card::before {
  content: '';
  position: absolute;
  top: -25px;
  left: 50%;
  margin-left: -45px;
  width: 90px;
  height: 25px;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transform: rotate(-3deg);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-right-color: rgba(255, 255, 255, 0.2);
  border-bottom-color: rgba(255, 255, 255, 0.2);
  z-index: 2;
}


/* Preloader */
#preloader {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100svh;
  background: #f5f8f5;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: opacity 0.8s ease, visibility 0.8s;
}
.loader-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(109, 76, 65, 0.2);
  border-top-color: var(--pf-accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 15px;
}
.loader-text {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--pf-muted);
  letter-spacing: 1px;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
/* Bottom Navbar */
.bottom-navbar {
  position: fixed;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 400px;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 50px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 10px 5px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  z-index: 10001;
  visibility: hidden;
  opacity: 0;
  transition: opacity 1s ease, visibility 1s;
}
.bottom-navbar.show {
  visibility: visible;
  opacity: 1;
}
.bottom-navbar a {
  color: var(--pf-muted);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.65rem;
  font-family: var(--font-sans);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 5px 10px;
  border-radius: 20px;
  transition: all 0.3s ease;
}
.bottom-navbar a.active {
  color: var(--pf-accent);
}
.bottom-navbar i {
  margin-bottom: 3px;
  width: 20px;
  height: 20px;
}

/* Bottom Navbar */
.bottom-navbar {
  position: fixed;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 400px;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 50px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 10px 5px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  z-index: 10001;
  visibility: hidden;
  opacity: 0;
  transition: opacity 1s ease, visibility 1s;
}
.bottom-navbar.show {
  visibility: visible;
  opacity: 1;
}
.bottom-navbar a {
  color: var(--pf-muted);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.65rem;
  font-family: var(--font-sans);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 5px 10px;
  border-radius: 20px;
  transition: all 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}
.bottom-navbar a.active {
  color: var(--pf-accent);
}
.bottom-navbar i {
  margin-bottom: 3px;
  width: 20px;
  height: 20px;
}

/* Lightbox Modal */
.lightbox-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 99999;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.lightbox-modal.active {
  opacity: 1;
  pointer-events: auto;
}
.lightbox-content {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  transform: scale(0.95);
  transition: transform 0.3s ease;
  border: 1px solid rgba(255,255,255,0.4);
}
.lightbox-modal.active .lightbox-content {
  transform: scale(1);
}
.lightbox-close {
  position: absolute;
  top: 15px;
  right: 25px;
  color: #fff;
  font-size: 2.5rem;
  background: none;
  border: none;
  cursor: pointer;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

/* Custom Scrollbar for Safe Scroll */
.invitation-root {
  scrollbar-width: thin;
  scrollbar-color: var(--pf-accent) transparent;
}
.invitation-root::-webkit-scrollbar {
  width: 4px;
}
.invitation-root::-webkit-scrollbar-track {
  background: transparent;
}
.invitation-root::-webkit-scrollbar-thumb {
  background: var(--pf-accent);
  border-radius: 10px;
}
