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

/* ===== CSS VARIABLES ===== */
:root {
  --gold: #C9A96E;
  --gold-light: #F5E6C8;
  --gold-dark: #A07840;
  --rose: #F9D5D3;
  --rose-dark: #C8848A;
  --cream: #FDFAF5;
  --white: #FFFFFF;
  --dark: #2C1810;
  --gray: #8a7a6e;
  --font-serif: 'Playfair Display', 'Georgia', serif;
  --font-body: 'Cormorant Garamond', 'Georgia', serif;
}

/* ===== BASE ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background-color: var(--cream);
  color: var(--dark);
  overflow-x: hidden;
  /* Force mobile layout on desktop */
  display: flex;
  justify-content: center;
  background: linear-gradient(135deg, #f8f4ee 0%, #fdfaf5 50%, #f8f0e8 100%);
  min-height: 100vh;
}

#app {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  background: var(--white);
  position: relative;
  box-shadow: 0 0 60px rgba(0,0,0,0.12);
  overflow-x: hidden;
}

/* ===== DECORATIVE BORDER PATTERN ===== */
.ornament-border {
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  position: relative;
}
.ornament-border::before,
.ornament-border::after {
  content: '✦';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold);
  font-size: 10px;
}
.ornament-border::before { left: calc(50% - 40px); }
.ornament-border::after { left: calc(50% + 30px); }

/* ===== LANDING SCREEN ===== */
#landing-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #fdfaf5 0%, #f8f0e8 40%, #fdf6ed 100%);
  transition: opacity 0.9s ease, transform 0.9s ease;
  overflow: hidden;
}

#landing-screen.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(1.05);
}

/* Peacock decoration */
.peacock-left, .peacock-right {
  position: absolute;
  bottom: 0;
  width: 140px;
  height: 240px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: bottom center;
  animation: peacockSway 4s ease-in-out infinite;
}
.peacock-left {
  left: -10px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 220'%3E%3Cellipse cx='60' cy='160' rx='35' ry='55' fill='%23c9a96e' opacity='0.15'/%3E%3Cellipse cx='60' cy='140' rx='25' ry='40' fill='%23a07840' opacity='0.2'/%3E%3Ccircle cx='60' cy='95' r='20' fill='%23c9a96e' opacity='0.3'/%3E%3Cpath d='M60,75 Q40,40 20,20 Q50,45 60,75' fill='%23c9a96e' opacity='0.4'/%3E%3Cpath d='M60,75 Q80,30 100,10 Q75,48 60,75' fill='%23a07840' opacity='0.4'/%3E%3Cpath d='M60,80 Q30,50 10,60 Q38,62 60,80' fill='%23c9a96e' opacity='0.3'/%3E%3Cpath d='M60,80 Q90,45 110,55 Q85,60 60,80' fill='%23a07840' opacity='0.3'/%3E%3Ccircle cx='60' cy='95' r='8' fill='%23c9a96e'/%3E%3Ccircle cx='57' cy='90' r='3' fill='%23fff'/%3E%3C/svg%3E");
  transform-origin: bottom center;
}
.peacock-right {
  right: -10px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 220'%3E%3Cellipse cx='60' cy='160' rx='35' ry='55' fill='%23c9a96e' opacity='0.15'/%3E%3Cellipse cx='60' cy='140' rx='25' ry='40' fill='%23a07840' opacity='0.2'/%3E%3Ccircle cx='60' cy='95' r='20' fill='%23c9a96e' opacity='0.3'/%3E%3Cpath d='M60,75 Q40,40 20,20 Q50,45 60,75' fill='%23c9a96e' opacity='0.4'/%3E%3Cpath d='M60,75 Q80,30 100,10 Q75,48 60,75' fill='%23a07840' opacity='0.4'/%3E%3Cpath d='M60,80 Q30,50 10,60 Q38,62 60,80' fill='%23c9a96e' opacity='0.3'/%3E%3Cpath d='M60,80 Q90,45 110,55 Q85,60 60,80' fill='%23a07840' opacity='0.3'/%3E%3Ccircle cx='60' cy='95' r='8' fill='%23c9a96e'/%3E%3Ccircle cx='63' cy='90' r='3' fill='%23fff'/%3E%3C/svg%3E");
  transform: scaleX(-1);
  transform-origin: bottom center;
  animation-direction: reverse;
}
@keyframes peacockSway {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg); }
}
.peacock-right { transform: scaleX(-1); }
.peacock-right:hover { transform: scaleX(-1) rotate(3deg); }

