@import url('https://fonts.googleapis.com/css2?family=Philosopher:ital,wght@0,400;0,700;1,400&family=Great+Vibes&family=Inter:wght@300;400;600&display=swap');

:root {
  --primary: #e6b325;
  --primary-light: #ffeaa7;
  --primary-dark: #6b0000;
  --bg-color: #8c0000;
  --bg-color-rgb: 140, 0, 0;
  --bg-page: #151515;
  --text: #fdfdfd;
  --text-main: #f2e3c6;
  --text-dark: #d4af37;
  --white: #ffffff;
  --gold-grad: linear-gradient(135deg, #bf953f, #fcf6ba, #b38728, #fbf5b7, #aa771c);
  --font-heading: 'Philosopher', serif;
  --font-body: 'Philosopher', serif;
  --font-script: 'Great Vibes', cursive;
}
/* Universal Reset */
*, *::before, *::after {
  box-sizing: border-box;
}
/* Basic Reset & Typography */
body, html {
  margin: 0; padding: 0;
  width: 100%; height: 100%;
  background-color: var(--bg-color);
  font-family: var(--font-body);
  overflow: hidden;
  overscroll-behavior-x: none;
} /* Important for flipbook full viewport */

h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading); font-weight: normal; margin: 0; color: var(--primary-light); }
.text-center { text-align: center; }

/* Flipbook Container */
.flipbook-viewport {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg-color);
}
.container {
  width: 100%;
  max-width: 500px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
}
.flipbook {
  display: none; /* St.PageFlip will change to block */
}
.page {
  background: var(--bg-page);
  color: var(--text-main);
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 50px rgba(0,0,0,0.8);
  touch-action: pan-y;
}

.page-border {
  position: absolute;
  top: 15px;
  bottom: 15px;
  left: 15px;
  right: 15px;
  border: 1px solid rgba(212, 175, 55, 0.3);
  pointer-events: none;
  z-index: 5;
}

@keyframes goldShimmer {
  0%, 100% {
    box-shadow: 0 0 4px rgba(212, 175, 55, 0.1), inset 0 0 4px rgba(212, 175, 55, 0.1);
    border-color: rgba(212, 175, 55, 0.3);
  }
  50% {
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.6), inset 0 0 10px rgba(212, 175, 55, 0.4);
    border-color: rgba(212, 175, 55, 0.9);
  }
}
/* Shadow for spine / page fold effect */
.page::before {
    content: '';
    position: absolute;
    top:0; bottom:0; left:0; width:10%;
    background: linear-gradient(to right, rgba(0,0,0,0.6) 0%, transparent 100%);
    pointer-events: none;
    z-index: 10;
}

/* Page Content Wrapper */
.page-content {
  position: absolute;
  top: 40px; bottom: 60px; left: 50px; right: 50px;
  padding: 10px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  overflow: visible;
  scrollbar-width: none;
}
.page-content::-webkit-scrollbar { display: none; }

/* Minang Ornaments */
.minang-bawah {
  position: absolute;
  left: 0;
  width: 100%;
  z-index: 10;
  pointer-events: none;
}
.minang-bawah.top {
  top: 0;
}

.minang-bawah.bottom {
  bottom: 0;
  transform: scaleY(-1);
}

.minang-bg-bawah {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: -2;
  pointer-events: none;
  background-repeat: repeat;
  background-size: auto;
}

.minang-rumah {
  position: absolute;
  bottom: 5%;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 450px;
  z-index: -1;
  pointer-events: none;
  opacity: 0.6;
}

.minang-samping {
  position: absolute;
  top: 0;
  width: 45px;
  height: 100%;
  background-repeat: repeat-y;
  background-size: 100% auto;
  z-index: 10;
  pointer-events: none;
}
.minang-samping.left { left: 0; }
.minang-samping.right { right: 0; transform: scaleX(-1); }

/* Frame Cover */
.frame-cover {
  width: 90%;
  max-width: 300px;
  margin: 20px auto;
  position: relative;
}
.frame-cover img.frame-bg {
  width: 100%;
  display: block;
}
.frame-cover .cover-text {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
}

/* Elements */
.btn {
  display: inline-block;
  padding: 10px 24px;
  background: var(--gold-grad);
  color: #000;
  font-family: var(--font-heading);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: none;
  border-radius: 4px;
  text-decoration: none;
  margin-top: 15px;
  cursor: pointer;
  font-size: 14px;
  transition: opacity 0.3s;
}
.btn:hover { opacity: 0.9; }

.btn-outline {
  display: inline-block;
  padding: 8px 20px;
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
  font-family: var(--font-heading);
  border-radius: 4px;
  text-decoration: none;
  margin: 5px;
  transition: background 0.3s, color 0.3s;
}
.btn-outline:hover {
  background: rgba(212, 175, 55, 0.1);
}

input, textarea, select {
  width: 100%;
  padding: 12px;
  margin-bottom: 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(212, 175, 55, 0.3);
  color: #fff;
  border-radius: 4px;
  font-family: var(--font-body);
}
select option {
  color: #000;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
}

