:root {
  --primary-color: #4a3e2e;
  --gold-accent: #c4a065;
  --glass-bg: rgba(255, 255, 255, 0.94);
  --text-dark: #3a3227;
  --burgundy-seal: #5c141e;
  --burgundy-seal-dark: #3b0a11;
  --transition-smooth: all 0.9s cubic-bezier(0.25, 1, 0.5, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Tajawal', sans-serif;
  background-color: #f7f3ed;
  color: var(--text-dark);
  line-height: 1.6;
  overflow-x: hidden;
}

.no-scroll { overflow: hidden; }

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(45px);
  transition: opacity 1.3s cubic-bezier(0.16, 1, 0.3, 1), transform 1.3s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-on-scroll.active {
  opacity: 1;
  transform: translateY(0);
}

/* بتلات الورود */
#petals-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 999;
  overflow: hidden;
}

.petal {
  position: absolute;
  top: -10%;
  opacity: 0.7;
  animation: fall linear infinite;
}

@keyframes fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 0.7; }
  100% { transform: translateY(110vh) rotate(360deg); opacity: 0; }
}

/* المغلف والفيديو المعالج لمنع الشاشة السوداء */
#envelope-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  background-color: #f7f3ed;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 1.2s ease, visibility 1.2s ease;
}

#envelope-wrapper.fade-out {
  opacity: 0;
  visibility: hidden;
}

#envelope-cover {
  position: relative;
  width: 100%;
  height: 100%;
  cursor: pointer;
  z-index: 2;
}

#envelope-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#envelope-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
  z-index: 1;
  background: transparent;
}

/* بطاقة الدعوة */
#wedding-card {
  max-width: 580px;
  margin: 0 auto;
  padding: 0 15px 40px;
  text-align: center;
}

.banner-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 50px 20px 30px;
  background: url('banner-bg.jpg') center/cover no-repeat;
  border-radius: 0 0 30px 30px;
  overflow: hidden;
}

.banner-overlay {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82) 0%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0.9) 100%);
  z-index: 1;
}

.banner-content { position: relative; z-index: 2; text-align: center; }
.bismillah { font-family: 'Amiri', serif; font-size: 1.6rem; color: var(--primary-color); }
.quran-verse { font-family: 'Amiri', serif; font-style: italic; font-size: 1.1rem; margin: 12px 0 20px; color: #4a3e31; }
.divider-line { width: 80px; height: 1px; background: var(--gold-accent); margin: 18px auto; }
.groom-name, .bride-name { font-family: 'Aref Ruqaa', serif; font-size: 3.8rem; color: #2c1f14; line-height: 1.2; }
.and-symbol { font-family: 'Cormorant Garamond', serif; font-size: 2.4rem; color: var(--gold-accent); }
.wedding-subtitle { font-family: 'Cormorant Garamond', serif; letter-spacing: 3px; font-size: 0.9rem; color: #4a3e31; margin-bottom: 20px; font-weight: 600; }

.wedding-date-badge {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  border-top: 1px solid var(--gold-accent);
  border-bottom: 1px solid var(--gold-accent);
  padding: 6px 35px;
  display: inline-block;
  letter-spacing: 4px;
}

.scroll-indicator {
  position: relative;
  z-index: 2;
  margin-top: 35px;
  font-size: 0.85rem;
  color: var(--primary-color);
  font-weight: bold;
}

.glass-section {
  margin: 35px 0;
  padding: 35px 22px;
  background: var(--glass-bg);
  border-radius: 20px;
  border: 1px solid #eae2d5;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
}

.cursive-header {
  font-family: 'Amiri', serif !important;
  font-size: 2.2rem !important;
  color: var(--primary-color);
  font-weight: bold;
  margin-bottom: 30px !important;
}

/* برنامج الحفل */
.schedule-section {
  padding: 40px 20px !important;
}

.timeline-vertical {
  position: relative;
  max-width: 440px;
  margin: 0 auto;
  padding: 0;
}

.timeline-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: #cbb490;
  transform: translateX(-50%);
  z-index: 1;
}

.timeline-line::before, .timeline-line::after {
  content: '◆';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  color: #cbb490;
  font-size: 8px;
}
.timeline-line::before { top: -8px; }
.timeline-line::after { bottom: -8px; }

.floating-scroll-flower {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.4rem;
  z-index: 3;
  background: #fdfaf6;
  border-radius: 50%;
  padding: 2px;
  transition: transform 0.08s linear;
  pointer-events: none;
  line-height: 1;
}

.timeline-row {
  display: flex;
  align-items: center;
  margin-bottom: 40px;
  position: relative;
  z-index: 2;
}

.timeline-row:last-child {
  margin-bottom: 0;
}

.time-col {
  flex: 1;
  text-align: left;
  padding-left: 20px;
  font-family: 'Tajawal', sans-serif;
  font-size: 1.1rem;
  color: #4a3e2e;
  font-weight: bold;
}

.node-col {
  width: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.diamond-node {
  color: #b5935b;
  font-size: 0.7rem;
  background: #fdfaf6;
  padding: 2px;
}

.desc-col {
  flex: 1;
  text-align: right;
  padding-right: 20px;
  font-family: 'Tajawal', sans-serif;
  font-size: 1.1rem;
  color: #4a3e2e;
}

/* موقع الحفل */
.location-section {
  text-align: center;
}

.venue-name {
  font-family: 'Amiri', serif;
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--primary-color);
}

.venue-address {
  font-size: 0.95rem;
  color: #776a5c;
  margin-bottom: 20px;
}

.venue-illustration {
  width: 100%;
  max-width: 440px;
  margin: 15px auto 25px;
  opacity: 0.9;
}

.venue-svg {
  width: 100%;
  height: auto;
}

/* دوائر ألوان Dress Code متتابعة الظهور */
.color-swatches {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin: 15px 0 20px;
  flex-wrap: wrap;
}

.swatch-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  opacity: 0;
  transform: translateY(20px) scale(0.8);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dress-code-section.active .swatch-item {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.dress-code-section.active .swatch-item:nth-child(1) { transition-delay: 0.2s; }
.dress-code-section.active .swatch-item:nth-child(2) { transition-delay: 0.35s; }
.dress-code-section.active .swatch-item:nth-child(3) { transition-delay: 0.5s; }
.dress-code-section.active .swatch-item:nth-child(4) { transition-delay: 0.65s; }
.dress-code-section.active .restricted-color-box .swatch-item { transition-delay: 0.85s; }

.swatch-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
  position: relative;
}

.swatch-circle.restricted::after {
  content: '✕';
  position: absolute;
  color: #fff;
  font-size: 1rem;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-weight: bold;
}

.swatch-label {
  font-size: 0.8rem;
  color: #666;
}

.restricted-color-box {
  background: #fff5f5;
  border: 1px dashed #e5c1c1;
  padding: 12px;
  border-radius: 12px;
  margin-top: 15px;
}

/* صورة احتفالية ختامية */
.ending-celebration-section {
  margin: 30px 0;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(0,0,0,0.06);
}

.ending-image-container {
  position: relative;
  width: 100%;
  height: 260px;
}

.ending-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ending-image-overlay {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  justify-content: center;
  align-items: center;
}

.ending-quote {
  color: #fff;
  font-family: 'Amiri', serif;
  font-size: 1.8rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.6);
}

/* قسم تأكيد الحضور الفاخر */
.rsvp-luxury-section {
  padding: 50px 20px 60px;
  text-align: center;
  background: transparent;
}

.rsvp-gold-title {
  font-family: 'Amiri', serif;
  font-size: 2.6rem;
  color: var(--gold-accent);
  font-weight: 400;
  letter-spacing: 2px;
  margin-bottom: 15px;
}

.rsvp-subtext {
  font-family: 'Tajawal', sans-serif;
  font-size: 1.05rem;
  color: #635746;
  line-height: 1.7;
  margin-bottom: 30px;
  font-weight: 300;
}

/* الختم الشمعي الفاخر */
.wax-seal-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 20px 0 15px;
  cursor: pointer;
}

