/* =====================================================================
   SITE RESEPSIYONU v3 — Asistan Widget (NOT Modal)
   Mimari:
     1. .reception-trigger  → kapaliyken gorunur, 56x56 yuvarlak buton (sag alt)
     2. .reception-card     → acikken gorunur, header/body/footer flex layout
   v3 degisiklikleri:
     - WhatsApp butonu SOLA alindi (app.css'te .floating-action override)
     - Trigger artik bottom:20 (sag alt), back-to-top'in yerine yakin
     - Card bottom:88 (trigger'in ustunde), header/body/footer flex
     - Header sticky kaliyor, body scroll, footer sticky
     - max-height dvh kullaniyor (mobil safari adres cubugu icin)
     - Tablet 768-1023 kart genisligi 380, max-height duzgun
   KESIN KURAL: NO backdrop, NO overlay, NO body-level effects
   ===================================================================== */

/* Guvenlik agi: popup-overlay[hidden] tum tarayicilarda gercekten gizli kalsin
   (app.css'teki .popup-overlay { display:grid } UA hidden:none kuralini ezmesin) */
.popup-overlay[hidden],
.popup-root[aria-hidden="true"] .popup-overlay[hidden] {
  display: none !important;
}

/* =========================================================
   TRIGGER — yuvarlak buton (kapaliyken)
   v4 (2026-05-01): SOL ALTA alindi (WhatsApp floating tamamen kaldirildi,
   back-to-top sag-altta kalmaya devam — yatay cakisma 0)
   ========================================================= */
.reception-trigger {
  position: fixed;
  left: 20px;
  right: auto;
  bottom: 20px;
  /* Tablet Fix (2026-05-01): site-header z-index 100, reception 96 idi.
     Card acildiginda ust kismi header'in altinda kaliyordu.
     Yukseltildi: trigger 9997, card 9998 (popup-overlay 9999'un altinda). */
  z-index: 9997;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: var(--gradient-primary, linear-gradient(135deg, #3b82f6, #8b5cf6));
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(59, 130, 246, 0.35),
              0 0 0 1px rgba(255, 255, 255, 0.08);
  transition: transform 200ms ease, box-shadow 200ms ease, opacity 200ms ease;
  pointer-events: auto;
}

.reception-trigger:hover,
.reception-trigger:focus-visible {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 16px 36px rgba(59, 130, 246, 0.45),
              0 0 0 1px rgba(255, 255, 255, 0.18);
  outline: none;
}

.reception-trigger.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.85);
}

.reception-trigger-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #6b7280;
  border: 2px solid #11111a;
}

.reception-trigger.is-online .reception-trigger-dot {
  background: #22c55e;
  border-color: #ffffff;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.85);
  animation: reception-trigger-pulse 1.6s ease-out infinite;
  will-change: box-shadow, transform;
}

@keyframes reception-trigger-pulse {
  0%   {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.85);
    transform: scale(1);
  }
  60%  {
    box-shadow: 0 0 0 12px rgba(34, 197, 94, 0);
    transform: scale(1.15);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    transform: scale(1);
  }
}

/* =========================================================
   CARD — acik halde gorunen kart
   v3: header/body/footer flex yapisi
   bottom: 88px (trigger 56px + 12px bosluk + 20px margin = 88)
   max-height: dvh (mobil safari icin), vh fallback
   ========================================================= */
.reception-card {
  position: fixed;
  left: 20px;
  right: auto;
  bottom: 88px;
  /* Tablet Fix (2026-05-01): site-header z-index 100 ezdigi icin
     card ust kismi header'in altinda kaliyordu. 9998'e yukseltildi
     (popup-overlay 9999 her zaman ustte kalir). */
  z-index: 9998;
  width: 380px;
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 120px);
  max-height: calc(100dvh - 120px);
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #11111a 0%, rgba(17, 17, 26, 0.98) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45),
              0 0 0 1px rgba(59, 130, 246, 0.08);
  color: rgba(255, 255, 255, 0.87);
  font-family: var(--font-body, "Plus Jakarta Sans", system-ui, sans-serif);
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  transition: opacity 240ms ease, transform 240ms cubic-bezier(0.2, 0.9, 0.3, 1);
  pointer-events: auto;
  overflow: hidden;
}

.reception-card[hidden] {
  display: none !important;
}

.reception-card.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* =========================================================
   HEAD — sticky top, her zaman gorunur
   ========================================================= */
.reception-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(180deg, rgba(17, 17, 26, 1) 0%, rgba(17, 17, 26, 0.95) 100%);
  flex-shrink: 0;
  flex-grow: 0;
}