.mempelai-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid transparent;
  background: var(--gold-grad);
  -webkit-background-clip: padding-box;
  padding: 3px;
  margin-bottom: 15px;
}

/* Event Card inside page */
.event-card {
  width: 100%;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(212, 175, 55, 0.3);
  padding: 20px;
  margin-bottom: 20px;
  border-radius: 4px;
}

/* Swipe Hint Overlay */
.swipe-hint {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--primary);
  font-size: 12px;
  animation: bounce 2s infinite;
  z-index: 100;
  pointer-events: none;
}
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {transform: translateX(-50%) translateY(0);}
  40% {transform: translateX(-50%) translateY(-10px);}
  60% {transform: translateX(-50%) translateY(-5px);}
}

/* Hide scrollbars for a cleaner mobile experience */
.no-scrollbar {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
  overflow-x: hidden !important; /* Force prevent horizontal scroll */
}
.no-scrollbar::-webkit-scrollbar {
  display: none; /* Chrome, Safari and Opera */
}

/* Glitter Text & Button Animations */
.glitter-text {
  background: linear-gradient(to right, #d4af37 20%, #fff8e7 40%, #f9d976 60%, #d4af37 80%);
  background-size: 200% auto;
  color: #000;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shine 3s linear infinite, pulseText 2s ease-in-out infinite alternate;
}

@keyframes shine {
  to { background-position: 200% center; }
}
@keyframes pulseText {
  0% { transform: scale(1); filter: drop-shadow(0 0 2px rgba(212,175,55,0.3)); }
  100% { transform: scale(1.05); filter: drop-shadow(0 0 10px rgba(212,175,55,0.8)); }
}

.shimmer-btn {
  position: relative;
  overflow: hidden;
  animation: btnPulse 2s ease-in-out infinite alternate;
}
.shimmer-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.8) 50%, rgba(255,255,255,0) 100%);
  transform: skewX(-20deg);
  animation: sweep 3s infinite;
}
@keyframes btnPulse {
  0% { transform: scale(1); box-shadow: 0 4px 10px rgba(212,175,55,0.4); }
  100% { transform: scale(1.08); box-shadow: 0 4px 20px rgba(212,175,55,0.9); }
}
@keyframes sweep {
  0% { left: -100%; }
  20% { left: 200%; }
  100% { left: 200%; }
}

/* In-Page Animations */
.anim-fade-up, .anim-slide-left, .anim-slide-right, .anim-typewriter {
  opacity: 0;
  visibility: hidden;
}

.active-page .anim-fade-up, 
.active-page .anim-slide-left, 
.active-page .anim-slide-right, 
.active-page .anim-typewriter {
  visibility: visible;
}

.active-page .anim-fade-up {
  animation: fadeUp 0.8s ease-out forwards;
}
.active-page .anim-slide-left {
  animation: slideLeft 0.8s ease-out forwards;
}
.active-page .anim-slide-right {
  animation: slideRight 0.8s ease-out forwards;
}
.active-page .anim-typewriter {
  white-space: nowrap;
  overflow: hidden;
  border-right: 2px solid var(--primary);
  animation: typing 1.5s steps(30, end) forwards, blink 0.75s step-end 3 forwards;
  display: inline-block;
  max-width: 100%;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideLeft {
  from { opacity: 0; transform: translateX(-50px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes slideRight {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes typing {
  from { width: 0; opacity: 1; }
  to { width: 100%; opacity: 1; }
}
@keyframes blink {
  from, to { border-color: transparent; }
  50% { border-color: var(--primary); }
}

.delay-1 { animation-delay: 0.2s !important; }
.delay-2 { animation-delay: 0.4s !important; }
.delay-3 { animation-delay: 0.6s !important; }
.delay-4 { animation-delay: 0.8s !important; }

/* Responsive Fix for Short Mobile Screens */
@media screen and (max-height: 750px) {
  .frame-cover {
    width: 140px !important;
    height: 140px !important;
    margin-bottom: 10px !important;
  }
  .glitter-text {
    font-size: 2.2rem !important;
  }
  #countdown {
    margin-top: 10px !important;
    transform: scale(0.9);
  }
}
@media screen and (max-height: 650px) {
  .frame-cover {
    width: 120px !important;
    height: 120px !important;
    margin-bottom: 5px !important;
  }
  .glitter-text {
    font-size: 1.8rem !important;
  }
  #countdown {
    transform: scale(0.8);
    margin-top: 5px !important;
  }
  .page-content p {
    margin-bottom: 5px !important;
  }
}

/* Responsive Fix for Short Mobile Screens */
@media screen and (max-height: 750px) {
  .cover-frame-wrapper {
      min-height: 280px !important;
  }
  .cover-names {
      font-size: 3rem !important;
  }
  .cover-section {
      padding: 15px 15px !important;
  }
  .cover-text-bottom {
      margin-top: 15px !important;
  }
}
@media screen and (max-height: 650px) {
  .cover-frame-wrapper {
      min-height: 220px !important;
  }
  .cover-names {
      font-size: 2.5rem !important;
  }
  .cover-title-top {
      margin-bottom: 10px !important;
  }
}
