/* Local WOFF2 Fonts for fast offline and self-contained loading */
@font-face {
  font-family: 'Vazirmatn';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/vazirmatn-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+FB50-FDFF, U+FE70-FEFC;
}

@font-face {
  font-family: 'Vazirmatn';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/vazirmatn-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 600 900;
  font-display: swap;
  src: url('fonts/plus-jakarta-sans.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Base tokens and styling */
:root {
  --bg-dark: #0a040d;
  --bg-card: rgba(26, 12, 28, 0.72);
  --bg-card-hover: rgba(38, 16, 42, 0.85);
  
  --border-glam: rgba(255, 42, 133, 0.35);
  --border-sparkle: rgba(255, 209, 102, 0.4);
  
  --glam-pink: #ff2a85;
  --glam-pink-glow: rgba(255, 42, 133, 0.5);
  --dreamy-purple: #9d4edd;
  --dreamy-purple-glow: rgba(157, 78, 237, 0.45);
  --shimmer-gold: #ffd166;
  --shimmer-gold-glow: rgba(255, 209, 102, 0.45);
  
  --text-main: #ffffff;
  --text-muted: #dccfe2;
  --text-dim: #998a9f;
  
  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --radius-full: 9999px;
  
  --font-persian: 'Vazirmatn', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-en: 'Plus Jakarta Sans', sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.party-body {
  font-family: var(--font-persian);
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  padding-bottom: 50px;
  -webkit-font-smoothing: antialiased;
}

/* Ambient glow lights */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(110px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
  transition: transform 0.1s ease, opacity 0.1s ease;
}

body.music-playing .ambient-glow {
  animation: ambient-beat-pulse 0.468s infinite ease-out;
}

@keyframes ambient-beat-pulse {
  0% { opacity: 0.45; transform: scale(0.95); }
  14% { opacity: 0.95; transform: scale(1.25); filter: blur(90px); }
  35% { opacity: 0.5; transform: scale(1); }
  100% { opacity: 0.45; transform: scale(0.95); }
}

.glow-pink {
  top: -40px;
  right: -50px;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(255, 42, 133, 0.38) 0%, transparent 70%);
}

.glow-purple {
  bottom: 25%;
  left: -90px;
  width: 330px;
  height: 330px;
  background: radial-gradient(circle, rgba(157, 78, 237, 0.32) 0%, transparent 70%);
}

.glow-gold {
  top: 48%;
  right: -80px;
  width: 290px;
  height: 290px;
  background: radial-gradient(circle, rgba(255, 209, 102, 0.22) 0%, transparent 70%);
}

/* Floating sparkles */
.sparkles-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.star-sparkle {
  position: absolute;
  color: var(--shimmer-gold);
  font-size: 14px;
  animation: float-twinkle 4s infinite ease-in-out;
  opacity: 0.7;
}

@keyframes float-twinkle {
  0%, 100% { opacity: 0.2; transform: scale(0.7) translateY(0); }
  50% { opacity: 1; transform: scale(1.3) translateY(-10px); text-shadow: 0 0 10px #ffd166; }
}

/* Mobile-constrained page layout */
.page-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

body.music-playing .page-wrapper {
  animation: page-bass-shake 0.468s infinite ease-out;
}

@keyframes page-bass-shake {
  0% { transform: scale(1); }
  12% { transform: scale(1.018) translateY(-2px); }
  25% { transform: scale(1); }
}

/* Floating Music Player Bar */
.music-player-bar {
  display: flex;
  justify-content: center;
  position: sticky;
  top: 12px;
  z-index: 100;
}

.music-toggle-btn {
  background: linear-gradient(135deg, rgba(255, 42, 133, 0.92), rgba(157, 78, 237, 0.92));
  border: 1px solid rgba(255, 209, 102, 0.6);
  color: #fff;
  border-radius: var(--radius-full);
  padding: 10px 22px;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 0 22px rgba(255, 42, 133, 0.6), 0 4px 15px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(14px);
  transition: all 0.25s ease;
}

.music-toggle-btn.playing {
  background: linear-gradient(135deg, #ff2a85, #ffd166);
  color: #240016;
  box-shadow: 0 0 30px rgba(255, 209, 102, 0.9);
  animation: pulse-music 1.2s infinite alternate;
}

@keyframes pulse-music {
  from { transform: scale(1); }
  to { transform: scale(1.03); }
}

/* Hero Section */
.hero-section {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-glam);
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.8), 0 0 30px var(--glam-pink-glow);
  background: #000;
  transition: transform 0.1s ease;
}

body.music-playing .hero-section {
  animation: hero-bass-kick 0.468s infinite ease-out;
}

@keyframes hero-bass-kick {
  0% { 
    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.8), 0 0 25px var(--glam-pink-glow);
    border-color: var(--border-glam);
  }
  14% { 
    box-shadow: 0 22px 65px rgba(0, 0, 0, 0.95), 0 0 55px rgba(255, 42, 133, 0.95), 0 0 35px rgba(255, 209, 102, 0.8);
    border-color: #ffd166;
  }
  35% { 
    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.8), 0 0 25px var(--glam-pink-glow);
    border-color: var(--border-glam);
  }
}

