/* DSH Dakdekkers — Chatbot Widget
   Primary: #F97316 (oranje) · Header: #1C274C (donker) */

/* ── FAB ─────────────────────────────────────────────── */
.dsh-chat-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9100;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #F97316;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 24px rgba(249,115,22,.45);
  transition: transform .18s, box-shadow .18s;
}
.dsh-chat-fab:hover {
  transform: scale(1.07);
  box-shadow: 0 10px 32px rgba(249,115,22,.55);
}
.dsh-chat-fab:active {
  transform: scale(.95);
}

/* badge "1" */
.dsh-chat-fab::after {
  content: '1';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  font-family: 'Poppins', system-ui, sans-serif;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 20px;
  text-align: center;
  border: 2px solid #fff;
  transition: opacity .2s, transform .2s;
}
.dsh-chat-fab.opened::after {
  opacity: 0;
  transform: scale(0);
  pointer-events: none;
}

/* pulse ring */
.dsh-chat-fab .pulse-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 3px solid #F97316;
  opacity: 0;
  animation: dsh-pulse 2.4s ease-out infinite;
}
.dsh-chat-fab .pulse-ring::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid #F97316;
  opacity: 0;
  animation: dsh-pulse 2.4s ease-out .7s infinite;
}
@keyframes dsh-pulse {
  0%   { opacity: .8; transform: scale(1); }
  100% { opacity: 0;  transform: scale(1.75); }
}
.dsh-chat-fab.opened .pulse-ring,
.dsh-chat-fab.opened .pulse-ring::after {
  animation: none;
  opacity: 0;
}

/* ── PANEL ───────────────────────────────────────────── */
.dsh-chat-panel {
  position: fixed;
  bottom: 100px;
  right: 28px;
  z-index: 9099;
  width: 380px;
  height: 520px;
  background: #fff;
  border-radius: 18px 18px 4px 18px;
  box-shadow: 0 20px 60px rgba(28,39,76,.18), 0 4px 16px rgba(28,39,76,.10);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(110%) scale(.95);
  opacity: 0;
  pointer-events: none;
  transition: transform .28s cubic-bezier(.34,1.36,.64,1), opacity .22s ease;
}
.dsh-chat-panel.open {
  transform: none;
  opacity: 1;
  pointer-events: auto;
}

