/* 0DATA Live Chat Widget — Dark Biotech Design DNA */
:root {
  --zd-bg: #050a10;
  --zd-cyan: #7eb8da;
  --zd-cyan-dim: rgba(126,184,218,.12);
  --zd-cyan-glow: rgba(126,184,218,.06);
  --zd-gold: #d4b896;
  --zd-mono: 'SF Mono', 'Courier New', monospace;
  --zd-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --zd-radius: 13px;
}

/* FAB */
#zd-fab {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  width: 54px; height: 54px; border-radius: 50%;
  background: rgba(10,18,28,.75); backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(126,184,218,.18);
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(0,0,0,.5), 0 0 20px var(--zd-cyan-glow);
  transition: transform .2s ease, box-shadow .2s ease;
  display: flex; align-items: center; justify-content: center;
}
#zd-fab:hover { transform: scale(1.05); box-shadow: 0 4px 32px rgba(0,0,0,.6), 0 0 30px rgba(126,184,218,.12); }
#zd-fab svg { width: 22px; height: 22px; }

/* Pulse ring when agent online */
#zd-fab.online::after {
  content: ''; position: absolute; inset: -4px; border-radius: 50%;
  border: 1px solid var(--zd-cyan); opacity: .35;
  animation: zd-pulse 2.2s ease-in-out infinite;
}
@keyframes zd-pulse {
  0%, 100% { transform: scale(1); opacity: .35; }
  50% { transform: scale(1.12); opacity: .08; }
}

/* Panel */
#zd-panel {
  position: fixed; bottom: 90px; right: 24px; z-index: 9999;
  width: 370px; max-width: calc(100vw - 28px); height: 520px;
  max-height: calc(100vh - 140px);
  background: rgba(5,10,16,.88); backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid rgba(126,184,218,.10);
  border-radius: var(--zd-radius);
  display: none; flex-direction: column; overflow: hidden;
  font-family: var(--zd-sans);
  box-shadow: 0 8px 48px rgba(0,0,0,.6), 0 0 40px rgba(126,184,218,.05);
}
#zd-panel.open { display: flex; }

/* Header */
#zd-header {
  padding: 10px 16px;
  font-family: var(--zd-mono); font-size: 10px; letter-spacing: 2.2px;
  color: var(--zd-cyan); text-transform: uppercase;
  border-bottom: 1px solid rgba(126,184,218,.06);
  display: flex; justify-content: space-between; align-items: center;
  flex-shrink: 0;
}
#zd-status { font-size: 9px; opacity: .6; }
#zd-status.queue { color: var(--zd-gold); }

/* Messages area */
#zd-messages {
  flex: 1; overflow-y: auto; padding: 14px 12px;
  display: flex; flex-direction: column; gap: 2px;
  scroll-behavior: smooth;
}
#zd-messages::-webkit-scrollbar { width: 3px; }
#zd-messages::-webkit-scrollbar-thumb { background: rgba(126,184,218,.1); border-radius: 3px; }

/* Empty state */
#zd-empty {
  flex: 1; display: flex; align-items: center; justify-content: center;
  font-family: var(--zd-mono); font-size: 10px; letter-spacing: 1.5px;
  color: rgba(126,184,218,.25); text-transform: uppercase;
}

/* Messages */
.zd-msg {
  max-width: 82%; padding: 8px 12px; border-radius: 10px;
  font-size: 13.5px; line-height: 1.5; word-break: break-word;
  animation: zd-fadein .25s ease;
}
@keyframes zd-fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.zd-msg.visitor {
  align-self: flex-end;
  background: rgba(126,184,218,.10);
  border: 1px solid rgba(126,184,218,.18);
  color: #d5e6f2;
  border-bottom-right-radius: 3px;
}
.zd-msg.agent {
  align-self: flex-start;
  background: rgba(255,255,255,.025);
  border: 1px solid rgba(255,255,255,.06);
  color: #bcc8d4;
  border-bottom-left-radius: 3px;
}
.zd-msg .zd-ts {
  display: block; font-family: var(--zd-mono); font-size: 8.5px;
  opacity: .35; margin-top: 4px;
}

/* System messages */
.zd-sys {
  align-self: center; font-family: var(--zd-mono); font-size: 9.5px;
  letter-spacing: 1px; color: rgba(126,184,218,.35);
  padding: 6px 0; text-transform: uppercase;
}