/* Landing content */
.landing-tagline {
  font-family: var(--font-body);
  font-size: 0.85rem;
  letter-spacing: 0.25em;
  color: var(--gold-dark);
  text-transform: uppercase;
}

.landing-names {
  font-family: var(--font-serif);
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.15;
  text-align: center;
}

.landing-ampersand {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 2rem;
  color: var(--gold);
  display: block;
  line-height: 1;
}

/* Guest card on landing */
.guest-card-landing {
  background: linear-gradient(135deg, var(--gold-light), #fff9f0);
  border: 1px solid var(--gold);
  border-radius: 12px;
  padding: 12px 24px;
  text-align: center;
}

.btn-open {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--white);
  background: linear-gradient(135deg, var(--gold-dark), var(--gold), #e8c170);
  border: none;
  border-radius: 50px;
  padding: 14px 40px;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(160, 120, 64, 0.35), 0 0 0 3px rgba(201,169,110,0.2);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-open::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  transition: left 0.5s ease;
}

.btn-open:hover { 
  transform: translateY(-2px); 
  box-shadow: 0 12px 35px rgba(160, 120, 64, 0.45);
}
.btn-open:hover::before { left: 100%; }
.btn-open:active { transform: translateY(0); }

/* ===== FALLING HEARTS ===== */
#hearts-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 999;
  display: none;
}
#hearts-canvas.active { display: block; }

/* ===== MAIN CONTENT ===== */
#main-content {
  opacity: 0;
  transition: opacity 0.8s ease 0.3s;
  display: none;
}
#main-content.visible {
  opacity: 1;
  display: block;
}

/* ===== SECTION STYLES ===== */
section {
  padding: 50px 24px;
  position: relative;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--dark);
  text-align: center;
  line-height: 1.3;
}

.section-subtitle {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--gray);
  text-align: center;
  font-style: italic;
  letter-spacing: 0.05em;
}

.gold-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px auto;
  width: fit-content;
}
.gold-divider::before, .gold-divider::after {
  content: '';
  display: block;
  width: 50px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}
.gold-divider::after {
  background: linear-gradient(90deg, var(--gold), transparent);
}
.gold-divider span {
  color: var(--gold);
  font-size: 14px;
}

/* ===== HERO SECTION ===== */
#hero-section {
  background: linear-gradient(180deg, #f8f4ee 0%, #fdfaf5 100%);
  text-align: center;
  padding: 60px 24px 40px;
  position: relative;
  overflow: hidden;
}

#hero-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 200px;
  background: linear-gradient(180deg, rgba(201,169,110,0.08) 0%, transparent 100%);
}

.bismillah-text {
  font-family: 'EB Garamond', serif;
  font-size: 2rem;
  color: var(--gold-dark);
  line-height: 1.8;
  direction: rtl;
}

.ayat-arabic {
  font-family: 'EB Garamond', serif;
  font-size: 1.3rem;
  color: var(--dark);
  line-height: 2;
  direction: rtl;
  opacity: 0.85;
}

/* ===== COUPLE SECTION ===== */
#couple-section {
  background: var(--white);
}

.couple-photo-frame {
  width: 140px;
  height: 170px;
  margin: 0 auto;
  position: relative;
}

