/* ============================================================
   Panorama Promosyon - Yapay Zeka Arayuzu
   ------------------------------------------------------------
   Iki bilesen:
   1) .ai-arama-* ... katalog sayfasindaki "Yapay Zeka ile Bul" alani
   2) #pp-chat    ... her sayfada sag altta duran sohbet balonu

   Tasarim dili mevcut tokens.css degiskenleriyle uyumludur
   (--renk-*, --b-*, --fs-*, --radius-*, --golge-*).
   ============================================================ */

/* ------------------------------------------------------------
   1. KATALOG: YAPAY ZEKA ARAMA
   ------------------------------------------------------------ */

.ai-arama-satir {
  margin-bottom: var(--b-4, 1rem);
}

.ai-arama-kutugu {
  display: flex;
  gap: var(--b-3, 0.75rem);
  align-items: center;
  padding: 0.85rem 1rem;
  background: linear-gradient(135deg, rgba(11, 27, 51, 0.04), rgba(198, 156, 62, 0.06));
  border: 1px solid rgba(11, 27, 51, 0.12);
  border-radius: var(--radius-lg, 14px);
}

.ai-arama-ikon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--renk-lacivert, #0b1b33);
  color: var(--renk-altin, #c69c3e);
}

.ai-arama-ikon svg {
  width: 18px;
  height: 18px;
}

.ai-arama-metin {
  flex: 1 1 auto;
  min-width: 0;
}