/* Typing indicator */
#zd-typing {
  font-size: 11px; color: rgba(126,184,218,.35); padding: 4px 14px;
  font-style: italic; display: none; flex-shrink: 0;
}
#zd-typing.show { display: block; }

/* Input bar */
#zd-inputbar {
  display: flex; gap: 8px; padding: 10px 12px;
  border-top: 1px solid rgba(126,184,218,.06);
  flex-shrink: 0;
}
#zd-input {
  flex: 1; background: rgba(255,255,255,.03);
  border: 1px solid rgba(126,184,218,.10);
  border-radius: 8px; padding: 8px 12px;
  color: #c0c8d4; font-size: 13.5px; font-family: var(--zd-sans);
  outline: none; transition: border-color .2s;
}
#zd-input:focus { border-color: rgba(126,184,218,.25); }
#zd-input::placeholder { color: rgba(126,184,218,.2); }

#zd-send {
  width: 38px; height: 38px; border-radius: 8px;
  background: rgba(126,184,218,.08); border: 1px solid rgba(126,184,218,.15);
  color: var(--zd-cyan); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s; flex-shrink: 0;
}
#zd-send:hover { background: rgba(126,184,218,.16); }
#zd-send svg { width: 16px; height: 16px; }

/* Email Gate (Niveau 1) */
#zd-gate {
  padding: 16px 12px; text-align: center; flex-shrink: 0;
}
#zd-gate p {
  font-size: 11px; color: rgba(126,184,218,.45); margin: 0 0 10px;
  font-family: var(--zd-mono); letter-spacing: 1px; text-transform: uppercase;
}
#zd-email-input, #zd-name-input, #zd-phone-input {
  display: block; width: calc(100% - 24px); margin: 0 auto 8px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(126,184,218,.10);
  border-radius: 8px; padding: 9px 12px;
  color: #c0c8d4; font-size: 13px; font-family: var(--zd-sans);
  outline: none; text-align: center; transition: border-color .2s;
}
#zd-email-input:focus, #zd-name-input:focus, #zd-phone-input:focus { border-color: rgba(126,184,218,.30); }
#zd-email-input::placeholder, #zd-name-input::placeholder, #zd-phone-input::placeholder { color: rgba(126,184,218,.15); }

#zd-gate-submit {
  width: calc(100% - 24px); padding: 10px;
  background: rgba(126,184,218,.10); border: 1px solid var(--zd-cyan);
  border-radius: 8px; color: var(--zd-cyan);
  font-family: var(--zd-mono); font-size: 10px; letter-spacing: 1.5px;
  cursor: pointer; transition: background .2s; margin-top: 4px;
}
#zd-gate-submit:hover { background: rgba(126,184,218,.20); }

/* Escalade bar */
#zd-escalate-bar {
  padding: 6px 12px; flex-shrink: 0;
  border-top: 1px solid rgba(126,184,218,.06);
}
#zd-escalate-btn {
  width: 100%; padding: 8px;
  background: rgba(212,184,150,.06); border: 1px solid rgba(212,184,150,.20);
  border-radius: 6px; color: var(--zd-gold);
  font-family: var(--zd-mono); font-size: 9px; letter-spacing: 1.2px;
  cursor: pointer; transition: all .2s;
}
#zd-escalate-btn:hover { background: rgba(212,184,150,.14); border-color: var(--zd-gold); }

/* Bot/agent message labels */
.zd-msg-label {
  display: block; font-family: var(--zd-mono); font-size: 7.5px;
  letter-spacing: 1px; margin-bottom: 2px;
}
.zd-msg.bot .zd-msg-label { color: rgba(126,184,218,.45); }
.zd-msg.agent .zd-msg-label { color: rgba(212,184,150,.55); }

/* Bot message styling */
.zd-msg.bot {
  align-self: flex-start;
  background: rgba(126,184,218,.04);
  border: 1px solid rgba(126,184,218,.12);
  color: #bcc8d4;
  border-bottom-left-radius: 3px;
}
.zd-msg.agent {
  align-self: flex-start;
  background: rgba(255,255,255,.025);
  border: 1px solid rgba(255,255,255,.06);
  color: #bcc8d4;
  border-bottom-left-radius: 3px;
}

/* Status: human mode */
#zd-status.human { color: var(--zd-gold); }

/* Legacy name prompt (hide, now unused) */
#zd-name-prompt { display: none; }

