/* ==========================================================================
   AI DETAILING CONSULTANT STYLES
   ========================================================================== */

.ai-floating-btn {
  position: fixed;
  bottom: 84px;
  right: 20px;
  z-index: 1400;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: linear-gradient(135deg, var(--red-primary) 0%, #7e040b 100%);
  color: #fff;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 25px var(--red-glow-strong);
  cursor: pointer;
  font-weight: 700;
  font-size: 0.88rem;
  transition: all var(--transition-fast);
  animation: ai-pulse 3s infinite;
}

@keyframes ai-pulse {
  0%, 100% { box-shadow: 0 4px 20px var(--red-glow-strong); }
  50% { box-shadow: 0 4px 35px rgba(255, 30, 39, 0.9), 0 0 15px #fff; }
}

.ai-floating-btn:hover {
  transform: translateY(-2px) scale(1.03);
}

.ai-chat-window {
  background: var(--bg-card);
  border: 1px solid var(--border-red);
  border-radius: var(--radius-lg);
  max-width: 580px;
  width: 100%;
  height: 640px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.95), 0 0 35px var(--red-glow);
  overflow: hidden;
}

.ai-chat-header {
  padding: 16px 20px;
  background: rgba(10, 11, 15, 0.95);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.ai-avatar {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--red-primary), #000);
  border: 1px solid var(--red-vibrant);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.ai-status-dot {
  width: 7px;
  height: 7px;
  background: #22c55e;
  border-radius: 50%;
  display: inline-block;
  margin-right: 4px;
  box-shadow: 0 0 8px #22c55e;
}

.ai-chips-panel {
  padding: 12px 16px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
}

.ai-chips-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.ai-chips-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.ai-chips-scroll::-webkit-scrollbar {
  height: 4px;
}
.ai-chips-scroll::-webkit-scrollbar-thumb {
  background: #333;
}

.ai-chip {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  color: var(--text-light);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.ai-chip:hover {
  background: var(--red-subtle);
  border-color: var(--red-vibrant);
  color: #fff;
}

.ai-messages-container {
  flex-grow: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-msg {
  display: flex;
  max-width: 85%;
}

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

.ai-msg-user .msg-bubble {
  background: linear-gradient(135deg, var(--red-primary), var(--red-dark));
  color: #fff;
  border-radius: 16px 16px 2px 16px;
  box-shadow: 0 4px 15px rgba(229, 9, 20, 0.35);
}

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

.ai-msg-bot .msg-bubble {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-left: 3px solid var(--red-vibrant);
  color: var(--text-light);
  border-radius: 16px 16px 16px 2px;
}

.msg-bubble {
  padding: 12px 16px;
  font-size: 0.88rem;
  line-height: 1.5;
}

.typing-dots {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 12px 18px;
}

.typing-dots span {
  width: 7px;
  height: 7px;
  background: var(--red-vibrant);
  border-radius: 50%;
  animation: typing-bounce 1.4s infinite ease-in-out both;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing-bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

.ai-cta-box {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

.ai-input-bar {
  padding: 12px 16px;
  background: var(--bg-darkest);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: 8px;
  align-items: center;
}

.ai-input-bar input {
  flex-grow: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-full);
  padding: 12px 18px;
  color: #fff;
  font-size: 0.88rem;
  outline: none;
}

.ai-input-bar input:focus {
  border-color: var(--red-vibrant);
}

.ai-send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--red-primary);
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}

.ai-send-btn:hover {
  transform: scale(1.08);
  background: var(--red-vibrant);
}

@media (max-width: 768px) {
  .ai-floating-btn {
    bottom: 74px;
    right: 14px;
    padding: 10px 14px;
    font-size: 0.8rem;
  }
  .ai-chat-window {
    height: 90vh;
    border-radius: 14px;
  }
}
