/* t2n-destek müşteri sohbet sayfası. Mat siyah kutu, gümüş logo. */
:root {
  --siyah: #111;
  --siyah-2: #1c1c1c;
  --gumus: #c9c9c9;
  --gumus-acik: #e4e4e4;
  --gumus-koyu: #8e8e8e;
  --zemin: #fff;
  --dis-zemin: #ebebeb;
  --balon-asistan: #f1f1f2;
  --metin: #171717;
  --soluk: #6b6b6b;
  --cizgi: #e6e6e6;
  --wa: #25d366;
  --wa-koyu: #1ebe5a;
  --uyari-zemin: #fff5e6;
  --uyari-metin: #6a4300;
  --golge: 0 1px 2px rgba(0, 0, 0, .06), 0 2px 8px rgba(0, 0, 0, .06);
  --yaricap: 18px;
  --kenar: 16px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font);
  font-size: 15px;
  background: var(--dis-zemin);
  color: var(--metin);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow: hidden;
}

button { font: inherit; }

.uygulama {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 720px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  background: var(--zemin);
  box-shadow: 0 0 32px rgba(0, 0, 0, .1);
  overflow: hidden;
}

html.gomulu body { background: var(--zemin); }
html.gomulu .uygulama { max-width: none; box-shadow: none; }

/* ---------- üst ---------- */
.ust {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 10px var(--kenar);
  padding-top: max(10px, env(safe-area-inset-top));
  background: var(--siyah);
  color: #fff;
  border-bottom: 1px solid #2a2a2a;
}

.logo {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--gumus);
  /* Text To Next ikonu (mobil uygulamanın ikonundan küçültüldü: public/sohbet/logo.png) */
  background: #fff url("logo.png") center / 112% no-repeat;
  overflow: hidden;
}