/* Call actions bar */
#zd-call-actions {
  display: none;
  gap: 8px; padding: 0 12px 8px;
  flex-shrink: 0;
}
#zd-call-actions.show { display: flex; }
.zd-call-btn {
  flex: 1; padding: 10px 0;
  background: rgba(126,184,218,.06);
  border: 1px solid rgba(126,184,218,.15);
  border-radius: 8px;
  color: var(--zd-cyan); font-family: var(--zd-mono);
  font-size: 10px; letter-spacing: 1.2px;
  cursor: pointer; text-transform: uppercase;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: background .2s, border-color .2s, box-shadow .2s;
}
.zd-call-btn:hover {
  background: rgba(126,184,218,.14);
  border-color: rgba(126,184,218,.30);
  box-shadow: 0 0 16px rgba(126,184,218,.08);
}
.zd-call-btn svg { width: 15px; height: 15px; stroke: var(--zd-cyan); }

/* Booking widget */
#zd-booking {
  display: none; flex-shrink: 0;
  padding: 0 12px 8px;
  border-top: 1px solid rgba(126,184,218,.06);
}
#zd-booking.show { display: block; }
.zd-booking-header {
  font-family: var(--zd-mono); font-size: 9px; letter-spacing: 1.8px;
  color: var(--zd-cyan); text-transform: uppercase; text-align: center;
  padding: 10px 0 6px;
}
.zd-booking-steps { display: flex; align-items: center; justify-content: center; gap: 0; padding: 4px 0 12px; }
.zd-step-dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(126,184,218,.10); border: 1px solid rgba(126,184,218,.18); transition: all .3s; }
.zd-step-dot.active { background: var(--zd-cyan); border-color: var(--zd-cyan); box-shadow: 0 0 12px rgba(126,184,218,.25); }
.zd-step-dot.done { background: rgba(126,184,218,.30); border-color: rgba(126,184,218,.40); }
.zd-step-line { width: 28px; height: 1px; background: rgba(126,184,218,.10); }
.zd-slot-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.zd-day-label { width: 100%; font-family: var(--zd-mono); font-size: 9px; color: rgba(126,184,218,.35); text-transform: uppercase; letter-spacing: 1px; padding: 6px 0 2px; }
.zd-slot-btn {
  padding: 6px 10px; font-size: 11px;
  background: rgba(126,184,218,.05); border: 1px solid rgba(126,184,218,.10);
  border-radius: 6px; color: rgba(126,184,218,.5); cursor: pointer;
  font-family: var(--zd-mono); transition: all .2s;
}
.zd-slot-btn:not(:disabled):hover { border-color: var(--zd-cyan); color: var(--zd-cyan); }
.zd-slot-btn:disabled { opacity: .2; cursor: default; }
.zd-slot-btn.selected { background: rgba(126,184,218,.15); border-color: var(--zd-cyan); color: var(--zd-cyan); }
.zd-booking-input { width: calc(100% - 24px); padding: 8px 12px; background: rgba(255,255,255,.03); border: 1px solid rgba(126,184,218,.10); border-radius: 8px; color: #c0c8d4; font-size: 13px; outline: none; margin: 8px 0; }
.zd-booking-input:focus { border-color: var(--zd-cyan); }
.zd-booking-cta { width: 100%; padding: 10px; background: rgba(126,184,218,.10); border: 1px solid var(--zd-cyan); border-radius: 8px; color: var(--zd-cyan); font-family: var(--zd-mono); font-size: 10px; letter-spacing: 1.5px; cursor: pointer; margin-top: 8px; transition: background .2s; }
.zd-booking-cta:hover { background: rgba(126,184,218,.20); }
.zd-booking-confirm { text-align: center; }
.zd-confirm-icon { margin: 12px auto; width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(74,224,160,.25); display: flex; align-items: center; justify-content: center; }
.zd-confirm-icon svg { width: 24px; height: 24px; stroke: #4AE0A0; }
.zd-confirm-slot { font-family: var(--zd-mono); font-size: 11px; color: var(--zd-cyan); padding: 4px 0; }
.zd-confirm-note { font-size: 11px; color: rgba(126,184,218,.35); padding: 8px 0 4px; }

/* Mobile */
@media(max-width:480px) {
  #zd-panel { width: calc(100vw - 16px); right: 8px; bottom: 78px; height: 460px; }
  #zd-fab { bottom: 16px; right: 16px; width: 48px; height: 48px; }
}
