/* ==================================================================
   ÖN YÜZ YZ — PARTİ 5 GÖRÜNÜM: dershane tasarımı + baykuş          2026-10-06
   ==================================================================
   Plan: memory-bank/plan-onyuz-yz-asistan.md §13 · iş listesi Parti 5.
   Kararlar (kullanıcı, 2026-10-06): dershane moru (#7367f0 → #9e95f5) · baykuş konuşma balonuyla başlatır ·
   selam her yeni sayfa türünde 1 kez (ödemede sessiz).
   Referans: views/onlinedershane/includes/ai_chat_offcanvas2.php (sağdan tam boy panel, mor başlık, desenli gövde,
   yarı saydam balonlar, mor çerçeveli haplar, yuvarlak yazı kutusu + mor yuvarlak gönder, alt not).
   Eski görünüm: yz-asistan.css (geri dönüş: kabuktaki <link> satırı).
   Katman sırası: .nk-appbar 40 · baykuş + selam 1090 · panel 1110 · kampanya toast 1150 · çerez bandı 1200 ·
   mobil panel 1250 (tam ekran, bandın da üstünde) · canlı destek 2147483640 (solda).
   --nk-yz-bant: ekranın altından çerez bandının üst kenarına kadar olan yükseklik — JS ölçer (bant kapalıysa 0).
   ================================================================== */
.nk-yz {
  --nk-yz-mor: #7367f0;
  --nk-yz-mor-2: #9e95f5;
  --nk-yz-mor-k: #5e50ee;
  --nk-yz-mor-acik: #f1effe;
  --nk-yz-yazi: #2f3349;
  --nk-yz-yazi-2: #6e6b7b;
  --nk-yz-cizgi: #e6e3fb;
  --nk-yz-bant: 0px;
  font-family: inherit;
}
.nk-yz[hidden] { display: none !important; }
.nk-yz-perde { display: none !important; }   /* dershane panelinde perde yok; mobilde panel tam ekran */

/* ── çağırıcı: baykuş ──────────────────────────────────────────── */
.nk-yz-balon {
  position: fixed;
  right: 16px;
  bottom: calc(16px + var(--nk-yz-bant));
  z-index: 1090;
  display: flex;
  align-items: flex-end;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
  animation: nk-yz-belir .6s cubic-bezier(.2, .9, .3, 1.25) both;
  -webkit-tap-highlight-color: transparent;
}
.nk-yz-baykus {
  display: block;
  width: 84px;
  filter: drop-shadow(0 10px 12px rgb(47 51 73 / .28));
  transform-origin: 50% 100%;
  animation: nk-yz-bekle 8s ease-in-out 3s infinite;
  transition: transform .2s ease;
}
.nk-yz-baykus img { display: block; width: 100%; height: auto; }
.nk-yz-balon:hover .nk-yz-baykus { transform: translateY(-3px) rotate(-3deg); animation-play-state: paused; }
.nk-yz-balon:focus-visible { outline: 3px solid var(--nk-yz-mor); outline-offset: 4px; border-radius: 18px; }
/* masaüstü: baykuşun solunda mor hap (dershane "✨ Yapay Zeka Asistanı" düğmesi gibi) */
.nk-yz-balon-yazi {
  order: -1;
  margin: 0 -4px 18px 0;
  padding: 9px 16px;
  border-radius: 999px 999px 6px 999px;
  background: linear-gradient(135deg, var(--nk-yz-mor), var(--nk-yz-mor-2));
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: .2px;
  white-space: nowrap;
  box-shadow: 0 8px 20px -6px rgb(115 103 240 / .6);
}
.nk-yz-balon-yazi::before { content: '✨ '; }
.nk-yz-selamli .nk-yz-balon-yazi,
.nk-yz[data-tur="odeme"] .nk-yz-balon-yazi {   /* selam görünürken ve ödeme adımında yalnız baykuş */
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; padding: 0; margin: 0;
}
.nk-yz[data-tur="odeme"] .nk-yz-baykus { width: 58px; }
.nk-yz-acik .nk-yz-balon { display: none; }