.reception-card-avatar {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--gradient-primary, linear-gradient(135deg, #3b82f6, #8b5cf6));
  display: grid;
  place-items: center;
  color: #ffffff;
}

.reception-card-titles {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.reception-card-title {
  font-family: var(--font-display, "Space Grotesk", system-ui, sans-serif);
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.reception-card-status {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 2px;
}

.reception-card.is-online .reception-card-status {
  color: #22c55e;
}

.reception-card-close {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.reception-card-close:hover,
.reception-card-close:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  transform: rotate(90deg);
  outline: none;
}

/* =========================================================
   BODY — scroll alani, flex:1 ile dinamik yuksellik
   ========================================================= */
.reception-card-body {
  padding: 14px 16px 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
  min-height: 0; /* flex item scroll icin kritik */
}

.reception-card-greeting {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  margin: 0 0 4px;
  line-height: 1.4;
}

.reception-card-subtext {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
  margin: 0 0 14px;
  line-height: 1.5;
}

/* =========================================================
   SECTIONS
   ========================================================= */
.reception-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.reception-section:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.reception-section-title {
  font-family: var(--font-display, "Space Grotesk", system-ui, sans-serif);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.45);
  margin: 0 0 8px;
}

/* Hizmet listesi */
.reception-services,
.reception-posts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.reception-service-link,
.reception-post-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.reception-service-link:hover,
.reception-service-link:focus-visible,
.reception-post-link:hover,
.reception-post-link:focus-visible {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  transform: translateX(2px);
  outline: none;
}

.reception-service-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
}

.reception-service-label,
.reception-post-title {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reception-post-title {
  font-weight: 500;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
  font-size: 12.5px;
}

.reception-service-arrow,
.reception-post-arrow {
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.35);
  display: grid;
  place-items: center;
}

/* CTA bolumu — v3: artik footer rolunde, sticky bottom etkisi
   (body icinde son section oldugu icin scroll edilebilir kalir,
    ancak gorsel olarak ayrik durur) */
.reception-section--cta {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reception-cta {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.92);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
  width: 100%;
  text-align: left;
}

.reception-cta:hover,
.reception-cta:focus-visible {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateX(2px);
  outline: none;
}

.reception-cta--whatsapp:hover,
.reception-cta--whatsapp:focus-visible { border-color: rgba(34, 197, 94, 0.4); }

.reception-cta--quote:hover,
.reception-cta--quote:focus-visible { border-color: rgba(59, 130, 246, 0.4); }

.reception-cta--phone:hover,
.reception-cta--phone:focus-visible { border-color: rgba(6, 182, 212, 0.4); }

.reception-cta svg { flex-shrink: 0; }

/* =========================================================
   RESPONSIVE — 3 BREAKPOINT
   ========================================================= */

/* MOBILE: <=767 — alt serit (12px margin), trigger SOL-ALT */
@media (max-width: 767px) {
  .reception-trigger {
    left: 16px;
    right: auto;
    bottom: 16px;
    width: 52px;
    height: 52px;
  }

  .reception-card {
    /* Alt seritleme: mobilde alttan acilir, genis kart */
    left: 12px;
    right: 12px;
    bottom: 80px; /* trigger 52 + 12 bosluk + 16 margin = 80 */
    width: auto;
    max-width: none;
    max-height: calc(100vh - 100px);
    max-height: calc(100dvh - 100px);
    border-radius: 18px;
  }

  .reception-card-head {
    padding: 14px 14px 12px;
  }

  .reception-card-body {
    padding: 12px 14px 14px;
  }

  .reception-card-title { font-size: 14px; }
  .reception-section-title { font-size: 10px; }
  .reception-service-link,
  .reception-post-link { padding: 9px 10px; }
}

/* TABLET: 768-1023 — SOL tarafta orta boyut kart, sag tarafta back-to-top'a yer */
@media (min-width: 768px) and (max-width: 1023px) {
  .reception-trigger {
    left: 20px;
    right: auto;
    bottom: 20px;
    width: 56px;
    height: 56px;
  }

  .reception-card {
    left: 20px;
    right: auto;
    bottom: 88px;
    width: 380px;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 120px);
    max-height: calc(100dvh - 120px);
  }
}

/* DESKTOP: >=1024 — SOL tarafta tam kart, sag tarafta back-to-top */
@media (min-width: 1024px) {
  .reception-trigger {
    left: 24px;
    right: auto;
    bottom: 24px;
    width: 56px;
    height: 56px;
  }

  .reception-card {
    left: 24px;
    right: auto;
    bottom: 92px;
    width: 380px;
    max-height: calc(100vh - 140px);
    max-height: calc(100dvh - 140px);
  }
}

/* =========================================================
   ERISIM — Reduced motion
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  .reception-trigger,
  .reception-card,
  .reception-card-close,
  .reception-cta,
  .reception-service-link,
  .reception-post-link {
    transition: opacity 120ms ease;
  }
  .reception-card.is-open {
    transform: none;
  }
  .reception-trigger.is-online .reception-trigger-dot {
    /* Reduced-motion: tamamen kapatma — yavaslat (cevrimici sinyali kalmali) */
    animation-duration: 4s;
  }
  .reception-card-close:hover {
    transform: none;
  }
  .reception-cta:hover,
  .reception-service-link:hover,
  .reception-post-link:hover {
    transform: none;
  }
}
