/* ISODraft — Yardımcı Bot
 *
 * Tüm seçiciler .yd- ön ekiyle kapsanmıştır; site stilleriyle çakışmaz.
 * Renkler style.css'teki marka değişkenlerinden alınır, tek başına da
 * çalışsın diye her birinin yedeği vardır.
 */

.yd {
  --yd-murekkep: var(--navy, #0B1D3A);
  --yd-murekkep-acik: var(--navy-light, #122B54);
  --yd-kagit: var(--gray-50, #F8F9FA);
  --yd-kagit-koyu: var(--gray-100, #E9ECEF);
  --yd-cizgi: var(--gray-200, #DEE2E6);
  --yd-celik: var(--gray-600, #6C757D);
  --yd-mavi: var(--accent, #2E86DE);
  --yd-mavi-koyu: var(--accent-hover, #1B6EC2);
  --yd-mavi-acik: #EAF3FC;
  --yd-onay: #1F7A5C;
  --yd-onay-koyu: #186349;
  --yd-uyari: #B4741A;
  --yd-uyari-kagit: #FDF7EC;
  --yd-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;

  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--yd-murekkep);
  line-height: 1.55;
}

.yd *,
.yd *::before,
.yd *::after { box-sizing: border-box; }

/* Mikro etiketler — prototipin teknik doküman dili */
.yd-etiket {
  font-family: var(--yd-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--yd-celik);
}

/* ═══════════ Yüzen balon (tüm sayfalar) ═══════════ */

.yd--balon {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9998;
}

.yd-fab {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 20px;
  border: none;
  border-radius: 999px;
  background: var(--yd-murekkep);
  color: #fff;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 30px rgba(11, 29, 58, 0.28);
  transition: background 0.2s ease, transform 0.2s ease;
}
.yd-fab:hover { background: var(--yd-mavi); transform: translateY(-1px); }
.yd-fab:focus-visible { outline: 3px solid var(--yd-mavi); outline-offset: 3px; }
.yd-fab svg { flex: none; }
.yd--acik .yd-fab { display: none; }

/* Panel */
.yd-panel {
  display: none;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--yd-cizgi);
  box-shadow: 0 18px 50px rgba(11, 29, 58, 0.22);
}
.yd--acik .yd-panel { display: flex; }

.yd--balon .yd-panel {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 420px;
  height: min(620px, calc(100vh - 40px));
  border-radius: 10px;
  animation: yd-belir 0.22s ease-out;
}

/* Başlık çubuğu */
.yd-bar {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: 13px 14px 13px 17px;
  background: var(--yd-murekkep);
  color: #fff;
  flex: none;
}
.yd-bar__ad { font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; }
.yd-bar__alt {
  font-family: var(--yd-mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.62);
  margin-top: 2px;
}
.yd-bar__dugme {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 5px;
  background: transparent;
  color: #fff;
  font-family: var(--yd-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 0.15s ease;
}
.yd-bar__dugme:hover { background: rgba(255, 255, 255, 0.13); }
.yd-bar__dugme:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.yd-bar__dugme[hidden] { display: none; }
.yd-bar__sayi {
  display: inline-grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--yd-mavi);
  font-size: 9.5px;
  font-weight: 700;
}
.yd-bar__kapat {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: #fff;
  cursor: pointer;
}
.yd-bar__kapat:hover { background: rgba(255, 255, 255, 0.14); }
.yd-bar__kapat:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* Gövde */
.yd-govde {
  position: relative;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
}

/* ═══════════ Sohbet ═══════════ */

.yd-sohbet {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #fff;
}

.yd-akis {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.yd-balon { max-width: 88%; font-size: 14.5px; }
.yd-balon__rol { margin-bottom: 5px; }
.yd-balon__govde {
  padding: 11px 14px;
  border-radius: 8px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.yd-balon--bot .yd-balon__govde {
  background: var(--yd-kagit);
  border: 1px solid var(--yd-cizgi);
}
.yd-balon--kisi { align-self: flex-end; }
.yd-balon--kisi .yd-balon__rol { text-align: right; }
.yd-balon--kisi .yd-balon__govde { background: var(--yd-murekkep); color: #fff; }

/* Yazıyor göstergesi */
.yd-yaziyor span {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 4px;
  border-radius: 50%;
  background: var(--yd-celik);
  animation: yd-zipla 1.1s infinite;
}
.yd-yaziyor span:nth-child(2) { animation-delay: 0.15s; }
.yd-yaziyor span:nth-child(3) { animation-delay: 0.3s; }

/* Blog kartı */
.yd-blog { max-width: 88%; }
.yd-blog a {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 11px 14px;
  border: 1px solid var(--yd-mavi);
  border-radius: 8px;
  background: var(--yd-mavi-acik);
  color: var(--yd-murekkep);
  text-decoration: none;
}
.yd-blog a:hover { background: #DCEBF9; }
.yd-blog a:focus-visible { outline: 2px solid var(--yd-mavi); outline-offset: 2px; }
.yd-blog__etiket { color: var(--yd-mavi); }
.yd-blog__baslik { font-size: 14px; font-weight: 500; }

/* Örnek sorular */
.yd-ornekler {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0 18px 12px;
}
.yd-ornek {
  padding: 6px 11px;
  border: 1px solid var(--yd-cizgi);
  border-radius: 999px;
  background: #fff;
  color: var(--yd-celik);
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.yd-ornek:hover { border-color: var(--yd-mavi); color: var(--yd-mavi); }
.yd-ornek:focus-visible { outline: 2px solid var(--yd-mavi); outline-offset: 2px; }

/* Giriş alanı */
.yd-giris {
  flex: none;
  display: flex;
  gap: 9px;
  align-items: flex-end;
  padding: 12px 14px;
  border-top: 1px solid var(--yd-cizgi);
  background: #fff;
}
.yd-giris textarea {
  flex: 1;
  min-height: 42px;
  max-height: 110px;
  padding: 10px 12px;
  border: 1px solid var(--yd-cizgi);
  border-radius: 7px;
  background: #fff;
  color: var(--yd-murekkep);
  font-family: inherit;
  font-size: 14.5px;
  line-height: 1.45;
  resize: none;
}
.yd-giris textarea:focus {
  outline: 2px solid var(--yd-mavi);
  outline-offset: -1px;
  border-color: var(--yd-mavi);
}
.yd-gonder {
  flex: none;
  padding: 11px 18px;
  border: none;
  border-radius: 7px;
  background: var(--yd-murekkep);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}
.yd-gonder:hover:not(:disabled) { background: var(--yd-mavi); }
.yd-gonder:disabled { opacity: 0.4; cursor: not-allowed; }
.yd-gonder:focus-visible { outline: 2px solid var(--yd-mavi); outline-offset: 2px; }

/* ═══════════ Yol haritası paneli ═══════════ */

.yd-kilavuz {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #FBFCFD;
  border-left: 1px solid var(--yd-cizgi);
}

/* Balon modunda sohbetin üzerine kayar */
.yd--balon .yd-kilavuz {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-left: none;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.24s ease, visibility 0.24s;
}
.yd--balon.yd--harita-acik .yd-kilavuz { transform: none; visibility: visible; }

.yd-kilavuz__bas {
  flex: none;
  padding: 12px 16px;
  border-bottom: 1px solid var(--yd-cizgi);
  background: #fff;
}
.yd-kilavuz__ad {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.yd-kilavuz__alt-metin { margin: 3px 0 0; font-family: var(--yd-mono); font-size: 10px; color: var(--yd-celik); }

.yd-adimlar { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }

.yd-bos {
  padding: 32px 22px;
  text-align: center;
  color: var(--yd-celik);
  font-size: 12.5px;
  line-height: 1.65;
}
.yd-bos__ikon {
  display: block;
  margin-bottom: 10px;
  font-family: var(--yd-mono);
  font-size: 22px;
  color: var(--yd-cizgi);
}

.yd-adim {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 11px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--yd-kagit-koyu);
  animation: yd-belir 0.3s ease-out both;
}
.yd-adim__no {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border: 1px solid var(--yd-murekkep);
  border-radius: 50%;
  font-family: var(--yd-mono);
  font-size: 10.5px;
  font-weight: 500;
}
.yd-adim--aktif .yd-adim__no { background: var(--yd-murekkep); color: #fff; }
.yd-adim__ad { font-size: 13.5px; font-weight: 600; line-height: 1.35; }
.yd-adim__aciklama { margin-top: 3px; font-size: 12.5px; color: var(--yd-celik); line-height: 1.5; }
.yd-adim__link {
  display: inline-block;
  margin-top: 6px;
  padding-bottom: 1px;
  border-bottom: 1px solid var(--yd-mavi);
  color: var(--yd-mavi);
  font-size: 12px;
  text-decoration: none;
}
.yd-adim__link:hover { color: var(--yd-murekkep); border-color: var(--yd-murekkep); }
.yd-adim__link:focus-visible { outline: 2px solid var(--yd-mavi); outline-offset: 2px; }

.yd-not {
  padding: 13px 16px;
  border-top: 1px solid var(--yd-kagit-koyu);
  background: var(--yd-uyari-kagit);
  animation: yd-belir 0.3s ease-out both;
}
.yd-not__etiket { display: block; margin-bottom: 4px; color: var(--yd-uyari); }
.yd-not__metin { font-size: 12.5px; line-height: 1.5; }

.yd-kilavuz__ayak {
  flex: none;
  padding: 13px 16px;
  border-top: 1px solid var(--yd-cizgi);
  background: #fff;
}
.yd-cta {
  display: block;
  width: 100%;
  padding: 11px;
  border: none;
  border-radius: 7px;
  background: var(--yd-onay);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
}
.yd-cta:hover { background: var(--yd-onay-koyu); }
.yd-cta:focus-visible { outline: 2px solid var(--yd-murekkep); outline-offset: 2px; }
.yd-kilavuz__ayak[hidden] { display: none; }

/* ═══════════ Sayfa modu (/tr/yardimci.html) ═══════════ */

.yd--sayfa { display: block; }
.yd--sayfa .yd-panel {
  display: flex;
  height: min(640px, calc(100vh - 160px));
  min-height: 460px;
  border-radius: 10px;
  box-shadow: var(--shadow-md, 0 4px 12px rgba(0, 0, 0, 0.1));
}
.yd--sayfa .yd-govde { grid-template-columns: 1fr 340px; }
.yd--sayfa .yd-bar__dugme { display: none; }
.yd--sayfa .yd-bar__kapat { display: none; }

/* ═══════════ Duyarlılık ═══════════ */

@media (max-width: 820px) {
  .yd--sayfa .yd-panel { height: auto; min-height: 0; }
  .yd--sayfa .yd-govde { grid-template-columns: 1fr; }
  .yd--sayfa .yd-akis { min-height: 320px; }
  .yd--sayfa .yd-kilavuz { border-left: none; border-top: 1px solid var(--yd-cizgi); }
  .yd--sayfa .yd-adimlar { max-height: none; overflow: visible; }
}

/* Mobilde balon tam ekran */
@media (max-width: 600px) {
  .yd--balon { right: 14px; bottom: 14px; }
  .yd--balon .yd-fab { padding: 12px 17px; }
  .yd--balon .yd-panel {
    inset: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    border: none;
    border-radius: 0;
  }
  .yd--acik { inset: 0; right: 0; bottom: 0; }
}

/* ═══════════ Hareket ═══════════ */

@keyframes yd-belir {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
@keyframes yd-zipla {
  0%, 60%, 100% { opacity: 0.25; }
  30%           { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .yd *,
  .yd *::before,
  .yd *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .yd-yaziyor span { opacity: 0.5; }
  .yd--balon .yd-kilavuz { transition: none; }
}