.ust-metin { flex: 1 1 auto; min-width: 0; }
.ust h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .02em;
  color: #f5f5f5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ust p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--gumus);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kapat {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  margin-right: -8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--gumus);
  cursor: pointer;
}
.kapat:hover, .kapat:focus-visible { background: rgba(255, 255, 255, .1); color: #fff; }

/* ---------- KVKK ---------- */
.kvkk {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px var(--kenar);
  background: #f7f7f7;
  border-bottom: 1px solid var(--cizgi);
  font-size: 12.5px;
  line-height: 1.45;
  color: #3d3d3d;
}
.kvkk p { margin: 0; flex: 1 1 auto; min-width: 0; }
.kvkk a { color: var(--siyah); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.kvkk button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 6px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--siyah);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* ---------- mesaj listesi ---------- */
.liste {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: var(--kenar);
  background: var(--zemin);
}

.mesajlar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mesaj {
  display: flex;
  flex-direction: column;
  max-width: 86%;
  min-width: 0;
}
.mesaj-musteri { align-self: flex-end; align-items: flex-end; }
.mesaj-asistan, .mesaj-insan { align-self: flex-start; align-items: flex-start; }

.etiket {
  margin: 0 0 4px 4px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--soluk);
}
.mesaj-insan .etiket { color: #444; }
.mesaj-insan .etiket::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: linear-gradient(145deg, #e9e9e9, #9a9a9a);
  vertical-align: 1px;
}

.balon {
  max-width: 100%;
  padding: 10px 14px;
  border-radius: var(--yaricap);
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  box-shadow: var(--golge);
}
.mesaj-musteri .balon {
  background: var(--siyah);
  color: #fff;
  border-bottom-right-radius: 6px;
}
.mesaj-asistan .balon {
  background: var(--balon-asistan);
  color: var(--metin);
  border-bottom-left-radius: 6px;
}
.mesaj-insan .balon {
  background: #fff;
  color: var(--metin);
  border: 1.5px solid var(--gumus);
  border-bottom-left-radius: 6px;
}
.balon a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.mesaj-musteri .balon a { color: #fff; }

.zaman {
  margin: 4px 6px 0;
  font-size: 11px;
  color: #9b9b9b;
}
.bekliyor .balon { opacity: .7; }

.sistem {
  align-self: center;
  max-width: 92%;
  padding: 6px 12px;
  border-radius: 12px;
  background: #f4f4f4;
  color: var(--soluk);
  font-size: 12.5px;
  line-height: 1.4;
  text-align: center;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.sistem a { color: inherit; }

/* ---------- fotoğraflar ---------- */
.ekler {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ekler + .metin { margin-top: 8px; }
.mesaj .balon:has(> .ekler:only-child) { padding: 4px; }
.ek {
  display: block;
  width: 160px;
  max-width: 100%;
  height: 160px;
  border-radius: 12px;
  overflow: hidden;
  background: #d9d9d9;
}
.ek img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ek-yok {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 64px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, .12);
  color: inherit;
  font-size: 13px;
  text-align: center;
  text-decoration: none;
}
.mesaj-asistan .ek-yok, .mesaj-insan .ek-yok { background: #e2e2e2; }

/* ---------- WhatsApp ---------- */
.wa-buton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  margin-top: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--wa);
  color: #fff;
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(37, 211, 102, .3);
}
.wa-buton::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fff;
}
.wa-buton:hover, .wa-buton:focus-visible { background: var(--wa-koyu); }

/* ---------- yazıyor ---------- */
.yaziyor {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--soluk);
}
.noktalar {
  display: inline-flex;
  gap: 4px;
  padding: 10px 12px;
  border-radius: var(--yaricap);
  border-bottom-left-radius: 6px;
  background: var(--balon-asistan);
}
.noktalar span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8a8a8a;
  animation: t2n-zipla 1.2s infinite ease-in-out;
}
.noktalar span:nth-child(2) { animation-delay: .15s; }
.noktalar span:nth-child(3) { animation-delay: .3s; }
@keyframes t2n-zipla {
  0%, 60%, 100% { transform: translateY(0); opacity: .45; }
  30% { transform: translateY(-4px); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .noktalar span { animation: none; opacity: .7; }
}

/* ---------- uyarılar ---------- */
.bildirim, .baglanti {
  flex: 0 0 auto;
  margin: 0 var(--kenar) 8px;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.4;
}
.bildirim {
  background: var(--uyari-zemin);
  color: var(--uyari-metin);
}
.baglanti {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  margin-top: 8px;
  background: #f4f4f4;
  color: #333;
  border: 1px solid var(--cizgi);
}
.baglanti p { margin: 0; flex: 1 1 200px; }
.baglanti .wa-buton { margin-top: 0; }

/* ---------- giriş ---------- */
.giris {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px var(--kenar);
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--cizgi);
  background: #fff;
}
html:not(.hazir) .giris { visibility: hidden; }

.giris textarea {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  max-height: 140px;
  margin: 0;
  padding: 11px 14px;
  border: 1px solid #d4d4d4;
  border-radius: 22px;
  background: #f8f8f8;
  color: var(--metin);
  font: inherit;
  font-size: 16px;
  line-height: 20px;
  resize: none;
  outline: none;
  overflow-y: auto;
}
.giris textarea:focus { border-color: var(--siyah); background: #fff; }
.giris textarea::placeholder { color: #8d8d8d; }

.ikon-buton {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid #d4d4d4;
  border-radius: 50%;
  background: #fff;
  color: #333;
  cursor: pointer;
}
.ikon-buton:hover:not(:disabled) { border-color: var(--siyah); color: var(--siyah); }

.gonder {
  flex: 0 0 auto;
  height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 22px;
  background: var(--siyah);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .01em;
  cursor: pointer;
}
.gonder:hover:not(:disabled) { background: #2b2b2b; }
.gonder:disabled, .ikon-buton:disabled { opacity: .45; cursor: default; }

button:focus-visible, a:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--gumus-koyu);
  outline-offset: 2px;
}

@media (max-width: 380px) {
  .gonder { padding: 0 14px; }
  .mesaj { max-width: 90%; }
  .ek { width: 140px; height: 140px; }
}
