/* Canlı Destek widget + video lightbox */

.cd-widget {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 9990;
  font-family: inherit;
}

.cd-bubble {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  color: #fff;
  background: var(--cd-primary, #2563eb);
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.35);
  display: grid;
  place-items: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cd-bubble:hover {
  transform: scale(1.05);
}

.cd-bubble svg { width: 28px; height: 28px; fill: currentColor; }

.cd-panel {
  position: absolute;
  right: 0;
  bottom: 74px;
  width: min(380px, calc(100vw - 28px));
  height: min(560px, calc(100vh - 120px));
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.22);
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

.cd-widget.is-open .cd-panel { display: flex; }

.cd-header {
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--cd-primary, #2563eb), #1d4ed8);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.cd-header strong { display: block; font-size: 15px; }
.cd-header span { display: block; font-size: 12px; opacity: 0.9; }
.cd-header-close {
  margin-left: auto;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}

.cd-body {
  flex: 1;
  overflow: auto;
  padding: 14px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cd-msg {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.cd-msg.user {
  align-self: flex-end;
  background: var(--cd-primary, #2563eb);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.cd-msg.admin {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 4px;
}

.cd-msg.system {
  align-self: center;
  background: #eef2ff;
  color: #3730a3;
  font-size: 12.5px;
  max-width: 95%;
}

.cd-msg .cd-meta {
  display: block;
  font-size: 10.5px;
  opacity: 0.75;
  margin-bottom: 4px;
  font-weight: 700;
}

.cd-video-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  cursor: pointer;
  font-weight: 700;
  font-size: 12.5px;
}

.cd-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.cd-quick button {
  border: 1px solid #cbd5e1;
  background: #fff;
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 12.5px;
  cursor: pointer;
  color: #334155;
}

.cd-quick button:hover {
  border-color: var(--cd-primary, #2563eb);
  color: var(--cd-primary, #2563eb);
}

.cd-guest-form,
.cd-offline-form {
  display: grid;
  gap: 8px;
}

.cd-guest-form input,
.cd-offline-form input,
.cd-offline-form textarea,
.cd-composer textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 9px 11px;
  font: inherit;
  font-size: 13.5px;
  background: #fff;
}

.cd-composer {
  border-top: 1px solid #e2e8f0;
  padding: 10px;
  background: #fff;
  display: grid;
  gap: 8px;
}

.cd-composer-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.cd-composer textarea {
  min-height: 42px;
  max-height: 110px;
  resize: vertical;
}

.cd-send {
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  background: var(--cd-primary, #2563eb);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.cd-typing {
  font-size: 12px;
  color: #64748b;
  font-style: italic;
  min-height: 16px;
}

.cd-notice {
  padding: 10px 12px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 12px;
  color: #9a3412;
  font-size: 13px;
  line-height: 1.45;
}

/* Video lightbox — taşınabilir / boyutlandırılabilir */
.cd-vlb {
  position: fixed;
  z-index: 10020;
  min-width: 320px;
  min-height: 220px;
  width: 520px;
  height: 360px;
  background: #0f172a;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.45);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.12);
}

.cd-vlb[hidden] { display: none !important; }

.cd-vlb-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #1e293b;
  color: #fff;
  cursor: move;
  user-select: none;
}

.cd-vlb-head strong {
  flex: 1;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cd-vlb-head button {
  border: none;
  background: rgba(255,255,255,0.08);
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  cursor: pointer;
}

.cd-vlb-body {
  flex: 1;
  background: #000;
  position: relative;
  min-height: 0;
}

.cd-vlb-body video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.cd-vlb-resize {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 18px;
  height: 18px;
  cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 50%, rgba(255,255,255,0.35) 50%);
}

.cd-vlb.is-min {
  height: 48px !important;
  width: 280px !important;
  min-height: 48px;
}

.cd-vlb.is-min .cd-vlb-body { display: none; }
