/* canli-chat.css v1 — Ziyaretçi canlı destek paneli (sağdan açılır, telefonda tam ekran) */
.bcc {
  --bcc-navy: #0b1b33;
  --bcc-navy-2: #13294b;
  --bcc-red: #dc2626;
  --bcc-green: #16a34a;
  --bcc-ink: #0f172a;
  --bcc-text: #334155;
  --bcc-muted: #64748b;
  --bcc-faint: #94a3b8;
  --bcc-line: #e2e8f0;
  --bcc-bg: #f6f7f9;
  --bcc-ease: cubic-bezier(.2, .7, .2, 1);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  color: var(--bcc-text);
}
.bcc *, .bcc *::before, .bcc *::after { box-sizing: border-box; }
.bcc :focus-visible { outline: 2px solid var(--bcc-red); outline-offset: 2px; }
.bcc [hidden] { display: none !important; }

.bcc-backdrop { display: none; }
.bcc-panel {
  position: fixed; right: 20px; bottom: 20px; z-index: 1065;
  width: 390px; height: min(640px, calc(100vh - 40px));
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border: 1px solid var(--bcc-line); border-radius: 14px;
  box-shadow: 0 30px 70px -24px rgba(11, 27, 51, .45), 0 2px 6px rgba(11, 27, 51, .06);
  opacity: 0; transform: translateY(16px) scale(.98); transform-origin: bottom right; pointer-events: none;
  transition: opacity .22s var(--bcc-ease), transform .22s var(--bcc-ease);
}
.bcc:not(.is-open) .bcc-panel { visibility: hidden; transition: opacity .22s var(--bcc-ease), transform .22s var(--bcc-ease), visibility 0s linear .22s; }
.bcc.is-open .bcc-panel { opacity: 1; transform: none; pointer-events: auto; visibility: visible; }

