/* ==========================================================================
   Drop Cars AI Assistant - Premium Floating Knowledge Chatbot Widget
   Positioned on Bottom-Right Stacked below WhatsApp & Call buttons
   ========================================================================== */

/* ── Floating Widget Trigger Button (Bottom-Right, Below WhatsApp & Call) ── */
/* Mobile soft-keyboard open or Location Picker dropdown active: hide the AI
   trigger too, matching whatsapp.css's .wa-btn-row/.wa-widget-container
   behavior, so it doesn't sit on top of dropdown suggestions or the
   on-screen keyboard. Was previously missing here, so this button alone
   stayed visible and overlapped the location autocomplete dropdown. */
html.dc-keyboard-open #dc-ai-trigger,
html.dc-dropdown-active #dc-ai-trigger {
  display: none !important;
}

#dc-ai-trigger {
  position: fixed;
  bottom: 1.2rem;
  right: 1.5rem;
  z-index: 99999;
  width: 58px;
  height: 58px;
  padding: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #d946ef 100%);
  color: #ffffff;
  border: none;
  box-shadow: 0 6px 22px rgba(124, 58, 237, 0.45);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  user-select: none;
}

#dc-ai-trigger span {
  display: none !important;
}

body:has(.wa-widget-container) #dc-ai-trigger,
body:has(.wa-ai-btn) #dc-ai-trigger,
.wa-widget-container ~ #dc-ai-trigger {
  display: none !important;
}

#dc-ai-trigger:hover {
  transform: scale(1.1) translateY(-3px);
  box-shadow: 0 10px 28px rgba(124, 58, 237, 0.65);
}

#dc-ai-trigger:active {
  transform: translateY(0) scale(0.98);
}

.dc-ai-trigger-icon {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  animation: dcPulseBot 2.5s infinite ease-in-out;
}

.dc-ai-badge {
  position: absolute;
  top: -3px;
  right: -2px;
  width: 11px;
  height: 11px;
  background: #10b981;
  border: 2px solid #ffffff;
  border-radius: 50%;
}

@keyframes dcPulseBot {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

/* ── Chat Modal Window (Bottom-Right) ── */
/* ── Chat Modal Window (Bottom-Right) ── */
#dc-ai-window {
  position: fixed;
  bottom: 4.2rem;
  right: 1.2rem;
  width: 330px;
  max-width: calc(100vw - 28px);
  height: 460px;
  max-height: calc(100vh - 100px);
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(0, 0, 0, 0.06);
  z-index: 999999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(20px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: bottom right;
}

#dc-ai-window.dc-ai-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto !important;
  transform: translateY(0) scale(1);
}

/* Dark Mode Modal Overlay */
html.dark-mode #dc-ai-window {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

/* ── Header ── */
.dc-ai-header {
  padding: 16px 20px;
  background: linear-gradient(135deg, #1e4b7f 0%, #0f2d52 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dc-ai-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dc-ai-avatar {
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.dc-ai-title-wrap h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.dc-ai-status {
  font-size: 0.75rem;
  color: #a7f3d0;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}

.dc-ai-status-dot {
  width: 7px;
  height: 7px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
}

.dc-ai-close-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #ffffff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: background 0.2s ease;
  pointer-events: auto !important;
}

.dc-ai-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ── Messages Container ── */
.dc-ai-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}

.dc-ai-messages::-webkit-scrollbar {
  width: 5px;
}
.dc-ai-messages::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 4px;
}
html.dark-mode .dc-ai-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
}

/* Message Rows */
.dc-ai-msg {
  display: flex;
  flex-direction: column;
  max-width: 88%;
  animation: dcFadeMsg 0.25s ease-out forwards;
}

@keyframes dcFadeMsg {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.dc-ai-msg.dc-user {
  align-self: flex-end;
}

.dc-ai-msg.dc-bot {
  align-self: flex-start;
}

.dc-ai-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.5;
  word-break: break-word;
}

.dc-user .dc-ai-bubble {
  background: linear-gradient(135deg, #1e4b7f 0%, #1d4ed8 100%);
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 3px 10px rgba(30, 75, 127, 0.2);
}

.dc-bot .dc-ai-bubble {
  background: #f1f5f9;
  color: #0f172a;
  border-bottom-left-radius: 4px;
  border: 1px solid #e2e8f0;
}

html.dark-mode .dc-bot .dc-ai-bubble {
  background: #1e293b;
  color: #f8fafc;
  border-color: #334155;
}

/* Booking Summary Card inside Bot Bubbles */
.dc-ai-summary-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-left: 4px solid #1e4b7f;
  border-radius: 12px;
  padding: 12px 14px;
  margin: 8px 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

html.dark-mode .dc-ai-summary-card {
  background: #0f172a;
  border-color: #334155;
  border-left-color: #3b82f6;
}

.dc-ai-summary-card h5 {
  margin: 0 0 8px 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e4b7f;
  display: flex;
  align-items: center;
  gap: 6px;
}
html.dark-mode .dc-ai-summary-card h5 {
  color: #60a5fa;
}

.dc-ai-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  padding: 3px 0;
  border-bottom: 1px dashed #f1f5f9;
}
html.dark-mode .dc-ai-summary-row {
  border-bottom-color: #1e293b;
}

.dc-ai-summary-row:last-child {
  border-bottom: none;
}

.dc-ai-summary-label {
  color: #64748b;
  font-weight: 500;
}
html.dark-mode .dc-ai-summary-label {
  color: #94a3b8;
}

.dc-ai-summary-val {
  font-weight: 700;
  color: #0f172a;
}
html.dark-mode .dc-ai-summary-val {
  color: #f8fafc;
}

