/* ═══════════════════════════════════════════════
   DOSERTECH — CHAT WIDGET
═══════════════════════════════════════════════ */

#dt-chat-bubble {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #e8520a, #c4400a);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9999;
  box-shadow: 0 4px 20px rgba(232,82,10,0.45);
  transition: transform 0.2s, box-shadow 0.2s;
}
#dt-chat-bubble:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(232,82,10,0.6);
}
#dt-chat-bubble svg { color: #fff; }

#dt-chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  background: #22c55e;
  border-radius: 50%;
  border: 2px solid #fff;
  display: none;
}
#dt-chat-badge.show { display: block; }

/* ── Chat Window ─────────────────────────────── */
#dt-chat-window {
  position: fixed;
  bottom: 100px;
  right: 28px;
  width: 360px;
  max-height: 540px;
  background: #13161e;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  z-index: 9998;
  box-shadow: 0 16px 60px rgba(0,0,0,0.5);
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}
#dt-chat-window.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* ── Header ──────────────────────────────────── */
#dt-chat-header {
  background: linear-gradient(135deg, #1a1d27, #0d0f14);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}
#dt-chat-avatar {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #e8520a, #c4400a);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  color: #fff;
  flex-shrink: 0;
}
#dt-chat-header-info { flex: 1; }
#dt-chat-header-info strong {
  display: block;
  font-size: 0.9rem;
  color: #fff;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  letter-spacing: 0.02em;
}
#dt-chat-header-info span {
  font-size: 0.72rem;
  color: #22c55e;
  display: flex;
  align-items: center;
  gap: 5px;
}
#dt-chat-header-info span::before {
  content: '';
  width: 7px;
  height: 7px;
  background: #22c55e;
  border-radius: 50%;
  display: inline-block;
}
#dt-chat-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color 0.2s;
}
#dt-chat-close:hover { color: #fff; }

/* ── Messages ────────────────────────────────── */
#dt-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}
#dt-chat-messages::-webkit-scrollbar { width: 4px; }
#dt-chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.dt-msg {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  max-width: 90%;
}
.dt-msg.bot { align-self: flex-start; }
.dt-msg.user { align-self: flex-end; flex-direction: row-reverse; }

.dt-msg-avatar {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #e8520a, #c4400a);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 0.7rem;
  color: #fff;
  flex-shrink: 0;
}
.dt-msg.user .dt-msg-avatar { background: rgba(255,255,255,0.1); }

.dt-msg-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.85rem;
  line-height: 1.55;
}
.dt-msg.bot .dt-msg-bubble {
  background: rgba(255,255,255,0.07);
  color: #d1d5db;
  border-bottom-left-radius: 4px;
}
.dt-msg.user .dt-msg-bubble {
  background: linear-gradient(135deg, #e8520a, #c4400a);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.dt-msg-bubble p { margin: 0 0 6px; }
.dt-msg-bubble p:last-child { margin-bottom: 0; }
.dt-msg-bubble ul { padding-left: 16px; margin: 4px 0; }
.dt-msg-bubble li { margin-bottom: 3px; }
.dt-msg-bubble strong { color: #fff; }

/* ── Typing indicator ────────────────────────── */
.dt-typing {
  display: flex;
  gap: 4px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.07);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  width: fit-content;
}
.dt-typing span {
  width: 7px;
  height: 7px;
  background: rgba(255,255,255,0.35);
  border-radius: 50%;
  animation: dt-bounce 1.2s infinite;
}
.dt-typing span:nth-child(2) { animation-delay: 0.2s; }
.dt-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dt-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

/* ── Input ───────────────────────────────────── */
#dt-chat-input-row {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid rgba(255,255,255,0.07);
  background: #0d0f14;
  flex-shrink: 0;
}
#dt-chat-input {
  flex: 1;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 24px;
  padding: 9px 16px;
  font-size: 0.85rem;
  color: #fff;
  outline: none;
  font-family: 'Barlow', sans-serif;
  transition: border-color 0.2s;
}
#dt-chat-input::placeholder { color: rgba(255,255,255,0.3); }
#dt-chat-input:focus { border-color: rgba(232,82,10,0.5); }

#dt-chat-send {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #e8520a, #c4400a);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s, box-shadow 0.2s;
}
#dt-chat-send:hover { transform: scale(1.08); box-shadow: 0 4px 12px rgba(232,82,10,0.4); }
#dt-chat-send svg { color: #fff; }
#dt-chat-send:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ── Popup greeting ──────────────────────────── */
#dt-chat-greeting {
  position: fixed;
  bottom: 100px;
  right: 100px;
  background: #1a1d27;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 12px 16px;
  color: #d1d5db;
  font-size: 0.85rem;
  line-height: 1.4;
  max-width: 220px;
  z-index: 9997;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
}
#dt-chat-greeting.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}
#dt-chat-greeting strong { color: #fff; display: block; margin-bottom: 4px; }
#dt-chat-greeting-close {
  position: absolute;
  top: 6px; right: 8px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.3);
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
}
#dt-chat-greeting::after {
  content: '';
  position: absolute;
  bottom: -8px;
  right: 28px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid #1a1d27;
}

/* ── Mobile ──────────────────────────────────── */
@media (max-width: 480px) {
  #dt-chat-window {
    right: 0; left: 0; bottom: 0;
    width: 100%;
    max-height: 80vh;
    border-radius: 20px 20px 0 0;
  }
  #dt-chat-bubble { bottom: 20px; right: 20px; }
  #dt-chat-greeting { right: 80px; bottom: 90px; }
}