.couple-photo-frame::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 60% 40% 60% 40% / 40% 60% 40% 60%;
  background: linear-gradient(135deg, var(--gold), var(--gold-light), var(--gold));
  z-index: 0;
  animation: morphBorder 8s ease-in-out infinite;
}

@keyframes morphBorder {
  0%, 100% { border-radius: 60% 40% 60% 40% / 40% 60% 40% 60%; }
  25% { border-radius: 40% 60% 40% 60% / 60% 40% 60% 40%; }
  50% { border-radius: 50% 50% 60% 40% / 50% 50% 40% 60%; }
  75% { border-radius: 60% 40% 50% 50% / 40% 60% 50% 50%; }
}

.couple-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 60% 40% 60% 40% / 40% 60% 40% 60%;
  position: relative;
  z-index: 1;
  animation: morphBorder 8s ease-in-out infinite;
}

.couple-separator {
  text-align: center;
  position: relative;
  padding: 20px 0;
}

.couple-separator::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-light), transparent);
}

.ampersand-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px; height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), #e8c170);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.5rem;
  color: white;
  position: relative;
  z-index: 1;
  box-shadow: 0 4px 15px rgba(201,169,110,0.4);
}

.groom-name, .bride-name {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--dark);
  text-align: center;
}

/* ===== COUNTDOWN ===== */
#countdown-section {
  background: linear-gradient(160deg, var(--dark) 0%, #1a0e08 100%);
  color: white;
  text-align: center;
  position: relative;
  overflow: hidden;
}

#countdown-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23c9a96e' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.countdown-number {
  font-family: var(--font-serif);
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
  display: block;
  text-shadow: 0 0 30px rgba(201,169,110,0.3);
}

.countdown-label {
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
}

.countdown-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(201,169,110,0.2);
  border-radius: 12px;
  padding: 14px 10px;
  backdrop-filter: blur(8px);
  flex: 1;
}

.event-detail-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(201,169,110,0.2);
  border-radius: 16px;
  padding: 20px;
  text-align: left;
  position: relative;
  overflow: hidden;
}

.event-detail-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 100%;
  background: linear-gradient(180deg, var(--gold), transparent);
}

/* ===== STORY SECTION ===== */
#story-section {
  background: var(--cream);
}

.story-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  position: relative;
}

.story-item::before {
  content: '';
  position: absolute;
  left: 24px;
  top: 48px;
  width: 1px;
  height: calc(100% + 24px);
  background: linear-gradient(180deg, var(--gold), transparent);
}

.story-item:last-child::before { display: none; }

.story-year-badge {
  width: 48px;
  min-width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 0.65rem;
  font-weight: 700;
  color: white;
  box-shadow: 0 4px 15px rgba(201,169,110,0.35);
}

.story-photo {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 12px;
  margin-top: 10px;
}

/* ===== GALLERY ===== */
#gallery-section {
  background: var(--white);
  padding: 50px 0;
}

#gallery-section .section-wrapper {
  padding: 0 24px;
}

.gallery-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 16px 24px;
  scrollbar-width: none;
}
.gallery-scroll::-webkit-scrollbar { display: none; }

.gallery-item {
  flex: 0 0 200px;
  height: 280px;
  scroll-snap-align: start;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.gallery-item:hover img { transform: scale(1.05); }

.gallery-nav {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 0 24px;
  margin-top: 8px;
}

.gallery-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  background: white;
  color: var(--gold-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all 0.3s;
}
.gallery-btn:hover { background: var(--gold); color: white; }

/* ===== HADIS ===== */
#hadis-section {
  background: linear-gradient(135deg, var(--gold-light) 0%, #fff9f2 100%);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hadis-text {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-style: italic;
  color: var(--dark);
  line-height: 1.8;
}

/* ===== GIFT ===== */
#gift-section {
  background: var(--cream);
}

.gift-card {
  background: white;
  border: 1px solid var(--gold-light);
  border-radius: 16px;
  padding: 18px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(201,169,110,0.1);
}

