@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@400;500;600;700&family=Rajdhani:wght@500;600;700&family=Teko:wght@500;600;700&display=swap');

:root {
  --pf-text: #ffffff;
  --pf-muted: #cccccc;
  --pf-accent: #ffa500;
  --font-title: 'Teko', sans-serif;
  --font-text: 'Chakra Petch', sans-serif;
  --font-sans: 'Rajdhani', sans-serif;
  --font-script: 'Teko', sans-serif;
}

/* Free Fire Title Effect */
.ff-title {
  font-family: 'Impact', 'Arial Black', sans-serif;
  font-size: clamp(2.2rem, 8vw, 3.5rem);
  text-transform: uppercase;
  font-weight: 900;
  font-style: italic;
  
  background: linear-gradient(to bottom, #ffed4a 0%, #ffa700 40%, #ff5e00 80%, #852000 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  
  -webkit-text-stroke: 0.5px #3a1500;
  filter: drop-shadow(2px 4px 3px rgba(0,0,0,0.9));
  
  letter-spacing: 3px;
  margin-bottom: 5px;
  line-height: 1.1;
}

.ff-title-white {
  background: linear-gradient(to bottom, #ffffff 0%, #e0e0e0 60%, #9e9e9e 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 0.5px #111;
}

body, html {
  margin: 0; padding: 0;
  font-family: var(--font-text);
  color: var(--pf-text);
  background: #111 url('assets/background.webp?v=3') center/cover fixed no-repeat;
  overflow-x: hidden;
  scroll-behavior: smooth;

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

/* 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: 60px 20px;
  text-align: center;
  overflow: hidden;
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0.7) 65%, rgba(255, 255, 255, 0) 100%);
  margin: 0;
}

.cover-section {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding-top: 40px;
  padding-bottom: 40px;
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0.7) 65%, rgba(255, 255, 255, 0) 100%);
  margin: 0;
}

/* 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;
}

/* 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: 60px 20px;
  text-align: center;
  overflow: hidden;
  background: transparent;
  margin: 0;
}

.cover-section {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding-top: 40px;
  padding-bottom: 40px;
  background: transparent;
  margin: 0;
}

/* 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;
}

/* Cover Frame */
  .cover-frame-wrapper {
    position: relative;
    width: 65%;
    max-width: 260px;
    margin: 0 auto 15px;
  }
  .cover-frame-img {
    position: relative;
    width: 100%;
    height: auto;
    z-index: 2;
    pointer-events: none;
    display: block;
  }
  .cover-photo {
    position: absolute;
    width: 76%;
    height: 82%;
    object-fit: cover;
    object-position: center top;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
  }
  /* Mempelai Frame */
  .mempelai-frame-wrapper {
    position: relative;
    width: 65%;
    max-width: 260px;
    margin: 20px auto;
  }
  .mempelai-frame-img {
    position: relative;
    width: 100%;
    height: auto;
    z-index: 2;
    pointer-events: none;
    display: block;
  }
  .mempelai-photo {
    position: absolute;
    width: 82%;
    height: 86%;
    object-fit: cover;
    object-position: center top;
    top: 48.5%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 5px;
    z-index: 1;
  }

/* Buttons */
.btn-primary {
  background: url('assets/tombol undangan.webp?v=3') center/100% 100% no-repeat;
  color: #ffa500;
  border: none;
  padding: 15px 30px;
  font-size: 0.9rem;
  cursor: pointer;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: 0.3s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}
.btn-primary:hover {
  filter: brightness(1.2);
}

.btn-outline {
  background: url('assets/tombol undangan.webp?v=3') center/100% 100% no-repeat;
  color: #ffa500;
  border: none;
  padding: 12px 25px;
  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);
  font-weight: 700;
  transition: 0.3s;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}
.btn-outline:hover {
  filter: brightness(1.2);
}

/* 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%; }

/* Gaming Style Content Cards */
.event-card {
  box-sizing: border-box;
  background: linear-gradient(135deg, #2a2a2a 0%, #151515 100%);
  border: 2px solid #4a2e10;
  border-top: 2px solid #ffa500;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.9), inset 0 0 20px rgba(0,0,0,0.8);
  margin: 0 auto 20px;
  width: 95%;
  max-width: 440px;
  color: #fff;
  position: relative;
  padding: 25px 20px;
}

/* Countdown */
.countdown {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: nowrap;
}
.cd-box {
  background: transparent;
  border-right: 1px solid rgba(255,255,255,0.2);
  padding-right: 15px;
  text-align: center;
  flex: 1;
}
.cd-box:last-child {
  border-right: none;
  padding-right: 0;
}
.cd-num {
  display: block;
  font-size: clamp(1.8rem, 6vw, 2.5rem);
  font-weight: 700;
  font-family: 'Impact', 'Arial Black', sans-serif;
  color: #ffa500;
  letter-spacing: 1px;
}
.cd-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--pf-text);
  font-family: var(--font-sans);
  display: block;
  margin-top: 5px;
}

/* 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(255, 165, 0, 0.3);
  background: rgba(0, 0, 0, 0.6);
  color: #ffffff;
  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(255, 165, 0, 0.5);
  border-radius: 5px;
}
.ucapan-item {
  background: rgba(0,0,0,0.6);
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 10px;
  border: 1px solid rgba(255, 165, 0, 0.4);
  color: #fff;
}

/* 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.5);
}

/* Opening Screen Cover Overlay */
#opening-cover {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100svh;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 1s ease, visibility 1s;
}
.opening-content {
  text-align: center;
  width: 100%;
  max-width: 480px;
  padding: 10px 0 20px;
  background: transparent;
}