/* Başlık */
.bcc-head { flex-shrink: 0; display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; background: var(--bcc-navy); color: #fff; }
.bcc-avatar { position: relative; width: 40px; height: 40px; flex-shrink: 0; border-radius: 10px; display: grid; place-items: center; background: #fff; overflow: hidden; }
.bcc-avatar img { width: 30px; height: auto; }
.bcc-avatar i { position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--bcc-navy); background: var(--bcc-faint); }
.bcc.is-online .bcc-avatar i { background: #22c55e; }
.bcc-head__txt { flex: 1; min-width: 0; }
.bcc-head__txt strong { display: block; font-family: Outfit, 'Plus Jakarta Sans', sans-serif; font-size: 1.02rem; font-weight: 700; letter-spacing: -.01em; }
.bcc-head__txt span { display: block; font-size: .78rem; color: #b6c2d6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bcc-hbtn {
  width: 34px; height: 34px; flex-shrink: 0; border: 0; border-radius: 8px; cursor: pointer;
  display: grid; place-items: center; background: transparent; color: #cbd5e1; font-size: 1.05rem;
}
.bcc-hbtn:hover { background: rgba(255, 255, 255, .1); color: #fff; }

.bcc-body { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--bcc-bg); }

/* Başlangıç formu */
.bcc-start { flex: 1; overflow-y: auto; padding: 20px 18px 18px; }
.bcc-start h3 { margin: 0 0 4px; font-family: Outfit, 'Plus Jakarta Sans', sans-serif; font-size: 1.25rem; font-weight: 800; letter-spacing: -.02em; color: var(--bcc-navy); }
.bcc-start > p { margin: 0 0 16px; font-size: .88rem; line-height: 1.55; color: var(--bcc-muted); }
.bcc-status { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; padding: 10px 12px; border-radius: 9px; background: #fff; border: 1px solid var(--bcc-line); font-size: .84rem; }
.bcc-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--bcc-faint); flex-shrink: 0; }
.bcc.is-online .bcc-status i { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .18); }
.bcc-field { margin-bottom: 12px; }
.bcc-field label { display: block; margin-bottom: 5px; font-size: .8rem; font-weight: 700; color: var(--bcc-ink); }
.bcc-field label em { font-style: normal; color: var(--bcc-red); }
.bcc-field input, .bcc-field textarea {
  width: 100%; padding: 11px 12px; border: 1px solid #cbd5e1; border-radius: 9px; background: #fff;
  font: inherit; font-size: .92rem; color: var(--bcc-ink);
  transition: border-color .15s, box-shadow .15s;
}
.bcc-field textarea { min-height: 76px; resize: vertical; line-height: 1.5; }
.bcc-field input:focus, .bcc-field textarea:focus { outline: none; border-color: var(--bcc-navy); box-shadow: 0 0 0 3px rgba(11, 27, 51, .1); }
.bcc-field.is-err input { border-color: var(--bcc-red); }
.bcc-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
.bcc-err { margin: 0 0 12px; padding: 9px 11px; border-radius: 8px; background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; font-size: .84rem; }
.bcc-btn {
  width: 100%; height: 46px; border: 0; border-radius: 9px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--bcc-red); color: #fff; font: inherit; font-size: .95rem; font-weight: 800;
  transition: background .15s;
}
.bcc-btn:hover { background: #b91c1c; }
.bcc-btn[disabled] { opacity: .65; cursor: default; }
.bcc-btn--ghost { background: #fff; color: var(--bcc-navy); border: 1px solid #cbd5e1; }
.bcc-btn--ghost:hover { background: #fff; border-color: var(--bcc-navy); }
.bcc-note { margin: 12px 0 0; font-size: .74rem; line-height: 1.5; color: var(--bcc-faint); }
.bcc-alt { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--bcc-line); font-size: .84rem; color: var(--bcc-muted); }
.bcc-alt a, .bcc-alt button { color: var(--bcc-navy); font-weight: 700; text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer; font: inherit; border-bottom: 1px solid var(--bcc-red); }

/* Mesajlar */
.bcc-thread { position: relative; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 14px 8px; display: flex; flex-direction: column; gap: 6px; }
.bcc-day { align-self: center; margin: 6px 0 2px; padding: 2px 9px; border-radius: 6px; background: #fff; border: 1px solid var(--bcc-line); font-size: .7rem; font-weight: 700; color: var(--bcc-muted); }
.bcc-msg {
  position: relative; max-width: 82%; padding: 9px 12px 6px; border-radius: 12px;
  font-size: .9rem; line-height: 1.5; word-break: break-word; white-space: pre-wrap;
  animation: bccIn .2s var(--bcc-ease);
}
.bcc-msg--admin { align-self: flex-start; background: #fff; border: 1px solid var(--bcc-line); color: var(--bcc-ink); border-bottom-left-radius: 4px; }
.bcc-msg--ziyaretci { align-self: flex-end; background: var(--bcc-navy); color: #fff; border-bottom-right-radius: 4px; }
.bcc-msg--sistem { align-self: center; max-width: 92%; padding: 6px 11px; background: #eef2f8; color: #13294b; font-size: .78rem; text-align: center; border-radius: 8px; }
.bcc-msg__who { display: block; margin-bottom: 1px; font-size: .72rem; font-weight: 700; color: var(--bcc-red); white-space: normal; }
.bcc-msg__meta { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 2px; font-size: .68rem; white-space: normal; color: var(--bcc-faint); }
.bcc-msg--ziyaretci .bcc-msg__meta { color: rgba(255, 255, 255, .6); }
.bcc-msg--ziyaretci .bcc-msg__meta .is-read { color: #7dd3fc; }
.bcc-msg a { color: inherit; text-decoration: underline; }
.bcc-msg img { display: block; max-width: 100%; max-height: 220px; margin: 2px 0 4px; border-radius: 8px; cursor: zoom-in; }
.bcc-msg.is-pending { opacity: .6; }
.bcc-typing { align-self: flex-start; display: none; gap: 4px; padding: 11px 13px; border-radius: 12px; background: #fff; border: 1px solid var(--bcc-line); }
.bcc-typing.is-on { display: inline-flex; }
.bcc-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--bcc-faint); animation: bccDot 1.2s infinite; }
.bcc-typing span:nth-child(2) { animation-delay: .15s; }
.bcc-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes bccDot { 0%, 60%, 100% { transform: none; opacity: .5; } 30% { transform: translateY(-3px); opacity: 1; } }
@keyframes bccIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Yazma alanı */
.bcc-compose { flex-shrink: 0; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--bcc-line); }
.bcc-compose.is-drag textarea { border-color: var(--bcc-navy); border-style: dashed; }
.bcc-file { display: none; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; padding: 6px 8px; border-radius: 8px; background: #eef2f8; font-size: .8rem; }
.bcc-file.is-on { display: flex; }
.bcc-file span { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; color: var(--bcc-ink); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.bcc-file img { width: 30px; height: 30px; object-fit: cover; border-radius: 5px; }
.bcc-row { display: flex; align-items: flex-end; gap: 6px; }
.bcc-row textarea {
  flex: 1; min-height: 42px; max-height: 120px; padding: 10px 12px; resize: none;
  border: 1px solid #cbd5e1; border-radius: 10px; font: inherit; font-size: .92rem; line-height: 1.45; color: var(--bcc-ink); background: #fff;
}
.bcc-row textarea:focus { outline: none; border-color: var(--bcc-navy); box-shadow: 0 0 0 3px rgba(11, 27, 51, .1); }
.bcc-ibtn {
  width: 42px; height: 42px; flex-shrink: 0; border-radius: 10px; cursor: pointer;
  display: grid; place-items: center; border: 1px solid var(--bcc-line); background: #fff; color: var(--bcc-muted); font-size: 1.05rem;
}
.bcc-ibtn:hover { color: var(--bcc-ink); border-color: #cbd5e1; }
.bcc-ibtn--send { background: var(--bcc-red); border-color: var(--bcc-red); color: #fff; }
.bcc-ibtn--send:hover { background: #b91c1c; color: #fff; }
.bcc-ibtn--send[disabled] { opacity: .45; cursor: default; }
.bcc-powered { margin-top: 6px; text-align: center; font-size: .68rem; color: var(--bcc-faint); }

/* Sohbet bitti */
.bcc-end { flex-shrink: 0; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--bcc-line); text-align: center; }
.bcc-end p { margin: 0 0 8px; font-size: .86rem; color: var(--bcc-muted); }
.bcc-stars { display: inline-flex; gap: 4px; margin-bottom: 12px; }
.bcc-stars button { border: 0; background: none; cursor: pointer; padding: 2px; font-size: 1.5rem; color: #cbd5e1; transition: color .1s, transform .1s; }
.bcc-stars button.is-on, .bcc-stars button:hover { color: #f59e0b; }
.bcc-stars button:hover { transform: scale(1.1); }
.bcc-stars.is-done button { pointer-events: none; }

/* Menü */
.bcc-menu { position: absolute; top: 60px; right: 12px; z-index: 3; min-width: 200px; padding: 6px; border-radius: 10px; background: #fff; border: 1px solid var(--bcc-line); box-shadow: 0 16px 36px -14px rgba(11, 27, 51, .35); }
.bcc-menu button, .bcc-menu a { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 10px; border: 0; border-radius: 7px; background: none; cursor: pointer; font: inherit; font-size: .86rem; color: var(--bcc-ink); text-decoration: none; text-align: left; }
.bcc-menu button:hover, .bcc-menu a:hover { background: var(--bcc-bg); color: var(--bcc-ink); }
.bcc-menu .is-danger { color: var(--bcc-red); }

.bcc-lightbox { position: fixed; inset: 0; z-index: 1080; display: none; align-items: center; justify-content: center; padding: 20px; background: rgba(11, 27, 51, .88); cursor: zoom-out; }
.bcc-lightbox.is-on { display: flex; }
.bcc-lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }

/* Buton üzerindeki okunmamış rozeti */
.bcc-badge {
  position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 6px;
  display: inline-grid; place-items: center; border-radius: 10px; border: 2px solid #fff;
  background: var(--bcc-red, #dc2626); color: #fff; font-size: .7rem; font-weight: 800; line-height: 1;
}
.bcc-fab-online { display: inline-block; width: 8px; height: 8px; margin-right: 2px; border-radius: 50%; background: #94a3b8; }
.bcc-fab-online.is-on { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .2); }

@media (max-width: 640px) {
  .bcc-backdrop { position: fixed; inset: 0; z-index: 1064; background: rgba(11, 27, 51, .4); }
  .bcc.is-open .bcc-backdrop { display: block; }
  .bcc-panel { inset: 0; right: 0; bottom: 0; width: 100%; height: 100%; height: 100dvh; border: 0; border-radius: 0; transform: translateY(24px); }
  .bcc-head { padding-top: calc(12px + env(safe-area-inset-top)); }
  .bcc-msg { max-width: 88%; }
  html.bcc-lock, html.bcc-lock body { overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) {
  .bcc-panel, .bcc-msg, .bcc-typing span { transition: none; animation: none; }
}
