/*
 * Rayzıl sohbet widget'ı — stil dosyası.
 *
 * Kaynak: eski_site/chat-widget.css (BİREBİR kopya). Tailwind'e dokunmadan
 * `.rcw-` önekiyle çakışmasız durur; ölçüler, renkler ve animasyonlar
 * legacy ile aynıdır, böylece kullanıcı yeni sitede aynı pencereyi görür.
 *
 * EKLENEN (legacy'de yoktu): karanlık mod. Yeni sitede tema `html.dark`
 * sınıfıyla değişiyor; widget beyaz kalırsa koyu sayfada sırıtıyordu.
 * Yalnızca renkler değişir, ölçü/konum aynı kalır.
 */
:root { --rcw-primary:#4F46E5; --rcw-primary-dark:#4338CA; --rcw-bg:#fff; }
#rcw-fab {
  position:fixed; bottom:20px; right:20px; width:64px; height:64px; border-radius:50%;
  background:#ffffff00; border:none; cursor:pointer; padding:0; overflow:hidden;
  box-shadow:0 3px 24px rgba(79, 70, 229, 0.87); z-index:9999;
  display:flex; align-items:center; justify-content:center;
  transition:transform .2s ease, box-shadow .2s ease;
}
#rcw-fab img { width:100%; height:90%; object-fit:cover; border-radius:50%; display:block; }
#rcw-fab:hover { transform:scale(1.08); box-shadow:0 3px 24px rgba(79, 70, 229, 0.87); }
/* Sohbet açıkken: resmi gizle, yerine ✕ göster */
#rcw-fab.rcw-open img { display:none; }
#rcw-fab.rcw-open { background:linear-gradient(135deg,var(--rcw-primary),#7C3AED); color:#fff; font-size:24px; }
#rcw-fab.rcw-open::after { content:"✕"; }
#rcw-win {
  position:fixed; bottom:95px; right:20px; width:370px; max-width:calc(100vw - 40px); height:520px; max-height:calc(100vh - 130px);
  background:var(--rcw-bg); border-radius:16px; box-shadow:0 20px 60px rgba(0,0,0,.25);
  display:flex; flex-direction:column; overflow:hidden; z-index:9998;
  opacity:0; transform:translateY(20px) scale(.97); pointer-events:none;
  transition:opacity .25s ease, transform .25s ease;
}
#rcw-win.rcw-open { opacity:1; transform:translateY(0) scale(1); pointer-events:auto; }
.rcw-head { background:linear-gradient(135deg,var(--rcw-primary),#7C3AED); color:#fff; padding:14px 16px; display:flex; align-items:center; justify-content:space-between; }
.rcw-head b { font-size:15px; }
.rcw-head small { display:block; font-size:11px; opacity:.85; font-weight:400; }
#rcw-close { background:rgba(255,255,255,.2); border:none; color:#fff; width:30px; height:30px; border-radius:50%; cursor:pointer; font-size:16px; }
#rcw-close:hover { background:rgba(255,255,255,.35); }
#rcw-body { flex:1; overflow-y:auto; padding:14px; display:flex; flex-direction:column; gap:10px; background:#F8FAFC; }
.rcw-msg { max-width:80%; padding:10px 14px; border-radius:16px; font-size:14px; line-height:1.5; word-wrap:break-word; white-space:pre-wrap; }
.rcw-bot { align-self:flex-start; background:#E5E7EB; color:#1F2937; border-bottom-left-radius:4px; }
.rcw-user { align-self:flex-end; background:var(--rcw-primary); color:#fff; border-bottom-right-radius:4px; }
.rcw-typing { align-self:flex-start; background:#E5E7EB; padding:12px 16px; border-radius:16px; display:flex; gap:5px; }
.rcw-typing span { width:8px; height:8px; border-radius:50%; background:#9CA3AF; animation:rcw-blink 1.2s infinite; }
.rcw-typing span:nth-child(2){animation-delay:.2s} .rcw-typing span:nth-child(3){animation-delay:.4s}
@keyframes rcw-blink { 0%,60%,100%{opacity:.3;transform:translateY(0)} 30%{opacity:1;transform:translateY(-4px)} }
/* ── İsim kapısı (PHASE 58i — yeniden tasarlandı) ───────────────────────
 *
 * Kullanıcı geri bildirimi: "isim gir bölümünü daha profesyonel yap, çok
 * basit duruyor". Önceki hâli: bir paragraf + girdi + düğme, hiyerarşisiz.
 *
 * Yeni düzen: rozet (asistan görseli) → başlık → açıklama → etiketli alan →
 * birincil düğme → gizlilik notu. Ölçüler mevcut pencere diliyle uyumlu
 * (14px gövde, 10/12px köşe yarıçapı, mor birincil renk).
 *
 * `prefers-reduced-motion` saygı görür: giriş animasyonu kapatılır.
 */
#rcw-gate {
  flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:14px; padding:26px 22px; background:#F8FAFC; text-align:center;
  animation:rcw-gate-in .28s ease-out;
}
@keyframes rcw-gate-in { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }
@media (prefers-reduced-motion: reduce) { #rcw-gate { animation:none; } }

.rcw-gate-badge {
  width:56px; height:56px; border-radius:50%; overflow:hidden;
  box-shadow:0 8px 20px -8px rgba(79,70,229,.75);
  border:2px solid #fff; background:#fff; flex:0 0 auto;
}
.rcw-gate-badge img { width:100%; height:100%; object-fit:cover; display:block; }

.rcw-gate-title { font-size:17px; font-weight:700; color:#111827; margin:0; letter-spacing:-.01em; }
.rcw-gate-sub { font-size:12.5px; line-height:1.55; color:#6B7280; margin:0; max-width:34ch; }

/* Alan bloğu sola hizalı: etiket + girdi aynı hizada okunur. */
.rcw-gate-field { width:100%; text-align:left; }
.rcw-gate-label { display:block; font-size:11.5px; font-weight:700; letter-spacing:.04em;
  text-transform:uppercase; color:#6B7280; margin-bottom:6px; }

.rcw-gate-input {
  display:flex; align-items:center; gap:8px; width:100%;
  padding:0 12px; background:#fff; border:2px solid #E5E7EB; border-radius:11px;
  transition:border-color .18s ease, box-shadow .18s ease;
}
.rcw-gate-input:focus-within { border-color:var(--rcw-primary); box-shadow:0 0 0 4px rgba(79,70,229,.14); }
.rcw-gate-input svg { flex:0 0 auto; color:#9CA3AF; }
.rcw-gate-input:focus-within svg { color:var(--rcw-primary); }
.rcw-gate-input input,
#rcw-name {
  flex:1 1 auto; min-width:0; width:100%; border:0; outline:none; background:transparent;
  padding:12px 0; font-size:14px; color:#111827; font-family:inherit;
}

#rcw-start {
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  width:100%; padding:13px 20px; border:none; border-radius:11px; cursor:pointer;
  background:linear-gradient(135deg,var(--rcw-primary),#7C3AED); color:#fff;
  font-size:14px; font-weight:700; letter-spacing:.01em;
  box-shadow:0 10px 22px -12px rgba(79,70,229,.9);
  transition:transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}
#rcw-start:hover { transform:translateY(-1px); box-shadow:0 14px 26px -12px rgba(79,70,229,1); }
#rcw-start:disabled { opacity:.65; cursor:wait; transform:none; }
#rcw-start:focus-visible { outline:2px solid var(--rcw-primary); outline-offset:2px; }

.rcw-gate-note { display:flex; align-items:center; justify-content:center; gap:6px;
  font-size:10.5px; line-height:1.5; color:#9CA3AF; margin:2px 0 0; }
.rcw-gate-note svg { flex:0 0 auto; }

/* Uyarı satırı: kendi başına yükseklik kaplar, mesaj gelince zıplama olmaz. */
.rcw-warn { font-size:12px; color:#DC2626; min-height:16px; margin:6px 0 0; }
/* Mesaj giriş alanı */
#rcw-win, #rcw-win * { box-sizing:border-box; }
#rcw-foot { display:flex; gap:8px; padding:12px; border-top:1px solid #E5E7EB; background:#fff; align-items:flex-end; }
#rcw-input { flex:1 1 auto; min-width:0; border:2px solid #E5E7EB; border-radius:10px; padding:10px 12px; font-size:14px; resize:none; outline:none; max-height:90px; font-family:inherit; }
#rcw-input:focus { border-color:var(--rcw-primary); }
#rcw-send { flex:0 0 auto; background:var(--rcw-primary); color:#fff; border:none; border-radius:10px; padding:10px 18px; font-size:14px; font-weight:600; cursor:pointer; white-space:nowrap; }
#rcw-send:hover { background:var(--rcw-primary-dark); }
#rcw-send:disabled { opacity:.5; cursor:wait; }
/* Mobil: neredeyse tam ekran */
@media (max-width:480px) {
  #rcw-win { right:10px; left:10px; width:auto; max-width:none; bottom:90px; height:calc(100vh - 110px); }
  #rcw-fab { bottom:15px; right:15px; }
}

/* ── Karanlık mod (yeni sitenin `html.dark` sınıfı) ── */
html.dark #rcw-win { --rcw-bg:#162338; box-shadow:0 20px 60px rgba(0,0,0,.55); }
html.dark #rcw-body,
html.dark #rcw-gate { background:#0f1a2b; }
html.dark .rcw-gate-badge { border-color:#162338; background:#162338; }
html.dark .rcw-gate-title { color:#f8fafc; }
html.dark .rcw-gate-sub,
html.dark .rcw-gate-label,
html.dark .rcw-gate-note { color:#a8b3c7; }
html.dark .rcw-gate-input { background:#0b1220; border-color:#243247; }
html.dark .rcw-gate-input:focus-within { border-color:var(--rcw-primary); }
html.dark #rcw-name,
html.dark #rcw-name::placeholder { color:#f8fafc; }
html.dark #rcw-name::placeholder { color:#64748b; }
html.dark #rcw-foot { background:#162338; border-top-color:#243247; }
html.dark #rcw-input { background:#0b1220; border-color:#243247; color:#f8fafc; }
html.dark #rcw-input::placeholder { color:#64748b; }
html.dark .rcw-bot { background:#243247; color:#e2e8f0; }
html.dark .rcw-typing { background:#243247; }
html.dark .rcw-typing span { background:#64748b; }