.hero-image-container {
  position: relative;
  width: 100%;
  height: 350px;
  overflow: hidden;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
  transform: scale(1.04);
}

body.music-playing .hero-img {
  animation: hero-img-pulse 0.468s infinite ease-out;
}

@keyframes hero-img-pulse {
  0% { transform: scale(1.04); filter: brightness(1) contrast(1); }
  14% { transform: scale(1.085); filter: brightness(1.3) contrast(1.15); }
  35% { transform: scale(1.04); filter: brightness(1) contrast(1); }
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg, 
    rgba(10, 4, 13, 0.15) 0%, 
    rgba(10, 4, 13, 0.5) 50%, 
    rgba(10, 4, 13, 0.98) 100%
  );
}

/* Strobe Light Effects synced with music */
.strobe-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: screen;
  transition: opacity 0.08s ease;
}

body.music-playing .strobe-overlay {
  animation: strobe-light-flash 0.468s infinite ease-out;
}

@keyframes strobe-light-flash {
  0% { 
    opacity: 0; 
  }
  12% { 
    opacity: 0.88; 
    background: radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.65) 0%, rgba(255, 42, 133, 0.75) 45%, rgba(255, 209, 102, 0.5) 75%, transparent 100%);
  }
  30% { 
    opacity: 0.18; 
  }
  100% { 
    opacity: 0; 
  }
}

/* Extra punch when heavy bass spike is detected */
body.kick-spike .hero-section {
  transform: scale(1.02);
  filter: brightness(1.25);
}

body.kick-spike .strobe-overlay {
  opacity: 0.95 !important;
}

.hero-content {
  position: relative;
  padding: 22px 20px 24px;
  margin-top: -85px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.badge-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 800;
  backdrop-filter: blur(10px);
}

.pill-alert {
  background: rgba(255, 42, 133, 0.2);
  border: 1px solid var(--glam-pink);
  color: #ff94c2;
  box-shadow: 0 0 14px rgba(255, 42, 133, 0.4);
}

.pill-glam {
  font-family: var(--font-en);
  letter-spacing: 1px;
  color: var(--shimmer-gold);
  border: 1px solid rgba(255, 209, 102, 0.45);
  background: rgba(255, 209, 102, 0.12);
}

.party-title {
  font-size: 2.2rem;
  font-weight: 900;
  line-height: 1.2;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
}

.party-title-en {
  font-family: var(--font-en);
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: 1.5px;
  background: linear-gradient(90deg, #ff2a85, #ffd166, #ff94c2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtext {
  font-size: 0.95rem;
  font-weight: 500;
  color: #e5dae9;
  line-height: 1.6;
}

.host-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 209, 102, 0.12);
  border: 1px solid rgba(255, 209, 102, 0.4);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  width: fit-content;
  color: #fff3c4;
}

/* Glassmorphic Section Cards */
.section-card {
  background: var(--bg-card);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-glam);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  position: relative;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.45);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 14px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Fixed single-line mobile header */
.card-header-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.card-subtitle-bold {
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  margin: 0;
}

.live-tag {
  background: linear-gradient(135deg, #ff2a85, #9d4edd);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(255, 42, 133, 0.7);
  letter-spacing: 0.5px;
}

.card-subtitle-small {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.card-icon-badge {
  position: absolute;
  top: 18px;
  left: 20px;
  font-size: 1.3rem;
}

/* Countdown Grid (LTR for Day on far left) */
.countdown-card {
  background: linear-gradient(135deg, rgba(38, 14, 40, 0.85), rgba(16, 7, 20, 0.85));
  border-color: rgba(255, 209, 102, 0.4);
}

.countdown-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  direction: ltr !important;
}

.countdown-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  min-width: 65px;
}

.countdown-val {
  font-family: var(--font-en);
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--shimmer-gold);
  text-shadow: 0 0 12px var(--shimmer-gold-glow);
  line-height: 1.1;
}

.countdown-lbl {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 4px;
  direction: rtl;
}

.countdown-sep {
  font-family: var(--font-en);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--glam-pink);
  margin-bottom: 18px;
}

/* Invitation Story */
.invitation-text-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.body-text {
  font-size: 0.96rem;
  color: #efe8f2;
  line-height: 1.85;
}

/* Highlights Grid */
.highlights-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.info-card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  border-radius: var(--radius-md);
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.info-icon {
  font-size: 1.5rem;
}

