/* تنظیمات و ریست کلی استایل‌ها */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

/* بارگذاری فونت‌های اختصاصی پروژه: استعداد و گلزار */
@font-face {
  font-family: 'Estedad';
  src: url('assets/Estedad-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Estedad';
  src: url('assets/Estedad-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Gulzar';
  src: url('assets/Gulzar.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --gold-primary: #dfba73;
  --gold-light: #fbe6b5;
  --gold-dark: #b88f3e;
  --text-pure: #ffffff;
  --font-fa: 'Estedad', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-calligraphy: 'Gulzar', serif;
  --font-en-cursive: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
}

body {
  font-family: var(--font-fa);
  background-color: #060709;
  color: var(--text-pure);
  direction: rtl;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-x: hidden;
  user-select: none;
  -webkit-user-select: none;
}

/* ======================================================== */
/* بخش اول: پاکت لوکس تمام‌صفحه لبه‌به‌لبه و انیمیشن درآمدن نامه */
/* ======================================================== */
.envelope-screen {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: 100vh;
  height: 100dvh;
  z-index: 1000;
  background-color: #060709;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.95s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.75s ease;
}

/* بدنه اصلی پاکت گیپوری تمام‌صفحه بدون حاشیه و قاب اضافه */
.envelope-body {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
}

.envelope-base-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* درپوش بالایی پاکت با تا خوردن سه‌بعدی به سمت بالا */
.envelope-flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 52%;
  transform-origin: top center;
  transform-style: preserve-3d;
  transition: transform 0.85s cubic-bezier(0.35, 1, 0.45, 1) 0.1s;
  z-index: 5;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.55));
}

.flap-front {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.envelope-flap-img {
  width: 100%;
  height: 192%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

/* مرکز مهر مومی سلطنتی با دو نیمه متصل */
.wax-seal-center {
  position: absolute;
  top: 50.8%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 184px;
  height: 184px;
  z-index: 10;
  display: flex;
}

/* هاله ملایم دور مهر مومی */
.seal-glow-ring {
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(223, 186, 115, 0.35) 0%, transparent 70%);
  animation: seal-pulse 2.2s infinite ease-in-out;
  pointer-events: none;
}

@keyframes seal-pulse {
  0%, 100% { transform: scale(0.96); opacity: 0.5; }
  50% { transform: scale(1.1); opacity: 0.9; }
}

.wax-half {
  width: 92px;
  height: 184px;
  position: absolute;
  top: 0;
  overflow: hidden;
  transition: transform 0.65s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.65s ease;
}

.wax-half img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.wax-left {
  left: 0;
  transform-origin: left center;
}

.wax-right {
  right: 0;
  transform-origin: right center;
}

/* خط بارقه نور هنگام ترکیدن مهر */
.seal-crack-flare {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  background: #ffffff;
  box-shadow: 0 0 15px #fbe6b5, 0 0 30px #dfba73;
  transform: translateX(-50%) scaleY(0);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  z-index: 15;
}

/* وضعیت انیمیشن وقتی روی پاکت کلیک می‌شود */
.envelope-screen.opening .wax-left {
  transform: translateX(-60px) rotate(-14deg);
  opacity: 0;
}

.envelope-screen.opening .wax-right {
  transform: translateX(60px) rotate(14deg);
  opacity: 0;
}

.envelope-screen.opening .seal-crack-flare {
  transform: translateX(-50%) scaleY(1);
  opacity: 1;
}

.envelope-screen.opening .envelope-flap {
  transform: rotateX(175deg);
}

.envelope-screen.opening .seal-glow-ring {
  opacity: 0;
}

.envelope-screen.opening .open-guide {
  opacity: 0;
}

/* حرکت نرم و باشکوه پاکت به سمت پایین */
.envelope-screen.slide-down {
  transform: translate(-50%, 105vh);
  opacity: 0.95;
}

.envelope-screen.opened {
  display: none !important;
}

/* راهنمای لمس برای باز شدن */
.open-guide {
  position: absolute;
  bottom: 7%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: #4a3622;
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.9);
  animation: guide-bounce 2s infinite ease-in-out;
  pointer-events: none;
}

.guide-hand {
  animation: bounce-hand 1.5s infinite ease-in-out;
}

.guide-text {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

@keyframes guide-bounce {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, -8px); }
}

@keyframes bounce-hand {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

/* ======================================================== */
/* بخش دوم: عکس‌های پس‌زمینه با افکت نرم سینمایی و فید هوشمند */
/* ======================================================== */
.fixed-couple-bg {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%) translateY(70px) scale(0.96);
  opacity: 0;
  width: 100%;
  max-width: 480px;
  height: 100vh;
  height: 100dvh;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  background-color: #08090c;
  transition: transform 1.05s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.85s ease;
}

body.card-revealed .fixed-couple-bg {
  transform: translateX(-50%) translateY(0) scale(1);
  opacity: 1;
}

/* اسلایدهای مجزا برای جابجایی نرم عکس‌ها با اسکرول متصل به دست */
.couple-bg-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transform: scale(1.04);
  will-change: opacity, transform;
  pointer-events: none;
}

