/* Epic Auto Repair - Chatbot Styles */

/* CSS Variables for easy theming */
:root {
  --chat-primary: #F42708;
  --chat-primary-dark: #d42207;
  --chat-secondary: #F56A0D;
  --chat-bg: #0a0a0a;
  --chat-surface: #1a1a1a;
  --chat-text: #f9e6e6;
  --chat-text-muted: #888888;
  --chat-border: #333333;
  --chat-user-bg: linear-gradient(135deg, #F42708, #F56A0D);
  --chat-bot-bg: #252525;
  --chat-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* Floating Button */
.chat-toggle-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--chat-primary), var(--chat-secondary));
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(244, 39, 8, 0.4);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.chat-toggle-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(244, 39, 8, 0.6);
}

.chat-toggle-btn svg {
  width: 28px;
  height: 28px;
  fill: white;
  transition: transform 0.3s ease;
}

.chat-toggle-btn.active svg {
  transform: rotate(180deg);
}

/* Notification badge */
.chat-notification {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 20px;
  height: 20px;
  background: #22c55e;
  border-radius: 50%;
  border: 2px solid var(--chat-bg);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.8; }
}

/* Chat Container */
.chat-container {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 48px);
  height: 520px;
  max-height: calc(100vh - 140px);
  background: var(--chat-bg);
  border-radius: 20px;
  box-shadow: var(--chat-shadow);
  border: 1px solid var(--chat-border);
  display: flex;
  flex-direction: column;
  z-index: 9999;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: all 0.3s ease;
}

.chat-container.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Chat Header */
.chat-header {
  background: linear-gradient(135deg, var(--chat-primary), var(--chat-secondary));
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

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

.chat-avatar {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.chat-header-text h3 {
  color: white;
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.chat-header-text p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  margin: 2px 0 0 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.chat-status-dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
}

.chat-header-actions {
  display: flex;
  gap: 8px;
}

.chat-header-btn {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.chat-header-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.chat-header-btn svg {
  width: 18px;
  height: 18px;
  fill: white;
}

/* Messages Area */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--chat-bg);
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--chat-border);
  border-radius: 3px;
}

/* Message Bubbles */
.chat-message {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  animation: messageIn 0.3s ease;
}

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

.chat-message.user {
  align-self: flex-end;
  background: var(--chat-user-bg);
  color: white;
  border-bottom-right-radius: 4px;
}

.chat-message.bot {
  align-self: flex-start;
  background: var(--chat-bot-bg);
  color: var(--chat-text);
  border-bottom-left-radius: 4px;
}

.chat-message.bot ul {
  margin: 8px 0;
  padding-left: 20px;
}

.chat-message.bot li {
  margin: 4px 0;
}

.chat-message.bot a.chat-link {
  color: var(--chat-secondary);
  text-decoration: none;
  font-weight: 500;
}

.chat-message.bot a.chat-link:hover {
  text-decoration: underline;
}

.chat-message.bot strong {
  color: white;
}

/* Typing Indicator */
.chat-typing {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  background: var(--chat-bot-bg);
  border-radius: 16px;
  width: fit-content;
  align-self: flex-start;
}

.chat-typing span {
  width: 8px;
  height: 8px;
  background: var(--chat-text-muted);
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

.chat-typing span:nth-child(2) {
  animation-delay: 0.2s;
}

.chat-typing span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-8px); }
}

/* Quick Options */
.chat-quick-options {
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  background: var(--chat-surface);
  border-top: 1px solid var(--chat-border);
}

.chat-quick-btn {
  padding: 8px 14px;
  background: var(--chat-bot-bg);
  border: 1px solid var(--chat-border);
  border-radius: 20px;
  color: var(--chat-text);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.chat-quick-btn:hover {
  background: var(--chat-primary);
  border-color: var(--chat-primary);
  color: white;
}

/* Input Area */
.chat-input-area {
  padding: 16px;
  background: var(--chat-surface);
  border-top: 1px solid var(--chat-border);
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.chat-input-wrapper {
  flex: 1;
  position: relative;
}

.chat-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--chat-bg);
  border: 1px solid var(--chat-border);
  border-radius: 24px;
  color: var(--chat-text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  resize: none;
  max-height: 100px;
  line-height: 1.4;
}

.chat-input::placeholder {
  color: var(--chat-text-muted);
}

.chat-input:focus {
  border-color: var(--chat-primary);
}

.chat-send-btn {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--chat-primary), var(--chat-secondary));
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.chat-send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(244, 39, 8, 0.4);
}

.chat-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.chat-send-btn svg {
  width: 20px;
  height: 20px;
  fill: white;
}

/* Mobile Responsive */
@media (max-width: 480px) {
  .chat-toggle-btn {
    bottom: 16px;
    right: 16px;
    width: 56px;
    height: 56px;
  }

  .chat-container {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
  }

  .chat-container.open {
    border-radius: 0;
  }

  .chat-header {
    padding: 12px 16px;
    padding-top: max(12px, env(safe-area-inset-top));
  }

  .chat-messages {
    padding: 12px;
  }

  .chat-input-area {
    padding: 12px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.chat-message.fade-in {
  animation: fadeIn 0.3s ease, messageIn 0.3s ease;
}
