/* ============================================================
   CALL US — GUESTS
   guests.css
   ============================================================ */

/* ============================================================
   01 — SECTION
   ============================================================ */
.guests {
  position: relative;
  background: #F5F0E8;
  color: #0A0A0A;
  padding: clamp(6rem, 12vh, 10rem) var(--pad);
  overflow: hidden;
  z-index: 2;
}

.guests__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: clamp(2.5rem, 5vh, 4rem);
}

/* ============================================================
   02 — HEAD
   ============================================================ */
.guests__head {
  max-width: 55rem;
}

.guests__title {
  font-family: 'General Sans', sans-serif;
  font-size: var(--t-section);
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-weight: 500;
  color: #0A0A0A;
  margin-top: 0.5rem;
}

.guests__title-line { display: block; }

.guests__title-line--italic {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-style: italic;
  letter-spacing: -0.01em;
  color: #2D5A3D;
  padding-left: 0.05em;
}

/* ============================================================
   03 — MAP WRAP
   ============================================================ */
.guests__map-wrap {
  position: relative;
  width: 100%;
  max-width: 1300px;
  margin: 0 auto;
  aspect-ratio: 2 / 1;
}

.guests__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

/* ============================================================
   04 — COUNTRIES (SVG از D3)
   ============================================================ */
.guests__country {
  fill: rgba(212, 180, 140, 0.08);
  stroke: rgba(212, 180, 140, 0.45);
  stroke-width: 0.5;
  transition: fill 0.3s ease;
  opacity: 0;
  animation: countryFade 1.5s ease forwards;
}

@keyframes countryFade {
  to { opacity: 1; }
}

/* ============================================================
   05 — ROUTES (خطوط اتصال)
   ============================================================ */
.guests__route {
  fill: none;
  stroke: rgba(212, 180, 140, 0.55);
  stroke-width: 0.7;
  stroke-linecap: round;
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
  animation: drawRoute 2.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes drawRoute {
  to { stroke-dashoffset: 0; }
}

/* ============================================================
   06 — DOTS (نقاط شهرها)
   ⚡ انیمیشن با D3 انجام می‌شه، نه CSS
   ============================================================ */
.guests__dot-group {
  cursor: pointer;
}

/* نقطه‌ی مرکزی */
.guests__dot-core {
  fill: #D4B48C;
  stroke: #F5F0E8;
  stroke-width: 0.8;
  transition: fill 0.3s ease;
}

.guests__dot-group:hover .guests__dot-core {
  fill: #B8976E;
}

/* Seoul — زمردی */
.guests__dot-group--primary .guests__dot-core {
  fill: #2D5A3D;
  stroke: #F5F0E8;
}

.guests__dot-group--primary:hover .guests__dot-core {
  fill: #3D7A52;
}

/* حلقه‌های pulse */
.guests__dot-pulse {
  fill: none;
  stroke: rgba(212, 180, 140, 0.55);
  stroke-width: 1;
  transform-origin: center;
  transform-box: fill-box;
  animation: dotPulse 3s ease-out infinite;
}

.guests__dot-group--primary .guests__dot-pulse {
  stroke: rgba(45, 90, 61, 0.6);
}

.guests__dot-pulse--2 {
  animation-delay: 1.5s;
}

@keyframes dotPulse {
  0% {
    transform: scale(0.7);
    opacity: 0.9;
  }
  100% {
    transform: scale(3.5);
    opacity: 0;
  }
}

/* ============================================================
   07 — TOOLTIP
   ============================================================ */
.guests__tooltip {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10;
  padding: 0.6rem 0.9rem;
  background: rgba(10, 10, 10, 0.95);
  border: 1px solid rgba(212, 180, 140, 0.4);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -120%) translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  white-space: nowrap;
}

.guests__tooltip.is-visible {
  opacity: 1;
  transform: translate(-50%, -120%) translateY(0);
}

.guests__tooltip-city {
  display: block;
  font-family: 'General Sans', sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #D4B48C;
  margin-bottom: 0.2rem;
}

.guests__tooltip-count {
  display: block;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 0.85rem;
  color: #F5F0E8;
}

/* ============================================================
   08 — STATS
   ============================================================ */
.guests__stats {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: clamp(1rem, 3vw, 2rem);
  flex-wrap: wrap;
  margin-top: 1rem;
}

.guests__stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.guests__stat-num {
  font-family: 'General Sans', sans-serif;
  font-size: clamp(2.25rem, 4.5vw, 3.75rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
  color: #0A0A0A;
  font-variant-numeric: tabular-nums;
  transition: color 0.5s ease;
}

.guests__stat.is-counting .guests__stat-num {
  color: #2D5A3D;
}

.guests__stat-label {
  font-family: 'General Sans', sans-serif;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #6B6B6B;
}

.guests__stat-sep {
  font-size: 1.75rem;
  color: #D4B48C;
  opacity: 0.5;
  line-height: 1;
  margin-top: -0.5rem;
}

/* ============================================================
   09 — FOOTER TEXT
   ============================================================ */
.guests__footer {
  text-align: center;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.1rem, 1.6vw, 1.5rem);
  color: #3D3D3D;
  letter-spacing: -0.005em;
}

/* ============================================================
   10 — RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .guests {
    padding: 5rem var(--pad) 4rem;
  }

  .guests__map-wrap {
    aspect-ratio: 3 / 2;
  }

  .guests__stat-num {
    font-size: clamp(1.75rem, 7vw, 2.5rem);
  }

  .guests__stat-sep {
    display: none;
  }

  .guests__stats {
    gap: 2rem;
  }
}

@media (max-width: 500px) {
  .guests__map-wrap {
    aspect-ratio: 4 / 3;
  }

  .guests__tooltip {
    padding: 0.45rem 0.7rem;
  }

  .guests__tooltip-city {
    font-size: 0.62rem;
  }

  .guests__tooltip-count {
    font-size: 0.75rem;
  }
}

/* ============================================================
   11 — REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .guests__country,
  .guests__route,
  .guests__dot-pulse {
    animation: none !important;
    opacity: 1;
    stroke-dashoffset: 0;
    transform: none;
  }
}