/* ============================================================================
   widget.css — amiral-chatbot vanilla widget (sağ-alt baloncuk).
   DESIGN.md marka-dili: koyu zemin (--bg #07060A), magenta accent, Geist/mono.
   Konumlandırma FIXED → sayfa akışına girmez, CLS=0. Tüm ölçüler token-fallback'li
   (widget bağımsız yüklenebilir; site token'ları varsa onları miras alır).
   ============================================================================ */

.cc-chat {
  --cc-bg: var(--bg, #07060A);
  --cc-panel: #12111a;
  --cc-ink: var(--ink, #f4f2f7);
  --cc-mute: #9a97a6;
  --cc-accent: var(--accent, #ff3d8a);
  --cc-accent-2: var(--accent-2, #64d8e8);
  --cc-line: rgba(255, 255, 255, .1);
  --cc-radius: 16px;
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 2147483000;
  font-family: var(--font-body, 'Geist', system-ui, -apple-system, sans-serif);
  font-size: 15px;
  line-height: 1.5;
}

/* Açma baloncuğu — fixed, boyutu sabit (layout-shift yok) */
.cc-launch {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  background: var(--cc-accent);
  color: var(--cc-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .45);
  transition: transform .15s ease;
}
.cc-launch:hover { transform: translateY(-2px); }
.cc-launch svg { width: 26px; height: 26px; display: block; }

/* Panel */
.cc-panel {
  position: absolute;
  right: 0;
  bottom: 70px;
  width: min(360px, calc(100vw - 40px));
  height: min(520px, calc(100vh - 120px));
  background: var(--cc-panel);
  color: var(--cc-ink);
  border: 1px solid var(--cc-line);
  border-radius: var(--cc-radius);
  /* Beyaz-ışın glow (İNCE varyant, founder-istek afd3f8): dış zarif hale + 1px iç
     kenar-parlaması; mevcut derinlik-gölgesi korunur. Taşma yok (shadow layout'a girmez). */
  --cc-glow: .32;
  box-shadow:
    0 0 28px rgba(255, 255, 255, var(--cc-glow)),
    inset 0 0 0 1px rgba(255, 255, 255, .14),
    0 20px 60px rgba(0, 0, 0, .55);
  display: none;
  flex-direction: column;
  overflow: hidden;
}
/* Çok-hafif "nefes" — yalnız box-shadow yoğunluğu (repaint-ucuz, JS yok);
   hareket-azalt tercihinde tamamen kapalı (statik glow kalır). */
@media (prefers-reduced-motion: no-preference) {
  .cc-chat[data-open="1"] .cc-panel { animation: cc-nefes 5s ease-in-out infinite; }
  @keyframes cc-nefes {
    0%, 100% { box-shadow: 0 0 28px rgba(255,255,255,.32), inset 0 0 0 1px rgba(255,255,255,.14), 0 20px 60px rgba(0,0,0,.55); }
    50%      { box-shadow: 0 0 34px rgba(255,255,255,.40), inset 0 0 0 1px rgba(255,255,255,.16), 0 20px 60px rgba(0,0,0,.55); }
  }
}
.cc-chat[data-open="1"] .cc-panel { display: flex; }
.cc-chat[data-open="1"] .cc-launch { display: none; }

/* P0 mobil tam-ekran sheet (5ad179): dar ekranda panel görsel-viewport'u kaplar.
   100dvh klavye açılınca KÜÇÜLÜR (100vh küçülmez — iOS taşma kökü buydu); dvh
   desteklemeyen tarayıcı bir önceki 100vh satırında kalır. Flex-düzen aynı:
   head üstte, log flex-1 scroll, form altta. Masaüstü (>480px) AYNEN. */
@media (max-width: 480px) {
  .cc-chat[data-open="1"] .cc-panel {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
    overflow-x: hidden; /* P1 60aaf0 ikincil-koruma: klavyede yatay-tasma/kirpilma olmasin */
  }
}

.cc-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--cc-line);
  display: flex;
  align-items: center;
  gap: 10px;
}
.cc-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--cc-accent-2); flex: 0 0 auto; }
.cc-head[data-off="1"] .cc-dot { background: var(--cc-mute); }
.cc-title { font-weight: 600; font-size: 14.5px; }
.cc-sub { font-size: 11.5px; color: var(--cc-mute); font-family: var(--font-mono, 'JetBrains Mono', monospace); }
.cc-close { margin-left: auto; background: 0; border: 0; color: var(--cc-mute); font-size: 22px; line-height: 1; cursor: pointer; }

.cc-log { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.cc-msg { max-width: 85%; padding: 9px 12px; border-radius: 12px; white-space: pre-wrap; word-wrap: break-word; }
.cc-msg.cc-bot { align-self: flex-start; background: rgba(255, 255, 255, .06); border: 1px solid var(--cc-line); }
.cc-msg.cc-user { align-self: flex-end; background: var(--cc-accent); color: var(--cc-bg); }
.cc-msg.cc-sys { align-self: center; color: var(--cc-mute); font-size: 12.5px; text-align: center; }

/* K3: LLM-hata fallback WhatsApp butonu (tur:'hata' mesajının altında) */
.cc-wa {
  display: inline-block;
  margin-top: 8px;
  padding: 8px 14px;
  border-radius: 10px;
  background: #25d366;
  color: #07060a;
  font-weight: 600;
  font-size: 13.5px;
  text-decoration: none;
}
.cc-wa:hover { filter: brightness(1.08); }

.cc-form { border-top: 1px solid var(--cc-line); padding: 10px; display: flex; gap: 8px; }
.cc-input {
  flex: 1; resize: none; background: rgba(255, 255, 255, .05); color: var(--cc-ink);
  border: 1px solid var(--cc-line); border-radius: 10px; padding: 9px 11px; font: inherit;
  font-size: 16px; /* P1 60aaf0: 16px-alti iOS focus-auto-zoom tetikler (efektif 15px idi) */
  max-height: 90px;
}
.cc-input:focus { outline: 2px solid var(--cc-accent); outline-offset: 0; }
.cc-input:disabled { opacity: .5; }
.cc-send {
  flex: 0 0 auto; background: var(--cc-accent); color: var(--cc-bg); border: 0;
  border-radius: 10px; padding: 0 14px; cursor: pointer; font-weight: 600;
}
.cc-send:disabled { opacity: .5; cursor: default; }

/* Honeypot alanı — ekran-dışı, erişilebilirlik-gizli */
.cc-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.cc-kvkk {
  padding: 8px 12px; font-size: 10.5px; color: var(--cc-mute);
  border-top: 1px solid var(--cc-line); text-align: center;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
}

@media (prefers-reduced-motion: reduce) {
  .cc-launch { transition: none; }
}