/* Formatting */
.dc-ai-bubble p {
  margin: 0 0 8px 0;
}
.dc-ai-bubble p:last-child {
  margin-bottom: 0;
}
.dc-ai-bubble ul {
  margin: 6px 0 8px 0;
  padding-left: 18px;
}
.dc-ai-bubble li {
  margin-bottom: 4px;
}
.dc-ai-bubble strong {
  font-weight: 700;
  color: #1e4b7f;
}
html.dark-mode .dc-ai-bubble strong {
  color: #60a5fa;
}

/* Interactive Action Buttons inside Bot Message */
.dc-ai-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.dc-ai-btn-action {
  background: #ffffff;
  border: 1px solid #1e4b7f;
  color: #1e4b7f;
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  width: 100%;
}

.dc-ai-btn-action:hover {
  background: #1e4b7f;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(30, 75, 127, 0.25);
}

.dc-ai-btn-action.dc-primary-fill {
  background: linear-gradient(135deg, #1e4b7f 0%, #153960 100%);
  color: #ffffff;
  border: none;
}
.dc-ai-btn-action.dc-primary-fill:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.dc-ai-btn-action.dc-wa-fill {
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  color: #ffffff;
  border: none;
}
.dc-ai-btn-action.dc-wa-fill:hover {
  background: linear-gradient(135deg, #128c7e 0%, #075e54 100%);
}

html.dark-mode .dc-ai-btn-action {
  background: #0f172a;
  border-color: #3b82f6;
  color: #60a5fa;
}

/* Form Pulse Animation on Auto-Fill */
@keyframes dcFormPulse {
  0% { box-shadow: 0 0 0 0 rgba(30, 75, 127, 0.7); }
  50% { box-shadow: 0 0 0 12px rgba(30, 75, 127, 0); }
  100% { box-shadow: 0 0 0 0 rgba(30, 75, 127, 0); }
}

.dc-form-highlight {
  animation: dcFormPulse 1.5s ease-in-out 2;
  border: 2px solid #1e4b7f !important;
}

/* ── Suggestion Chips (Quick Prompts) ── */
.dc-ai-chips {
  padding: 8px 14px 12px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  background: #fafafa;
  border-top: 1px solid #f1f5f9;
  scroll-behavior: smooth;
}

.dc-ai-chips::-webkit-scrollbar {
  display: none;
}

html.dark-mode .dc-ai-chips {
  background: #0f172a;
  border-top-color: #1e293b;
}

.dc-ai-chip {
  white-space: nowrap;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
  padding: 6px 12px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.dc-ai-chip:hover {
  background: #1e4b7f;
  color: #ffffff;
  border-color: #1e4b7f;
}

html.dark-mode .dc-ai-chip {
  background: #1e293b;
  border-color: #334155;
  color: #cbd5e1;
}
html.dark-mode .dc-ai-chip:hover {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

/* ── Input Bar ── */
.dc-ai-input-bar {
  padding: 12px 14px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 8px;
}

html.dark-mode .dc-ai-input-bar {
  background: #0f172a;
  border-top-color: #1e293b;
}

.dc-ai-input-bar input {
  flex: 1;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.88rem;
  outline: none;
  background: #f8fafc;
  color: #0f172a;
  transition: border-color 0.2s ease;
}

.dc-ai-input-bar input:focus {
  border-color: #1e4b7f;
  background: #ffffff;
}

html.dark-mode .dc-ai-input-bar input {
  background: #1e293b;
  border-color: #334155;
  color: #f8fafc;
}

html.dark-mode .dc-ai-input-bar input:focus {
  border-color: #3b82f6;
}

.dc-ai-send-btn {
  background: linear-gradient(135deg, #1e4b7f 0%, #153960 100%);
  border: none;
  color: #ffffff;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.dc-ai-send-btn svg {
  pointer-events: none;
}

.dc-ai-send-btn:hover {
  transform: scale(1.05);
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

/* ── Typing Indicator ── */
.dc-ai-typing {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 10px 14px;
  background: #f1f5f9;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  width: fit-content;
}

html.dark-mode .dc-ai-typing {
  background: #1e293b;
}

.dc-ai-typing-dot {
  width: 6px;
  height: 6px;
  background: #64748b;
  border-radius: 50%;
  animation: dcBlink 1.4s infinite ease-in-out both;
}

.dc-ai-typing-dot:nth-child(1) { animation-delay: 0s; }
.dc-ai-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.dc-ai-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes dcBlink {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1.2); opacity: 1; }
}

/* Mobile Screen Adjustments */
@media (max-width: 640px) {
  #dc-ai-trigger {
    bottom: 12px;
    right: 12px;
    width: 42px;
    height: 42px;
  }
  #dc-ai-window {
    bottom: 55px;
    right: 12px;
    width: 300px;
    height: 390px;
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 85px);
    border-radius: 14px;
    box-shadow: 0 12px 36px rgba(15, 23, 42, 0.28);
  }
  .dc-ai-header {
    border-radius: 14px 14px 0 0;
    padding: 10px 14px;
  }
}

/* ── Trip Status Interactive Form Card ── */
.dc-ai-status-form-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-left: 4px solid #059669;
  border-radius: 12px;
  padding: 12px 14px;
  margin: 6px 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

html.dark-mode .dc-ai-status-form-card {
  background: #0f172a;
  border-color: #334155;
  border-left-color: #10b981;
}

.dc-ai-status-form-card h5 {
  margin: 0 0 6px 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: #059669;
  display: flex;
  align-items: center;
  gap: 6px;
}

html.dark-mode .dc-ai-status-form-card h5 {
  color: #34d399;
}

.dc-ai-status-form-card input {
  background: #f8fafc;
  color: #0f172a;
}

html.dark-mode .dc-ai-status-form-card input {
  background: #1e293b;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