.couple-bg-slide:first-child {
  opacity: 1;
  transform: scale(1);
}

.couple-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  filter: brightness(0.92) contrast(1.05);
}

.couple-img-2 {
  object-position: center 25%;
}

/* لایه سایه گرادینت ملایم فقط بالا و پایین، بدون پوشاندن چهره عروس و داماد */
.bg-vignette-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    180deg,
    rgba(6, 7, 9, 0.65) 0%,
    rgba(6, 7, 9, 0.15) 24%,
    rgba(6, 7, 9, 0.04) 50%,
    rgba(6, 7, 9, 0.25) 75%,
    rgba(6, 7, 9, 0.88) 100%
  );
  pointer-events: none;
}

/* ======================================================== */
/* بخش سوم: چیدمان شناور متن‌ها و بالا آمدن منظم کارت دعوت    */
/* ======================================================== */
.card-wrapper {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: transparent;
  transform: translateY(110px);
  opacity: 0;
  transition: transform 1.1s cubic-bezier(0.16, 1, 0.3, 1) 0.08s, opacity 0.9s ease 0.08s;
}

body.card-revealed .card-wrapper {
  transform: translateY(0);
  opacity: 1;
}

.card-content {
  padding: 30px 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  text-align: center;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.85), 0 0 22px rgba(0, 0, 0, 0.6);
}

/* سربرگ بالا: اسامی انگلیسی در چپ و ستون عمودی تاریخ در راست */
.hero-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  direction: ltr;
  padding: 0 14px;
  margin-top: 10px;
  width: 100%;
}

.names-en-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font-family: var(--font-en-cursive);
  font-size: 32px;
  font-weight: 700;
  font-style: italic;
  line-height: 1.05;
  color: #ffffff;
  letter-spacing: 0.5px;
}

.names-en-group .name-en-amp {
  font-size: 18px;
  opacity: 0.85;
  margin: 2px 0 2px 12px;
}

.date-stacked-group {
  display: flex;
  align-items: center;
  gap: 8px;
  direction: ltr;
  padding-right: 6px;
}

.date-stacked-digits {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: 'Estedad', sans-serif;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.1;
  color: #ffffff;
}

.date-stacked-digits .ds-dot {
  font-size: 16px;
  opacity: 0.65;
  line-height: 0.7;
}

.date-vertical-line {
  width: 1.5px;
  height: 95px;
  background: rgba(255, 255, 255, 0.75);
  border-radius: 2px;
}

/* سربرگ سالگرد ازدواج امین و رویا */
.anniversary-badge-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  direction: ltr;
  unicode-bidi: isolate;
  gap: 3px;
  font-family: 'Playfair Display', serif;
  font-size: 11px;
  letter-spacing: 3.5px;
  color: rgba(255, 255, 255, 0.9);
  text-transform: uppercase;
  margin-top: 14px;
}

.anniversary-badge-text .anniversary-line {
  line-height: 1.35;
  direction: ltr;
  unicode-bidi: isolate;
}

/* اسامی فارسی امین و رویا با فونت استعداد بولد و مدرن */
.names-fa-container {
  margin: 4px 0 2px;
}

.names-fa-title {
  font-family: 'Estedad', sans-serif;
  font-size: 44px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.3;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  letter-spacing: -0.5px;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.95), 0 0 25px rgba(223, 186, 115, 0.35);
}

.names-fa-title .heart-symbol {
  font-size: 22px;
  color: #f7d287;
  opacity: 0.95;
}

/* شعر عاشقانه با فونت استعداد */
.poem-wrapper {
  margin: 4px 0 8px;
}

.poem-line {
  font-family: 'Estedad', sans-serif;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.85;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
}

/* پیام صمیمی دعوت بالای کادر تاریخ */
.welcome-invitation-block {
  margin: 6px 14px 10px;
  padding: 8px 12px;
  background: rgba(22, 25, 32, 0.48);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.welcome-invitation-text {
  font-family: 'Estedad', sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.95);
  line-height: 1.75;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85);
}

/* تاریخ و ساعت مراسم با نماد قلب و فونت استعداد */
.event-schedule-block {
  margin: 6px 0;
}

.shamsi-date-hearts {
  font-family: 'Estedad', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.time-range-text {
  font-family: 'Estedad', sans-serif;
  font-size: 17px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
}

/* لوکیشن مراسم در کردان */
.venue-info-block {
  margin: 8px 0 6px;
}

.venue-location-title {
  font-family: 'Estedad', sans-serif;
  font-size: 21px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.95);
}

/* آیکون‌های رسمی مسیریابی برنامه‌ها (گوگل مپ، نشان، بلد، ویز) */
.map-nav-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin: 6px 0 10px;
}

.map-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  color: #ffffff;
  transition: transform 0.25s ease;
}

.map-badge:hover, .map-badge:active {
  transform: translateY(-4px) scale(1.06);
}