.ai-arama-baslik {
  display: block;
  font-weight: 700;
  font-size: var(--fs-sm, 0.875rem);
  color: var(--renk-lacivert, #0b1b33);
  line-height: 1.3;
}

.ai-arama-ipucu {
  display: block;
  font-size: var(--fs-xs, 0.78rem);
  color: var(--renk-metin-soluk, #5a6478);
  margin-top: 2px;
}

.ai-arama-buton {
  flex: 0 0 auto;
  white-space: nowrap;
}

/* NUMEX-DÜZELTME (2026-10-01): AI kutusunun KENDİ girdi alanı.
   Kullanıcı geri bildirimi: "kullanıcı ai'ye nereye yazacak" — önceden
   AI kutusunda girdi yoktu, kullanıcı alttaki klasik kutuya yazmak zorunda
   kalıyordu ve nereye yazacağını anlamıyordu. */
.ai-girdi-satir {
  display: flex;
  gap: var(--b-3, 0.75rem);
  align-items: flex-end;
  margin-top: var(--b-3, 0.75rem);
}

.ai-girdi {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.65rem 0.8rem;
  border: 1px solid rgba(11, 27, 51, 0.16);
  border-radius: var(--radius-lg, 14px);
  font-family: inherit;
  font-size: var(--fs-sm, 0.875rem);
  line-height: 1.45;
  color: var(--renk-metin, #232a36);
  background: #fff;
  resize: vertical;
  min-height: 48px;
  max-height: 140px;
}

.ai-girdi:focus {
  outline: 2px solid var(--renk-altin, #c69c3e);
  outline-offset: 1px;
  border-color: var(--renk-altin, #c69c3e);
}

.ai-girdi::placeholder {
  color: rgba(90, 100, 120, 0.75);
}

/* Ornek ciplerinin basindaki kucuk yonlendirme metni */
.ai-ornek-etiket {
  font-size: var(--fs-xs, 0.75rem);
  color: var(--renk-metin-soluk, #5a6478);
  display: inline-flex;
  align-items: center;
  padding-right: 0.15rem;
}

.ai-arama-buton.ai-yukleniyor {
  opacity: 0.7;
  cursor: wait;
}

/* Ornek sorgu cipleri */
.ai-ornekler {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: var(--b-3, 0.75rem);
}

.ai-ornek-cip {
  font-size: var(--fs-xs, 0.78rem);
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px dashed rgba(11, 27, 51, 0.22);
  background: transparent;
  color: var(--renk-metin-soluk, #5a6478);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  /* Dokunma hedefi: WCAG 44px altina inmesin */
  min-height: 32px;
  display: inline-flex;
  align-items: center;
}

.ai-ornek-cip:hover,
.ai-ornek-cip:focus-visible {
  border-color: var(--renk-altin, #c69c3e);
  color: var(--renk-lacivert, #0b1b33);
  background: rgba(198, 156, 62, 0.08);
}

/* Sonuc paneli */
.ai-sonuc-panel {
  margin-top: var(--b-5, 1.25rem);
  padding: var(--b-5, 1.25rem);
  border: 1px solid rgba(198, 156, 62, 0.35);
  border-radius: var(--radius-lg, 14px);
  background: rgba(255, 255, 255, 0.7);
}

.ai-panel-baslik {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--b-3, 0.75rem);
  margin-bottom: var(--b-4, 1rem);
  padding-bottom: var(--b-4, 1rem);
  border-bottom: 1px solid rgba(11, 27, 51, 0.1);
}

.ai-panel-baslik strong {
  font-size: var(--fs-lg, 1.05rem);
  color: var(--renk-lacivert, #0b1b33);
}

.ai-aciklama {
  margin: 4px 0 0;
  font-size: var(--fs-sm, 0.875rem);
  color: var(--renk-metin-soluk, #5a6478);
}

.ai-bos {
  text-align: center;
  padding: var(--b-6, 1.5rem) var(--b-4, 1rem);
}

.ai-bos-baslik {
  font-weight: 700;
  color: var(--renk-lacivert, #0b1b33);
  margin-bottom: 0.4rem;
}

.ai-bos .btn {
  margin-top: var(--b-4, 1rem);
}

/* NUMEX-DÜZELTME (2026-10-01): Sonuç panelinin altındaki resmi şirket ünvanı.
   Kullanıcı isteği. Sade, ayrık bir alt bilgi satırı; mevcut tokenlarla uyumlu. */
.ai-unvan {
  margin: var(--b-4, 1rem) 0 0;
  padding-top: var(--b-3, 0.75rem);
  border-top: 1px solid rgba(11, 27, 51, 0.08);
  font-size: var(--fs-xs, 0.75rem);
  color: var(--renk-metin-soluk, #5a6478);
  text-align: center;
  letter-spacing: 0.01em;
}

@media (max-width: 720px) {
  .ai-unvan {
    font-size: 0.7rem;
    line-height: 1.5;
    text-align: left;
  }
}

/* AI modu: klasik liste ve filtre panelini gizle */
body.ai-modu .katalog-duzen > aside.filtre-panel {
  display: none;
}

/* Mobil: buton alt satira iner, metin sikismaz */
@media (max-width: 720px) {
  .ai-arama-kutugu {
    flex-wrap: wrap;
    padding: 0.75rem;
  }

  .ai-arama-metin {
    flex: 1 1 60%;
  }

  .ai-arama-buton {
    flex: 1 1 100%;
    width: 100%;
    margin-top: 0.25rem;
    min-height: 44px;
  }

  /* NUMEX-DÜZELTME (2026-10-01): Mobilde textarea ve buton alt alta iner. */
  .ai-girdi-satir {
    flex-direction: column;
    align-items: stretch;
  }

  .ai-girdi {
    width: 100%;
  }

  .ai-ornekler {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .ai-ornek-cip {
    flex: 0 0 auto;
  }

  .ai-sonuc-panel {
    padding: var(--b-4, 1rem) var(--b-3, 0.75rem);
  }

  .ai-panel-baslik {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ------------------------------------------------------------
   2. SOHBET BALONU (her sayfa)
   ------------------------------------------------------------ */

#pp-chat {
  position: fixed;
  right: clamp(0.75rem, 3vw, 1.5rem);
  bottom: clamp(0.75rem, 3vw, 1.5rem);
  z-index: 900;
  font-family: inherit;
}

/* Acma butonu */
.pp-chat-ac {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background: var(--renk-lacivert, #0b1b33);
  color: var(--renk-altin, #c69c3e);
  cursor: pointer;
  box-shadow: 0 6px 22px rgba(11, 27, 51, 0.32);
  transition: transform 0.18s, box-shadow 0.18s;
}

.pp-chat-ac:hover,
.pp-chat-ac:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(11, 27, 51, 0.4);
}

.pp-chat-ac svg {
  width: 26px;
  height: 26px;
}

/* Panel */
.pp-chat-panel {
  position: absolute;
  right: 0;
  bottom: 68px;
  display: none;
  flex-direction: column;
  width: min(380px, calc(100vw - 2rem));
  height: min(560px, calc(100vh - 8rem));
  background: #fff;
  border-radius: var(--radius-lg, 14px);
  box-shadow: 0 18px 48px rgba(11, 27, 51, 0.28);
  overflow: hidden;
  border: 1px solid rgba(11, 27, 51, 0.1);
}

.pp-chat-panel.acik {
  display: flex;
  animation: pp-chat-acilis 0.18s ease-out;
}

@keyframes pp-chat-acilis {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .pp-chat-panel.acik { animation: none; }
  .pp-chat-ac { transition: none; }
}

/* Baslik */
.pp-chat-baslik {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 0.9rem;
  background: var(--renk-lacivert, #0b1b33);
  color: #fff;
  flex: 0 0 auto;
}

.pp-chat-baslik-metin {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.25;
}

.pp-chat-baslik-metin strong {
  display: block;
  font-size: var(--fs-sm, 0.875rem);
}

.pp-chat-durum {
  display: block;
  font-size: var(--fs-xs, 0.75rem);
  opacity: 0.75;
}

.pp-chat-kapat {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  /* Dokunma hedefi 44px */
  width: 44px;
  height: 44px;
  margin: -0.4rem -0.4rem -0.4rem 0;
  border: none;
  background: transparent;
  color: #fff;
  cursor: pointer;
  border-radius: 8px;
  opacity: 0.85;
}

.pp-chat-kapat:hover,
.pp-chat-kapat:focus-visible {
  opacity: 1;
  background: rgba(255, 255, 255, 0.12);
}

.pp-chat-kapat svg {
  width: 18px;
  height: 18px;
}

/* Mesaj alani */
.pp-chat-mesajlar {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.9rem;
  background: #f7f8fa;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.sohbet-mesaj {
  display: flex;
  max-width: 100%;
}

.sohbet-mesaj.user {
  justify-content: flex-end;
}

.sohbet-balon {
  max-width: 82%;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  font-size: var(--fs-sm, 0.875rem);
  line-height: 1.45;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.sohbet-mesaj.asistan .sohbet-balon {
  background: #fff;
  color: var(--renk-metin, #232a36);
  border: 1px solid rgba(11, 27, 51, 0.09);
  border-bottom-left-radius: 4px;
}

.sohbet-mesaj.user .sohbet-balon {
  background: var(--renk-lacivert, #0b1b33);
  color: #fff;
  border-bottom-right-radius: 4px;
}

/* Karsilama + ornekler */
.sohbet-karsilama {
  background: #fff;
  border: 1px solid rgba(11, 27, 51, 0.09);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  font-size: var(--fs-sm, 0.875rem);
  line-height: 1.5;
  color: var(--renk-metin, #232a36);
}

.sohbet-karsilama p {
  margin: 0 0 0.35rem;
}

.sohbet-karsilama p:last-child {
  margin-bottom: 0;
}

.sohbet-ornekler {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.2rem;
}

/* NUMEX-DÜZELTME (2026-10-01): KULLANICI GERİ BİLDİRİMİ - "Asistan kafayı
   yemiş".  İnceleme: HTML/CSS bozuk değildi, çipler düzgün ayrı butonlardı;
   ancak görünümleri o kadar SOLUKTU ki (1px açık gri çerçeve, gölgesiz, beyaz
   zemin) metin gibi algılanıyor, seçilip kopyalanınca tek satır gibi
   görünüyordu. "Buton olduğu anlaşılsın" diye görsel ağırlık artırıldı:
   belirgin çerçeve + yumuşak gölge + hafif zemin + baştaki ok işareti. */
.sohbet-ornekler button {
  position: relative;
  text-align: left;
  font-size: var(--fs-xs, 0.78rem);
  font-weight: var(--fw-yari, 600);
  padding: 0.6rem 0.7rem 0.6rem 1.85rem;
  /* Dokunma hedefi */
  min-height: 44px;
  display: flex;
  align-items: center;
  background: #fbfcfe;
  border: 1px solid rgba(11, 27, 51, 0.22);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(11, 27, 51, 0.06);
  color: var(--renk-lacivert, #0b1b33);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s, transform 0.1s;
}

/* Baştaki ok işareti: elemanın buton olduğunu bir bakışta belli eder. */
.sohbet-ornekler button::before {
  content: '';
  position: absolute;
  left: 0.72rem;
  top: 50%;
  width: 0.42rem;
  height: 0.42rem;
  margin-top: -0.21rem;
  border-right: 2px solid var(--renk-altin, #c69c3e);
  border-bottom: 2px solid var(--renk-altin, #c69c3e);
  transform: rotate(-45deg);
  pointer-events: none;
}

.sohbet-ornekler button:hover,
.sohbet-ornekler button:focus-visible {
  border-color: var(--renk-altin, #c69c3e);
  background: rgba(198, 156, 62, 0.09);
  box-shadow: 0 2px 6px rgba(11, 27, 51, 0.1);
}

.sohbet-ornekler button:active {
  transform: translateY(1px);
  box-shadow: 0 1px 2px rgba(11, 27, 51, 0.08);
}

/* Hareket azaltma tercihi olan kullanıcıda basma animasyonu kapalı. */
@media (prefers-reduced-motion: reduce) {
  .sohbet-ornekler button {
    transition: none;
  }
  .sohbet-ornekler button:active {
    transform: none;
  }
}

/* "Yaziyor..." gostergesi */
.sohbet-yaziyor {
  display: flex;
  gap: 4px;
  padding: 0.6rem 0.8rem;
  background: #fff;
  border: 1px solid rgba(11, 27, 51, 0.09);
  border-radius: 12px;
  border-bottom-left-radius: 4px;
  width: fit-content;
}

.sohbet-yaziyor span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--renk-metin-soluk, #8a93a6);
  animation: pp-nokta 1.2s infinite ease-in-out;
}

.sohbet-yaziyor span:nth-child(2) { animation-delay: 0.15s; }
.sohbet-yaziyor span:nth-child(3) { animation-delay: 0.3s; }

@keyframes pp-nokta {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30%           { opacity: 1;   transform: translateY(-3px); }
}

@media (prefers-reduced-motion: reduce) {
  .sohbet-yaziyor span { animation: none; opacity: 0.6; }
}

/* Girdi alani */
.pp-chat-form {
  flex: 0 0 auto;
  display: flex;
  gap: 0.5rem;
  padding: 0.7rem;
  border-top: 1px solid rgba(11, 27, 51, 0.09);
  background: #fff;
}

.pp-chat-girdi {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.6rem 0.75rem;
  border: 1px solid rgba(11, 27, 51, 0.16);
  border-radius: 10px;
  font-family: inherit;
  font-size: var(--fs-sm, 0.875rem);
  resize: none;
  min-height: 44px;
  max-height: 110px;
  line-height: 1.4;
  color: var(--renk-metin, #232a36);
}

.pp-chat-girdi:focus {
  outline: 2px solid var(--renk-altin, #c69c3e);
  outline-offset: 1px;
  border-color: var(--renk-altin, #c69c3e);
}

.pp-chat-gonder {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 10px;
  background: var(--renk-lacivert, #0b1b33);
  color: #fff;
  cursor: pointer;
  transition: opacity 0.15s;
}

.pp-chat-gonder:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pp-chat-gonder svg {
  width: 18px;
  height: 18px;
}

/* Mobil: panel tam genislik */
@media (max-width: 480px) {
  .pp-chat-panel {
    position: fixed;
    inset: auto 0 0 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: min(80vh, 620px);
    border-radius: 16px 16px 0 0;
  }

  .pp-chat-ac {
    width: 52px;
    height: 52px;
  }
}