/* ── selam balonu: baykuş sohbeti başlatır ─────────────────────── */
.nk-yz-selam {
  position: fixed;
  right: 108px;
  bottom: calc(52px + var(--nk-yz-bant));
  z-index: 1090;
  width: 320px;
  max-width: calc(100vw - 120px);
  padding: 14px 14px 12px 16px;
  background: #fff;
  color: var(--nk-yz-yazi);
  border: 1px solid var(--nk-yz-cizgi);
  border-radius: 18px 18px 4px 18px;
  box-shadow: 0 18px 40px -14px rgb(47 51 73 / .38), 0 2px 6px rgb(115 103 240 / .08);
  animation: nk-yz-selam .35s cubic-bezier(.2, .9, .3, 1.15) both;
}
.nk-yz-selam::after {   /* baykuşa bakan kuyruk */
  content: '';
  position: absolute;
  right: -7px;
  bottom: 14px;
  width: 14px;
  height: 14px;
  background: #fff;
  border-right: 1px solid var(--nk-yz-cizgi);
  border-bottom: 1px solid var(--nk-yz-cizgi);
  transform: rotate(-45deg);
}
.nk-yz-selam-ad {
  display: block;
  margin: 0 26px 4px 0;
  color: var(--nk-yz-mor);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .3px;
  text-transform: uppercase;
}
.nk-yz-selam-metin {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 14.5px;
  line-height: 1.5;
  text-align: left;
  cursor: pointer;
}
.nk-yz-selam-dugmeler { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.nk-yz-selam .nk-yz-dugme { min-height: 32px; padding: 5px 12px; font-size: 13px; }
.nk-yz-selam-kapat {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: transparent; color: var(--nk-yz-yazi-2); cursor: pointer;
}
.nk-yz-selam-kapat:hover { background: var(--nk-yz-mor-acik); color: var(--nk-yz-mor); }
.nk-yz-selam-kapat svg { width: 15px; height: 15px; }

/* ── panel: sağdan tam boy (dershane) ──────────────────────────── */
.nk-yz-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: var(--nk-yz-bant);
  z-index: 1110;
  width: 420px;
  max-width: 100vw;
  display: flex;
  flex-direction: column;
  background: #fff;
  color: var(--nk-yz-yazi);
  box-shadow: -10px 0 30px rgb(0 0 0 / .15);
  animation: nk-yz-kay .4s cubic-bezier(.25, .8, .25, 1);
}
.nk-yz-panel[hidden] { display: none; }

.nk-yz-ust {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--nk-yz-mor), var(--nk-yz-mor-2));
  color: #fff;
  box-shadow: 0 4px 15px rgb(0 0 0 / .05);
  position: relative;
  z-index: 2;
}
.nk-yz-kim { display: flex; align-items: center; gap: 12px; min-width: 0; }
.nk-yz-kim strong { display: block; font-size: 16px; font-weight: 700; line-height: 1.2; letter-spacing: .3px; }
.nk-yz-kim small { display: block; font-size: 12px; opacity: .92; margin-top: 3px; }
.nk-yz-avatar {
  width: 46px; height: 46px; flex: none;
  border-radius: 50%;
  background: #fff url(img/baykus-on-alt-280.webp) 50% 42% / 132% auto no-repeat;
  box-shadow: 0 0 0 3px rgb(255 255 255 / .35);
}
.nk-yz-kapat {
  flex: none;
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px;
  padding: 0 12px;
  border: 0; border-radius: 8px;
  background: rgb(255 255 255 / .2); color: #fff;
  font: inherit; font-size: 13.5px; font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(5px);
  transition: background .2s ease;
}
.nk-yz-kapat:hover { background: rgb(255 255 255 / .32); }
.nk-yz-kapat svg { width: 15px; height: 15px; }