.map-icon-box {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(18, 20, 26, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

.map-badge-name {
  font-family: 'Estedad', sans-serif;
  font-size: 11px;
  font-weight: 500;
  opacity: 0.88;
}

/* روزشمار معکوس با کپسول‌های شیشه‌ای و فونت استعداد */
.countdown-capsules-grid {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 8px 0 14px;
  direction: rtl;
}

.cd-capsule {
  flex: 1;
  max-width: 78px;
  background: rgba(22, 25, 32, 0.58);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  padding: 12px 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.38);
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.25s ease;
}

.cd-capsule:hover {
  transform: translateY(-2px);
  border-color: rgba(223, 186, 115, 0.4);
}

.cd-value {
  font-family: 'Estedad', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1;
  letter-spacing: 0.5px;
}

.cd-label {
  font-family: 'Estedad', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.82);
  margin-top: 6px;
}

/* پیام مهرآمیز و یادآوری هماهنگی */
.courtesy-message-box {
  margin: 6px 0 16px;
  padding: 0 10px;
}

.courtesy-text-main {
  font-family: var(--font-calligraphy);
  font-size: 19px;
  line-height: 1.9;
  color: #ffffff;
  margin-bottom: 6px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.95);
}

.courtesy-text-closing {
  font-family: var(--font-calligraphy);
  font-size: 23px;
  color: #f7d287;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.95);
}

/* ======================================================== */
/* بخش چهارم: کشوی اعلام حضور مهمانان (RSVP Bottom Drawer)    */
/* ======================================================== */
.rsvp-bottom-drawer {
  background: rgba(16, 18, 24, 0.78);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 28px;
  padding: 16px 20px 24px;
  margin-top: 8px;
  text-align: right;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55);
  position: relative;
  transition: all 0.4s ease;
}

.drawer-toggle-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  margin: -32px auto 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  transition: all 0.3s ease;
}

.drawer-toggle-btn:hover {
  background: rgba(223, 186, 115, 0.3);
  transform: scale(1.08);
}

.drawer-arrow-icon {
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.rsvp-bottom-drawer.collapsed .drawer-arrow-icon {
  transform: rotate(180deg);
}

.drawer-header-content {
  cursor: pointer;
  padding-bottom: 8px;
}

.drawer-title {
  font-family: 'Estedad', sans-serif;
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  color: #ffffff;
}

.drawer-collapsible-body {
  overflow: hidden;
  transition: max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease;
  max-height: 800px;
  opacity: 1;
}

.rsvp-bottom-drawer.collapsed .drawer-collapsible-body {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}

.rsvp-form-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 10px;
}

.form-question {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  text-align: center;
  margin-bottom: 4px;
}

.attendance-pill-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 6px;
}

.attendance-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.attendance-pill:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(223, 186, 115, 0.4);
}

.attendance-pill input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  outline: none;
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
}

.attendance-pill input[type="radio"]:checked {
  border-color: var(--gold-primary);
  background-color: var(--gold-primary);
}

.pill-text {
  font-size: 14px;
  font-weight: 500;
  color: #ffffff;
}

.form-input-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.input-label {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
}

.glass-input, .glass-select, .glass-textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  padding: 12px 14px;
  color: #ffffff;
  font-family: 'Estedad', sans-serif;
  font-size: 14px;
  outline: none;
  transition: all 0.25s ease;
}

.glass-input:focus, .glass-select:focus, .glass-textarea:focus {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--gold-primary);
  box-shadow: 0 0 12px rgba(223, 186, 115, 0.25);
}

.glass-select option {
  background-color: #1a1c24;
  color: #ffffff;
}

.glass-textarea {
  resize: vertical;
  min-height: 55px;
}

.submit-action-btn {
  width: 100%;
  background: linear-gradient(135deg, #dfba73 0%, #b88f3e 100%);
  color: #0b0c0f;
  border: none;
  border-radius: 14px;
  padding: 14px;
  font-family: 'Estedad', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 6px;
  box-shadow: 0 4px 18px rgba(223, 186, 115, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.25s ease;
}

.submit-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(223, 186, 115, 0.5);
}

.submit-action-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(0, 0, 0, 0.25);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.hidden {
  display: none !important;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.form-feedback {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 500;
  text-align: center;
  line-height: 1.6;
  margin-top: 6px;
}

.form-feedback.success {
  background: rgba(39, 174, 96, 0.2);
  border: 1px solid rgba(39, 174, 96, 0.5);
  color: #2ecc71;
}

.form-feedback.error {
  background: rgba(231, 76, 60, 0.2);
  border: 1px solid rgba(231, 76, 60, 0.5);
  color: #e74c3c;
}

/* ======================================================== */
/* بهینه‌سازی و واکنش‌گرایی برای ابعاد مختلف نمایشگرها         */
/* ======================================================== */
@media (max-width: 360px) {
  .card-content {
    padding: 24px 14px 35px;
    gap: 16px;
  }
  .names-en-group {
    font-size: 28px;
  }
  .date-stacked-digits {
    font-size: 22px;
  }
  .names-fa-title {
    font-size: 42px;
  }
  .poem-line {
    font-size: 20px;
  }
  .cd-value {
    font-size: 24px;
  }
  .cd-capsule {
    padding: 10px 2px;
  }
}