.info-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.info-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.info-value {
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
}

.info-hint {
  font-size: 0.76rem;
  color: #ff94c2;
}

/* Location Card */
.location-address {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
  line-height: 1.6;
}

.location-note {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.map-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.map-preview-box {
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 20px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  border: none;
  outline: none;
  transition: all 0.25s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--glam-pink) 0%, #c4005d 100%);
  color: #fff;
  box-shadow: 0 4px 20px var(--glam-pink-glow);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-calendar {
  flex: 1;
  background: rgba(255, 209, 102, 0.12);
  color: var(--shimmer-gold);
  border: 1px solid rgba(255, 209, 102, 0.4);
}

.btn-share {
  flex: 1;
  background: rgba(157, 78, 237, 0.16);
  color: #e5b3ff;
  border: 1px solid rgba(157, 78, 237, 0.45);
}

.btn-glow-submit {
  width: 100%;
  padding: 15px;
  font-size: 1.05rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #ff2a85 0%, #ff6b9d 50%, #ffd166 100%);
  color: #fff;
  box-shadow: 0 4px 25px rgba(255, 42, 133, 0.55);
  font-weight: 900;
  position: relative;
}

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

.btn-sm {
  padding: 8px 18px;
  font-size: 0.85rem;
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.8s ease-in-out infinite;
}

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

/* RSVP Form */
.rsvp-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.form-group label {
  font-size: 0.88rem;
  font-weight: 700;
  color: #ebdfee;
}

.form-group input[type="text"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 13px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(14, 6, 17, 0.78);
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s ease;
}

.form-group input[type="text"]:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--glam-pink);
  box-shadow: 0 0 0 3px rgba(255, 42, 133, 0.25);
}

/* Attendance Percentage Slider */
.slider-group {
  margin-top: 4px;
  background: rgba(20, 8, 22, 0.65);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.slider-badge {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--shimmer-gold);
  background: rgba(255, 209, 102, 0.14);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 209, 102, 0.35);
}

.slider-wrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.custom-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 10px;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, #ff2a85 0%, #9d4edd 50%, #ffd166 100%);
  outline: none;
  cursor: pointer;
}

/* Slider Thumb Styling */
.custom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid var(--glam-pink);
  box-shadow: 0 0 15px rgba(255, 42, 133, 0.8);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.custom-slider::-webkit-slider-thumb:hover,
.custom-slider::-webkit-slider-thumb:active {
  transform: scale(1.15);
}

.custom-slider::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid var(--glam-pink);
  box-shadow: 0 0 15px rgba(255, 42, 133, 0.8);
  cursor: pointer;
}

.slider-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-dim);
  font-weight: 600;
  padding: 0 4px;
}

.tick-step {
  cursor: pointer;
  transition: color 0.2s ease, font-weight 0.2s ease;
}

.tick-step.active {
  color: #fff;
  font-weight: 800;
}

/* Glam Ticket */
.glam-ticket {
  width: 100%;
  border: 2px dashed rgba(255, 209, 102, 0.75);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(255, 42, 133, 0.2), rgba(255, 209, 102, 0.12));
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 0 25px rgba(255, 42, 133, 0.3);
}

.ticket-header {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-en);
  font-size: 0.76rem;
  font-weight: 900;
  color: var(--shimmer-gold);
  letter-spacing: 1px;
}

.ticket-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 10px;
}

.ticket-name {
  font-size: 1.25rem;
  font-weight: 900;
  color: #fff;
}

.ticket-status {
  font-size: 0.88rem;
  color: var(--shimmer-gold);
  font-weight: 800;
}

.ticket-footer {
  border-top: 1px dashed rgba(255, 255, 255, 0.15);
  padding-top: 8px;
  font-size: 0.78rem;
  color: #ff94c2;
  font-weight: 600;
}

.rsvp-success-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
}

.success-icon {
  font-size: 3.5rem;
}

/* Actions & Footer */
.share-actions {
  display: flex;
  gap: 10px;
}

.footer {
  text-align: center;
  padding: 16px 0;
  color: var(--text-dim);
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  gap: 4px;
  letter-spacing: 0.5px;
}

.footer-note {
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.35);
  font-weight: 400;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(28, 10, 30, 0.96);
  border: 1px solid var(--shimmer-gold);
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.8), 0 0 20px var(--shimmer-gold-glow);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-size: 0.92rem;
  font-weight: 800;
  z-index: 9999;
  pointer-events: none;
}

.hidden {
  display: none !important;
}

@media (max-width: 380px) {
  .highlights-grid {
    grid-template-columns: 1fr;
  }
  .share-actions {
    flex-direction: column;
  }
  .card-header-flex {
    flex-direction: row;
  }
}
