/* ═══════════════════════════════════════════════
   ÇAKMAK HUKUK — AI Chatbot Widget Stilleri
   Mevcut site renk paletine uyumlu
   ═══════════════════════════════════════════════ */

:root {
  --cb-gold:    #b8952a;
  --cb-red:     #910000;
  --cb-dark:    #1a1a1a;
  --cb-light:   #f8f6f2;
  --cb-white:   #ffffff;
  --cb-muted:   #888;
  --cb-border:  rgba(145,0,0,.12);
  --cb-shadow:  0 8px 40px rgba(0,0,0,.16);
  --cb-radius:  18px;
  --cb-ease:    cubic-bezier(.4,0,.2,1);
}

/* ── Wrap ────────────────────────────────────── */
#cb-ai-wrap {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  font-family: inherit;
}

@media (max-width: 640px) {
  #cb-ai-wrap { bottom: 16px; right: 14px; }
}

/* ── Pencere ─────────────────────────────────── */
#cb-ai-window {
  width: 360px;
  max-height: 620px;
  background: var(--cb-white);
  border-radius: var(--cb-radius);
  box-shadow: var(--cb-shadow);
  border: 1px solid var(--cb-border);
  display: none;
  flex-direction: column;
  overflow: hidden;
  transform-origin: bottom right;
  animation: cb-ai-pop .25s var(--cb-ease);
}

#cb-ai-window.open { display: flex; }

@media (max-width: 420px) {
  #cb-ai-window {
    width: calc(100vw - 28px);
    max-height: 75vh;
    border-radius: 16px;
  }
}

@keyframes cb-ai-pop {
  from { opacity: 0; transform: scale(.92) translateY(12px); }
  to   { opacity: 1; transform: scale(1)  translateY(0);    }
}

/* ── Header ──────────────────────────────────── */
#cb-ai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--cb-red) 0%, #6b0000 100%);
  color: #fff;
  flex-shrink: 0;
}

#cb-ai-header-info { display: flex; align-items: center; gap: 10px; }

#cb-ai-avatar {
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,.5);
  box-shadow: 0 3px 12px rgba(0,0,0,.25);
}

#cb-ai-name {
  font-weight: 600;
  font-size: 14px;
  letter-spacing: .2px;
}

#cb-ai-status {
  font-size: 11.5px;
  opacity: .85;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 1px;
}

.cb-ai-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  animation: cb-ai-pulse 2s infinite;
}

@keyframes cb-ai-pulse {
  0%,100% { opacity: 1; }
  50%      { opacity: .5; }
}

#cb-ai-close {
  background: none;
  border: none;
  color: rgba(255,255,255,.8);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: color .15s;
}
#cb-ai-close svg { width: 18px; height: 18px; }
#cb-ai-close:hover { color: #fff; background: rgba(255,255,255,.1); }

/* ── Mesajlar ────────────────────────────────── */
#cb-ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}

#cb-ai-messages::-webkit-scrollbar { width: 4px; }
#cb-ai-messages::-webkit-scrollbar-thumb { background: rgba(0,0,0,.15); border-radius: 4px; }

.cb-ai-msg {
  max-width: 85%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.55;
  word-break: break-word;
}

/* Bot mesajı */
.cb-ai-msg.bot {
  background: var(--cb-light);
  color: var(--cb-dark);
  border-radius: 4px 14px 14px 14px;
  align-self: flex-start;
  border: 1px solid rgba(0,0,0,.06);
}

/* Kullanıcı mesajı */
.cb-ai-msg.user {
  background: var(--cb-red);
  color: #fff;
  border-radius: 14px 14px 4px 14px;
  align-self: flex-end;
}

/* Hata mesajı */
.cb-ai-msg.bot.error {
  background: #fff5f5;
  border-color: rgba(145,0,0,.2);
  color: var(--cb-red);
}

/* Yazıyor animasyonu */
.cb-ai-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 14px;
}

.cb-ai-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cb-muted);
  animation: cb-ai-bounce .8s infinite;
}

.cb-ai-typing span:nth-child(2) { animation-delay: .15s; }
.cb-ai-typing span:nth-child(3) { animation-delay: .30s; }

@keyframes cb-ai-bounce {
  0%,80%,100% { transform: translateY(0);    opacity: .5; }
  40%          { transform: translateY(-6px); opacity: 1;  }
}