/* ── HEADER ──────────────────────────────────────────── */
.dsh-chat-header {
  background: linear-gradient(135deg, #1C274C 0%, #2c3f73 100%);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  font-family: 'Poppins', system-ui, sans-serif;
}
.dsh-chat-header strong {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .1px;
}

/* ── MESSAGES ────────────────────────────────────────── */
.dsh-chat-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}
.dsh-chat-msgs::-webkit-scrollbar { width: 4px; }
.dsh-chat-msgs::-webkit-scrollbar-track { background: transparent; }
.dsh-chat-msgs::-webkit-scrollbar-thumb { background: #e0e4ef; border-radius: 4px; }

/* ── BUBBLES ─────────────────────────────────────────── */
.dsh-chat-msg {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.55;
  font-family: 'Poppins', system-ui, sans-serif;
  animation: dsh-bubble-in .18s ease;
}
@keyframes dsh-bubble-in {
  from { opacity: 0; transform: translateY(6px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
.dsh-chat-msg.bot {
  background: #fff;
  color: #1a2340;
  box-shadow: 0 2px 10px rgba(28,39,76,.09);
  border-radius: 4px 16px 16px 16px;
  align-self: flex-start;
}
.dsh-chat-msg.usr {
  background: #F97316;
  color: #fff;
  border-radius: 16px 4px 16px 16px;
  align-self: flex-end;
  box-shadow: 0 3px 12px rgba(249,115,22,.3);
}
.dsh-chat-msg strong {
  font-weight: 700;
}

/* ── ACTION BUTTONS ──────────────────────────────────── */
.dsh-chat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 2px 14px 10px;
  flex-shrink: 0;
}
.dsh-chat-action-btn {
  background: #fff;
  color: #F97316;
  border: 1.5px solid #F97316;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 600;
  font-family: 'Poppins', system-ui, sans-serif;
  cursor: pointer;
  transition: background .14s, color .14s, transform .1s;
  white-space: nowrap;
}
.dsh-chat-action-btn:hover {
  background: #F97316;
  color: #fff;
  transform: translateY(-1px);
}
.dsh-chat-action-btn:active {
  transform: scale(.96);
}
.dsh-chat-action-btn.primary {
  background: #F97316;
  color: #fff;
}
.dsh-chat-action-btn.primary:hover {
  background: #ea6c0a;
}

/* ── TYPING INDICATOR ────────────────────────────────── */
.dsh-chat-typing {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 10px 14px;
  background: #fff;
  border-radius: 4px 16px 16px 16px;
  box-shadow: 0 2px 10px rgba(28,39,76,.09);
  align-self: flex-start;
  width: fit-content;
}
.dsh-chat-typing span {
  width: 7px;
  height: 7px;
  background: #c8cede;
  border-radius: 50%;
  display: inline-block;
  animation: dsh-dot 1.2s ease-in-out infinite;
}
.dsh-chat-typing span:nth-child(2) { animation-delay: .2s; }
.dsh-chat-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes dsh-dot {
  0%, 80%, 100% { transform: scale(.7); opacity: .5; }
  40%           { transform: scale(1);  opacity: 1; }
}

/* ── INPUT BAR ───────────────────────────────────────── */
.dsh-chat-input {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 14px 14px;
  border-top: 2px solid #eef0f4;
  background: #f9fafb;
  flex-shrink: 0;
}
.dsh-chat-input textarea {
  flex: 1;
  border: 2px solid #d1d9ef;
  border-radius: 14px;
  padding: 11px 14px;
  font-size: 14px;
  font-family: 'Poppins', system-ui, sans-serif;
  resize: none;
  outline: none;
  line-height: 1.5;
  transition: border-color .15s, box-shadow .15s;
  background: #fff;
  min-height: 46px;
  max-height: 100px;
  overflow-y: auto;
  color: #1a2340;
}
.dsh-chat-input textarea:focus {
  border-color: #F97316;
  box-shadow: 0 0 0 3px rgba(249,115,22,.12);
}
.dsh-chat-input textarea::placeholder {
  color: #9aa3bb;
}
.dsh-chat-input button#dshChatSend {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #F97316;
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .14s, transform .1s;
  box-shadow: 0 2px 8px rgba(249,115,22,.35);
}
.dsh-chat-input button#dshChatSend:hover { background: #ea6c0a; transform: scale(1.06); }
.dsh-chat-input button#dshChatSend:active { transform: scale(.93); }

/* Mic button */
.dsh-mic-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f3f4f6;
  color: #6b7280;
  border: 1.5px solid #e0e4ef;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all .15s;
}
.dsh-mic-btn:hover { background: #fff7ed; color: #F97316; border-color: #F97316; }
.dsh-mic-btn.recording {
  background: #fee2e2;
  color: #dc2626;
  border-color: #dc2626;
  animation: micPulse 1s ease-in-out infinite;
}
@keyframes micPulse { 0%,100%{box-shadow:0 0 0 0 rgba(220,38,38,.4)} 50%{box-shadow:0 0 0 6px rgba(220,38,38,0)} }

/* ── MOBILE ──────────────────────────────────────────── */
@media (max-width: 540px) {
  .dsh-chat-panel {
    right: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 92vh;
    border-radius: 18px 18px 0 0;
    max-height: 92vh;
  }
  .dsh-chat-fab {
    right: 16px;
    bottom: 18px;
  }
  .dsh-chat-input textarea {
    font-size: 16px; /* prevent iOS zoom on focus */
    min-height: 50px;
    padding: 13px 14px;
  }
  .dsh-chat-input {
    padding: 12px 12px 16px;
  }
  .dsh-chat-msg {
    max-width: 94%;
  }
}