.gift-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold), var(--gold-dark));
}

.copy-btn {
  background: none;
  border: 1px solid var(--gold);
  color: var(--gold-dark);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  font-family: var(--font-body);
}
.copy-btn:hover { background: var(--gold-light); }

/* Toast notification */
.copy-toast {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--dark);
  color: white;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 10;
}
.copy-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== RSVP ===== */
#rsvp-section {
  background: var(--white);
}

.rsvp-input {
  width: 100%;
  border: 1px solid #e5d9c8;
  border-radius: 10px;
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--dark);
  background: var(--cream);
  transition: border-color 0.2s;
  outline: none;
}
.rsvp-input:focus { border-color: var(--gold); }

#rsvp-container {
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-light) transparent;
}
#rsvp-container::-webkit-scrollbar { width: 4px; }
#rsvp-container::-webkit-scrollbar-thumb { background: var(--gold-light); border-radius: 4px; }

.rsvp-card {
  background: var(--cream);
  border-left: 3px solid var(--gold);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
}

/* ===== MUSIC BUTTON ===== */
#music-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  border: none;
  color: white;
  cursor: pointer;
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 20px rgba(160,120,64,0.4);
  transition: all 0.3s;
}
#music-btn.visible { display: flex; }
#music-btn:hover { transform: scale(1.1); }
#music-btn.playing { animation: pulse 2s ease infinite; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(160,120,64,0.4); }
  50% { box-shadow: 0 4px 30px rgba(160,120,64,0.7), 0 0 0 6px rgba(201,169,110,0.15); }
}

/* ===== MAPS BUTTON ===== */
.maps-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: white;
  border-radius: 50px;
  padding: 12px 24px;
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  box-shadow: 0 6px 20px rgba(160,120,64,0.3);
  transition: all 0.3s;
}
.maps-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 25px rgba(160,120,64,0.4); }

/* ===== FOOTER ===== */
footer {
  background: var(--dark);
  color: rgba(255,255,255,0.7);
  text-align: center;
  padding: 30px 24px;
}

footer img { 
  height: 40px;
  filter: brightness(0) invert(1) opacity(0.7);
  margin: 0 auto 8px;
  display: block;
}

/* ===== AOS OVERRIDES FOR TEXT ===== */
[data-aos='fade-right-word'] {
  opacity: 0;
  transform: translateX(-20px);
  transition-property: opacity, transform;
}
[data-aos='fade-right-word'].aos-animate {
  opacity: 1;
  transform: translateX(0);
}

[data-aos='fade-left-word'] {
  opacity: 0;
  transform: translateX(20px);
  transition-property: opacity, transform;
}
[data-aos='fade-left-word'].aos-animate {
  opacity: 1;
  transform: translateX(0);
}

/* ===== DOOR OPEN ANIMATION ===== */
.door-left {
  transform-origin: left center;
}
.door-right {
  transform-origin: right center;
}
[data-aos='door-left'] {
  opacity: 0;
  transform: perspective(400px) rotateY(-60deg);
  transition-property: opacity, transform;
}
[data-aos='door-left'].aos-animate {
  opacity: 1;
  transform: perspective(400px) rotateY(0deg);
}
[data-aos='door-right'] {
  opacity: 0;
  transform: perspective(400px) rotateY(60deg);
  transition-property: opacity, transform;
}
[data-aos='door-right'].aos-animate {
  opacity: 1;
  transform: perspective(400px) rotateY(0deg);
}

/* ===== RESPONSIVE: Desktop stays mobile width ===== */
@media (min-width: 481px) {
  #app { margin: 0 auto; }
  #landing-screen { 
    align-items: center;
  }
  #hearts-canvas { max-width: 480px; left: 50%; transform: translateX(-50%); }
  #music-btn { right: calc(50% - 240px + 16px); }
}