.wax-seal-btn {
  width: 115px;
  height: 115px;
  background: radial-gradient(circle at 35% 35%, #801b29 0%, var(--burgundy-seal) 55%, var(--burgundy-seal-dark) 100%);
  border-radius: 50%;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 
    0 10px 22px rgba(92, 20, 30, 0.4),
    inset 0 3px 6px rgba(255, 255, 255, 0.25),
    inset 0 -5px 12px rgba(0, 0, 0, 0.6);
  border: 4px solid #6b1722;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.wax-seal-btn:hover {
  transform: scale(1.06);
}

.wax-seal-inner {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  border: 1.5px dashed rgba(212, 175, 55, 0.65);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle at 40% 40%, rgba(120, 20, 32, 0.9), rgba(50, 8, 14, 0.95));
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

.seal-text-rsvp {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #e6c88b;
  letter-spacing: 2px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.seal-ornament {
  font-size: 0.65rem;
  color: #c4a065;
  margin-top: -2px;
  opacity: 0.85;
}

/* تلميح الضغط (السهم + الكلمة) */
.click-hint-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  margin-bottom: 35px;
}

.up-arrow {
  color: var(--gold-accent);
  font-size: 1.1rem;
  line-height: 1;
  margin-bottom: 2px;
}

.click-to-open-text {
  font-family: 'Amiri', serif;
  font-size: 1.4rem;
  color: var(--gold-accent);
  font-style: italic;
}

/* العبارة والأسماء الختامية */
.closing-love-text {
  font-family: 'Amiri', serif;
  font-size: 2.1rem;
  color: var(--gold-accent);
  font-style: italic;
  margin-bottom: 12px;
}

.final-couple-names {
  font-family: 'Amiri', serif;
  font-size: 1.7rem;
  color: var(--gold-accent);
  letter-spacing: 1px;
}

.map-container {
  border-radius: 12px;
  overflow: hidden;
  margin: 20px 0 15px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.btn-primary, .btn-secondary {
  display: inline-block;
  padding: 10px 28px;
  border-radius: 30px;
  text-decoration: none;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: all 0.4s ease;
}

.btn-primary { background: var(--primary-color); color: #fff; }
.btn-secondary { background: transparent; color: var(--primary-color); border: 1px solid var(--gold-accent); }

.countdown-grid { display: flex; justify-content: center; gap: 15px; }
.time-box { background: #ffffff; padding: 14px; border-radius: 12px; min-width: 70px; border: 1px solid #f0e7d8; }
.time-box span { font-family: 'Cormorant Garamond', serif; font-size: 1.8rem; font-weight: bold; color: var(--primary-color); }
.time-box label { font-size: 0.75rem; color: #888; }

.gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.gallery-card { border-radius: 14px; overflow: hidden; height: 210px; }
.gallery-card img { width: 100%; height: 100%; object-fit: cover; }

.modal { display: none; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.5); z-index: 10000; justify-content: center; align-items: center; }
.modal-content { width: 90%; max-width: 400px; position: relative; text-align: right; background: #ffffff; }
.close-btn { position: absolute; top: 15px; left: 20px; font-size: 1.5rem; cursor: pointer; }
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; font-size: 0.85rem; }
.form-group input, .form-group select { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 8px; }

.footer { padding: 40px 0; color: #777; }
.footer-names { font-family: 'Aref Ruqaa', serif; color: var(--primary-color); font-size: 1.8rem; margin-top: 5px; }