/* 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(255,255,255,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.8);
  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: #111;
  border: 1px solid #ffa500;
  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: url('assets/background.webp?v=3');
  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: 95px;
  right: 25px;
  width: 45px;
  height: 45px;
  background: var(--pf-accent);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0,0,0,0.8), inset 0 0 10px rgba(0,0,0,0.5);
  z-index: 1001;
  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 */
.guest-card {
  position: relative;
  box-sizing: border-box;
  margin: 10px auto 20px;
  padding: 35px 35px;
  background: url('assets/card penerima.webp?v=3') center/100% 100% no-repeat;
  width: 95%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  color: #fff;
}

/* Bottom Navbar */
.bottom-navbar {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  width: 88%;
  max-width: 380px;
  background: linear-gradient(180deg, #2a2a2a 0%, #111 100%);
  border: 1px solid rgba(255, 165, 0, 0.4);
  border-top: 2px solid #ffa500;
  border-bottom: 2px solid #ffa500;
  border-radius: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  box-sizing: border-box;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.9), inset 0 0 15px rgba(255, 165, 0, 0.1);
  z-index: 1000;
}
.bottom-navbar .nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--pf-muted);
  text-decoration: none;
  font-size: 0.65rem;
  font-weight: 500;
  transition: all 0.3s ease;
}
.bottom-navbar .nav-item i {
  width: 20px;
  height: 20px;
  margin-bottom: 3px;
  transition: all 0.3s ease;
}
.bottom-navbar .nav-item:hover,
.bottom-navbar .nav-item:active {
  color: var(--pf-accent);
}
.bottom-navbar .nav-item:hover i,
.bottom-navbar .nav-item:active i {
  transform: translateY(-3px);
}


/* Falling Animation for Opening Text */
.cover-frame-wrapper {
  z-index: 10 !important;
}
.falling-content {
  position: relative;
  z-index: 1;
}
.falling-content > * {
  opacity: 0;
  animation: fallFromBehind 1.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}
.falling-content > *:nth-child(1) { animation-delay: 0.2s; }
.falling-content > *:nth-child(2) { animation-delay: 0.6s; }
.falling-content > *:nth-child(3) { animation-delay: 1.0s; }
.falling-content > *:nth-child(4) { animation-delay: 1.4s; }
@keyframes fallFromBehind {
  0% {
    opacity: 0;
    transform: translateY(-120px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}


/* 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.8rem;
  color: var(--pf-accent);
  letter-spacing: 2px;
  text-transform: uppercase;
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }

/* Prevent animation until loaded */
body:not(.loaded) .falling-content > * {
  animation-play-state: paused !important;
  opacity: 0 !important;
}


/* 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;
}

/* Ucapan Items Override for Dark Theme */
.ucapan-item {
  background: rgba(0, 0, 0, 0.6) !important;
  border: 1px solid rgba(255, 165, 0, 0.4) !important;
  color: #fff !important;
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 10px;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.8);
  text-align: left;
}
.ucapan-item p {
  color: #eee !important;
}
.ucapan-item span {
  color: #fff !important;
}
