/* ==========================================================================
   Okan Akgül — işlevsel dinamizm katmanı
   dynamic.css · pro.css'den sonra yüklenir.
   Canlı durum · bölge sorgulama · proje filtresi · akıllı SSS · form yardımı
   ========================================================================== */

:root {
  --dyn-link: #c81e1e;
}

html[data-theme="dark"] {
  --dyn-link: #ff9a9a;
}

/* --------------------------------------------------------------------------
   Topbar canlı açık / kapalı durumu
   -------------------------------------------------------------------------- */

.topbar-status {
  gap: 6px;
  color: inherit;
  white-space: nowrap;
}

.topbar-status::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, .18);
}

.topbar-status[data-state="closed"]::before {
  background: #fca5a5;
  box-shadow: 0 0 0 3px rgba(252, 165, 165, .16);
}

/* --------------------------------------------------------------------------
   Hizmet bölgesi sorgulama
   -------------------------------------------------------------------------- */

.area-check {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  align-items: center;
  gap: clamp(20px, 3vw, 38px);
  margin-top: 28px;
  padding: clamp(22px, 3.2vw, 36px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--pro-surface);
  box-shadow: var(--shadow);
}

.area-check__kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--dyn-link);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.area-check__intro h2 {
  margin-bottom: 8px;
  font-size: clamp(1.25rem, 2.2vw, 1.75rem);
}

.area-check__intro p {
  margin: 0;
  color: var(--muted);
  font-size: .89rem;
}

.area-check__form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.area-check__form select {
  flex: 1 1 220px;
}

.area-check__form .btn {
  flex: 0 0 auto;
}

.area-check__result {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 52px;
  margin-top: 14px;
  padding: 11px 14px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: var(--pro-surface-2);
  font-size: .85rem;
  line-height: 1.5;
}

.area-check__result > i {
  color: var(--brand);
}

.area-check__result > span {
  flex: 1 1 220px;
}

.area-check__result.is-ready {
  border-style: solid;
  border-color: rgba(34, 197, 94, .38);
  color: var(--text);
  background: rgba(34, 197, 94, .08);
}

.area-check__result.is-ready > i {
  color: var(--success);
}

.area-check__result a {
  color: var(--dyn-link);
  font-weight: 700;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Proje kategorisi filtreleri
   -------------------------------------------------------------------------- */

.project-filter-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 26px 0 22px;
}

.filter-chip,
.faq-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--pro-surface);
  font-weight: 700;
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease, background .2s ease, transform .2s var(--ease-out);
}

.filter-chip {
  padding: 9px 15px;
  font-size: .82rem;
}

.faq-chip {
  padding: 7px 13px;
  font-size: .76rem;
}

.filter-chip:hover,
.faq-chip:hover {
  color: var(--dyn-link);
  border-color: var(--brand);
  transform: translateY(-1px);
}

.filter-chip.is-active,
.filter-chip.active,
.faq-chip.is-active {
  color: #1a0505;
  border-color: var(--brand);
  background: var(--brand);
  box-shadow: 0 12px 26px -14px var(--brand-glow);
}

.project-count {
  margin-left: auto;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Akıllı SSS: arama + kategori çipleri
   -------------------------------------------------------------------------- */

.faq-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
  max-width: 820px;
  margin: 0 auto 20px;
}

.faq-search {
  position: relative;
  flex: 1 1 270px;
}

.faq-search i {
  position: absolute;
  left: 15px;
  top: 50%;
  color: var(--brand);
  transform: translateY(-50%);
  pointer-events: none;
}

.faq-search input {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px 10px 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: var(--pro-surface);
  font-size: .88rem;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.faq-search input::placeholder {
  color: var(--muted);
  opacity: .85;
}

.faq-search input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}

.faq-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.faq-item.is-hidden {
  display: none;
}

.faq-item:not(.is-hidden) + .faq-item:not(.is-hidden) {
  margin-top: 10px;
}

.faq-empty {
  padding: 20px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: var(--pro-surface-2);
  font-size: .86rem;
  text-align: center;
}

.faq-empty[hidden] {
  display: none;
}

/* --------------------------------------------------------------------------
   İletişim kısayolları
   -------------------------------------------------------------------------- */

.copy-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.copy-strip button,
.copy-strip a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--text);
  background: var(--pro-surface);
  font-size: .78rem;
  font-weight: 700;
  transition: color .2s ease, border-color .2s ease, background .2s ease, transform .2s var(--ease-out);
}

.copy-strip button:hover,
.copy-strip a:hover {
  color: var(--dyn-link);
  border-color: var(--brand);
  background: var(--brand-soft);
  transform: translateY(-1px);
}

.copy-strip i {
  color: var(--brand);
}

/* --------------------------------------------------------------------------
   Teklif formu: hizmete göre değişen alanlar ve fiyat tahmini
   -------------------------------------------------------------------------- */

.dynamic-fields__head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  color: var(--muted);
  background: var(--pro-surface-2);
  font-size: .78rem;
  font-weight: 600;
}

.dynamic-fields__head i {
  color: var(--brand);
}

.dynamic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 0 0 12px 12px;
  background: var(--pro-surface);
}

.dynamic-hint {
  margin: 0;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: var(--pro-surface-2);
  font-size: .8rem;
}

.estimate {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 12px;
  padding: 13px 15px;
  border: 1px solid rgba(34, 197, 94, .3);
  border-radius: 12px;
  color: var(--text);
  background: rgba(34, 197, 94, .08);
}

.estimate[hidden] {
  display: none;
}

.estimate > i {
  color: var(--success);
  font-size: 1.05rem;
  margin-top: 2px;
}

.estimate span {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.estimate small {
  color: var(--muted);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.estimate strong {
  font-family: var(--font-head);
  font-size: 1rem;
}

.estimate em {
  color: var(--muted);
  font-size: .72rem;
  font-style: normal;
}

/* --------------------------------------------------------------------------
   Global toast
   -------------------------------------------------------------------------- */

.dyn-toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 1600;
  max-width: min(92vw, 430px);
  padding: 12px 18px;
  border: 1px solid rgba(34, 197, 94, .4);
  border-radius: 12px;
  color: #fff;
  background: #103521;
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, .85);
  font-size: .84rem;
  font-weight: 600;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 14px);
  transition: opacity .2s ease, transform .2s var(--ease-out);
  pointer-events: none;
}

.dyn-toast[hidden] {
  display: none;
}

.dyn-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.dyn-toast.is-error {
  border-color: rgba(255, 96, 96, .5);
  background: #3a1116;
}

html[data-theme="dark"] .dyn-toast {
  border-color: rgba(74, 222, 128, .4);
}

/* --------------------------------------------------------------------------
   Uyum
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .area-check {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .area-check__form select,
  .area-check__form .btn {
    width: 100%;
    flex-basis: 100%;
  }

  .project-count {
    margin-left: 0;
    flex-basis: 100%;
  }

  .faq-tools {
    align-items: stretch;
  }

  .faq-search {
    flex-basis: 100%;
  }

  .dynamic-grid {
    grid-template-columns: 1fr;
  }

  .copy-strip button,
  .copy-strip a {
    flex: 1 1 100%;
    justify-content: center;
  }
}

@media print {
  .area-check,
  .project-filter-bar,
  .faq-tools,
  .copy-strip,
  .dyn-toast {
    display: none !important;
  }
}