.nk-yz-dershane {
  display: block;
  padding: 9px 16px;
  background: var(--nk-yz-mor-acik);
  color: var(--nk-yz-mor-k);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid var(--nk-yz-cizgi);
}
.nk-yz-dershane:hover { text-decoration: underline; }

.nk-yz-govde {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 16px 8px;
  background-color: #f8f9fa;
  background-image: url(/assets/img/yz_background.jpg);   /* dershane paneliyle aynı desen */
  background-repeat: repeat;
  background-size: 150px;
  background-blend-mode: luminosity;
}
.nk-yz-govde::-webkit-scrollbar { width: 6px; }
.nk-yz-govde::-webkit-scrollbar-thumb { background-color: rgb(0 0 0 / .2); border-radius: 10px; }

/* ── mesajlar ──────────────────────────────────────────────────── */
.nk-yz-msj { display: flex; flex-direction: column; margin-bottom: 14px; position: relative; }
.nk-yz-ic {
  max-width: 88%;
  padding: 12px 15px;
  border-radius: 16px;
  font-size: 14.5px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  box-shadow: 0 2px 10px rgb(0 0 0 / .03);
}
.nk-yz-ben { align-items: flex-end; }
.nk-yz-ben .nk-yz-ic {
  background: rgb(230 240 255 / .9);
  color: #0c273d;
  border-bottom-right-radius: 4px;
  white-space: pre-wrap;
  backdrop-filter: blur(4px);
}
.nk-yz-yz { align-items: flex-start; padding-left: 40px; }
.nk-yz-yz::before {   /* uzman baykuş: her yapay zekâ mesajının yanında */
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fff url(img/baykus-on-alt-280.webp) 50% 42% / 132% auto no-repeat;
  box-shadow: 0 2px 8px rgb(115 103 240 / .25), 0 0 0 2px #fff;
}
.nk-yz-yz .nk-yz-ic {
  background: rgb(255 255 255 / .92);
  color: var(--nk-yz-yazi);
  border: 1px solid rgb(237 241 245 / .9);
  border-top-left-radius: 4px;
  backdrop-filter: blur(4px);
}
.nk-yz-ret .nk-yz-ic { background: #FFF8E6; border-color: #F3DFA8; }
.nk-yz-ic p { margin: 0 0 8px; }
.nk-yz-ic p:last-child { margin-bottom: 0; }
.nk-yz-ic ul, .nk-yz-ic ol { margin: 4px 0 8px; padding-left: 20px; }
.nk-yz-ic ul { list-style: disc; }       /* ortak.css listeleri sıfırlıyor */
.nk-yz-ic ol { list-style: decimal; }
.nk-yz-ic li { margin: 2px 0; }
.nk-yz-ic strong { font-weight: 700; color: #1f2333; }

/* öneri ve yönlendirme hapları (dershane .nk-ai-quick-btn) */
.nk-yz-dugmeler { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; max-width: 92%; }
.nk-yz-dugme {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 7px 14px;
  border: 1px solid var(--nk-yz-mor);
  border-radius: 20px;
  background: #fff;
  color: var(--nk-yz-mor);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  box-shadow: 0 2px 5px rgb(115 103 240 / .06);
  transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}
.nk-yz-dugme:hover {
  background: linear-gradient(45deg, var(--nk-yz-mor), var(--nk-yz-mor-2));
  border-color: var(--nk-yz-mor-2);
  color: #fff;
  box-shadow: 0 4px 10px rgb(115 103 240 / .3);
}
button.nk-yz-dugme { font: inherit; font-size: 13.5px; font-weight: 600; text-align: left; cursor: pointer; }
.nk-yz-hizli { margin-top: 10px; flex-direction: column; align-items: flex-start; }

/* yazıyor göstergesi (dershane .nk-ai-typing-indicator) */
.nk-yz-yaziyor .nk-yz-ic { display: inline-flex; gap: 4px; padding: 14px 16px; }
/* 2026-10-08 — ilk kelime gecikince üç noktanın altında çıkan not (yz-asistan.js gonder(), 12 sn; dershane .nk-ai-bekleme-notu) */
.nk-yz-bekleme-notu { margin-top: 5px; font-size: 12.5px; line-height: 1.4; color: #8c98a4; }
.nk-yz-nokta {
  width: 6px; height: 6px; border-radius: 50%;
  background: #8c98a4;
  animation: nk-yz-nokta 1.4s infinite both;
}
.nk-yz-nokta:nth-child(2) { animation-delay: .2s; }
.nk-yz-nokta:nth-child(3) { animation-delay: .4s; }

/* 2026-10-14 (Sınırlar revizyonu 2) — Cloudflare Turnstile kutusu, yazı alanının üstünde. 'interaction-only': çoğu ziyaretçide
   görünmez; etkileşim gerekince yz-asistan.js nk-yz-dogrula-acik sınıfını koyar (boşluk yalnız o zaman). */
.nk-yz-dogrula { display: flex; justify-content: center; background: #fff; }
.nk-yz-dogrula.nk-yz-dogrula-acik { padding: 10px 16px 0; }
.nk-yz-dogrula.nk-yz-dogrula-kapali { height: 0; padding: 0; overflow: hidden; }   /* jeton alındıktan 1,5 sn sonra */

/* 2026-10-14 (Faz C — Seviyemi Ölç) — yazı kutusunun üstünde kalıcı eylem çubuğu; görünüm dershane .nk-ai-eylem-btn ile aynı
   (ai_chat_offcanvas2.php). Yalnız sınavı belli sayfalarda (yz-asistan.js DENEME_TURLER). */
.nk-yz-eylem-cubugu { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.nk-yz-eylem-btn {
  flex: 1 1 auto;
  background: #f0eefe;
  border: 1px solid #d9d4fb;
  color: #5a4fd1;
  padding: 7px 12px;
  border-radius: 18px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}
.nk-yz-eylem-btn:hover {
  background: linear-gradient(45deg, #7367f0, #9e95f5);
  border-color: #9e95f5;
  color: #fff;
  box-shadow: 0 3px 8px rgba(115, 103, 240, .25);
}
.nk-yz-eylem-btn:active { transform: translateY(1px); }
.nk-yz-eylem-btn[disabled] { opacity: .5; cursor: default; }

/* 2026-10-14 (Faz C) — Seviyemi Ölç cevaplarında ayırıcı çizgi ve formüller (MathJax, dershane gibi; uzun formül kendi içinde kayar). */
.nk-yz-ic hr { border: 0; border-top: 1px solid #e6e8ef; margin: 12px 0; }
.nk-yz-ic mjx-container[display="true"] { display: block; max-width: 100%; overflow-x: auto; overflow-y: hidden; margin: .6em 0 !important; padding-bottom: 4px; }
.nk-yz-ic mjx-container:not([display="true"]) { max-width: 100%; }
/* 2026-10-15 (Faz C) — "> …" alıntı kutusu (Seviyemi Ölç'teki video / hoca önerisi). */
.nk-yz-ic blockquote { margin: 8px 0; padding: 8px 12px; border-left: 3px solid var(--nk-yz-mor-2); border-radius: 0 10px 10px 0; background: var(--nk-yz-mor-acik); color: #3d3a52; }
.nk-yz-ic blockquote p { margin: 0 0 4px; }
.nk-yz-ic blockquote p:last-child { margin-bottom: 0; }

/* ── yazı alanı (dershane .nk-ai-chat-input-wrap) ──────────────── */
.nk-yz-form {
  position: relative;
  margin: 0;
  padding: 12px 16px 4px;
  background: #fff;
  box-shadow: 0 -5px 20px rgb(0 0 0 / .03);
  z-index: 2;
}
.nk-yz-yazi {
  display: block;
  width: 100%;
  min-height: 46px;
  max-height: 120px;
  padding: 12px 54px 12px 16px;
  border: 1px solid #e1e5eb;
  border-radius: 24px;
  background: #f4f6f9;
  color: #495057;
  font: inherit;
  font-size: 16px;   /* iOS 16px altında yakınlaştırıyor */
  line-height: 1.35;
  resize: none;
  overflow-y: hidden;   /* JS en fazla 120px'e kadar büyütür */
  transition: border-color .3s ease, box-shadow .3s ease, background .3s ease;
}
.nk-yz-yazi::placeholder { color: #adb5bd; }
.nk-yz-yazi:focus { outline: 0; border-color: var(--nk-yz-mor); box-shadow: 0 0 0 3px rgb(115 103 240 / .12); background: #fff; }
.nk-yz-gonder {
  position: absolute;
  right: 22px;
  bottom: 9px;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: linear-gradient(135deg, var(--nk-yz-mor), var(--nk-yz-mor-2));
  color: #fff;
  cursor: pointer;
  box-shadow: 0 2px 8px rgb(115 103 240 / .4);
  transition: transform .2s ease, box-shadow .2s ease;
}
.nk-yz-gonder:hover { transform: scale(1.06); box-shadow: 0 4px 12px rgb(115 103 240 / .6); }
.nk-yz-gonder:disabled { background: #d1d5db; box-shadow: none; cursor: default; transform: none; }
.nk-yz-gonder svg { width: 17px; height: 17px; }

.nk-yz-alt {
  margin: 0;
  padding: 6px 18px 12px;
  background: #fff;
  color: #a0aab5;
  font-size: 11px;
  line-height: 1.45;
  text-align: center;
}
.nk-yz-alt a { color: inherit; text-decoration: underline; }

/* ── hareketler ────────────────────────────────────────────────── */
@keyframes nk-yz-belir { from { opacity: 0; transform: translateY(26px) scale(.85); } to { opacity: 1; transform: none; } }
@keyframes nk-yz-bekle {
  0%, 86%, 100% { transform: rotate(0); }
  89% { transform: rotate(-7deg); }
  92% { transform: rotate(5deg); }
  95% { transform: rotate(-3deg); }
}
@keyframes nk-yz-selam { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes nk-yz-kay { from { opacity: 0; transform: translateX(48px); } to { opacity: 1; transform: none; } }
@keyframes nk-yz-nokta { 0%, 80%, 100% { transform: scale(0); opacity: .3; } 40% { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .nk-yz-balon, .nk-yz-baykus, .nk-yz-selam, .nk-yz-panel { animation: none; }
  .nk-yz-nokta { animation: none; opacity: .6; }
}

/* ── mobil / tablet: alt uygulama barı 64px, panel tam ekran ───── */
@media (max-width: 1023.98px) {
  .nk-yz-balon { right: 12px; bottom: calc(12px + max(64px, var(--nk-yz-bant)) + env(safe-area-inset-bottom)); }
  .nk-yz-baykus { width: 58px; }
  .nk-yz-balon-yazi {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; padding: 0; margin: 0;
  }
  .nk-yz-selam {
    right: 12px;
    left: 12px;
    width: auto;
    max-width: none;
    bottom: calc(12px + max(64px, var(--nk-yz-bant)) + 84px + env(safe-area-inset-bottom));
    border-radius: 18px 18px 4px 18px;
  }
  .nk-yz-selam::after { right: 30px; bottom: -7px; transform: rotate(45deg); }
  .nk-yz-panel {
    z-index: 1250;
    left: 0;
    bottom: 0;
    width: auto;
    height: 100vh;
    height: 100dvh;
  }
  .nk-yz-alt { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
}
@media (max-width: 480px) {
  .nk-yz-hiz { display: none; }   /* dar ekranda başlık alt satırı tek satır kalsın */
}
/* mobilde panel açıkken arkadaki sayfa kaymasın (JS html'e sınıf koyar) */
@media (max-width: 1023.98px) {
  html.nk-yz-kilit, html.nk-yz-kilit body { overflow: hidden; }
}