/* ── Hızlı sorular — flat menü ───────────────── */
#cb-ai-quick-wrap {
  padding: 6px 10px 8px;
  flex-shrink: 0;
  border-top: 1px solid rgba(0,0,0,.06);
  background: #f8f9fb;
}

#cb-ai-quick {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cb-ai-qr {
  background: #fff;
  border: 1px solid #e4e4e4;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 12.5px;
  cursor: pointer;
  color: #1a1a2e;
  text-align: left;
  width: 100%;
  transition: background .12s, border-color .12s, transform .1s, color .12s;
  font-family: inherit;
}

.cb-ai-qr:hover {
  background: #eff8ff;
  border-color: #0284c7;
  color: #0284c7;
  transform: translateX(3px);
}

.cb-ai-qr:active { transform: translateX(5px); }

/* WhatsApp CTA butonu */
.cb-ai-wa-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #25d366;
  color: #fff;
  padding: 9px 16px;
  border-radius: 22px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s, transform .1s;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.cb-ai-wa-btn:hover {
  background: #1ebe5d;
  transform: translateY(-1px);
}

/* ── Input alanı ─────────────────────────────── */
#cb-ai-input-wrap {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid rgba(0,0,0,.07);
  background: var(--cb-white);
  flex-shrink: 0;
}

#cb-ai-input {
  flex: 1;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 22px;
  padding: 9px 14px;
  font-size: 13.5px;
  font-family: inherit;
  resize: none;
  outline: none;
  line-height: 1.4;
  max-height: 120px;
  overflow-y: auto;
  transition: border-color .15s;
  background: var(--cb-light);
  color: var(--cb-dark);
}

#cb-ai-input:focus { border-color: var(--cb-red); }
#cb-ai-input::placeholder { color: var(--cb-muted); }

#cb-ai-send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--cb-red);
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s, transform .1s, opacity .15s;
}

#cb-ai-send svg { width: 18px; height: 18px; }
#cb-ai-send:hover:not(:disabled) { background: #6b0000; transform: scale(1.05); }
#cb-ai-send:disabled { opacity: .35; cursor: not-allowed; }

/* ── Footer ──────────────────────────────────── */
#cb-ai-footer {
  padding: 6px 14px 8px;
  font-size: 11px;
  color: var(--cb-muted);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: var(--cb-white);
  border-top: 1px solid rgba(0,0,0,.05);
  flex-shrink: 0;
}

/* ── Açma butonu — 3D Maskot ────────────────────── */
@keyframes cb-mascot-float {
  0%,100% { transform: translateY(0) rotate(-1deg); }
  50%      { transform: translateY(-7px) rotate(1deg); }
}
@keyframes cb-mascot-glow {
  0%,100% { box-shadow: 0 6px 28px rgba(145,0,0,.5), 0 0 0 3px rgba(145,0,0,.15); }
  50%      { box-shadow: 0 10px 40px rgba(145,0,0,.7), 0 0 0 6px rgba(145,0,0,.1), 0 0 30px rgba(255,80,80,.18); }
}
@keyframes cb-platform-pulse {
  0%,100% { transform: translateX(-50%) scaleX(1); opacity:.55; }
  50%      { transform: translateX(-50%) scaleX(.85); opacity:.35; }
}

/* Temiz dairesel buton */
#cb-ai-btn {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(145deg, #910000, #6b0000);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(145,0,0,.45);
  transition: transform .18s, box-shadow .18s;
  flex-shrink: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  animation: cb-mascot-glow 2.8s ease-in-out infinite;
}

#cb-ai-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 28px rgba(145,0,0,.6);
  animation: none;
}

/* SVG ikon — AI sparkle */
#cb-ai-btn-icon {
  width: 30px;
  height: 30px;
  fill: #fff;
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px rgba(255,255,255,.35));
}

/* Maskot img — artık kullanılmıyor, gizle */
#cb-ai-mascot-img {
  display: none;
}

/* Badge */
#cb-ai-badge {
  position: absolute;
  top: 8px;
  right: 4px;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  background: #ef4444;
  border: 2.5px solid #fff;
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  z-index: 2;
  animation: cb-ai-pulse 2s infinite;
  font-family: system-ui, sans-serif;
}
