/**
 * AsistanAyiti Chatbot Styles
 * HaitiConsul Assistant - Phase 2 Implementation
 * 
 * Design Specifications:
 * - Primary color: #0039A6 (Haiti Blue)
 * - Accent color: #D21034 (Haiti Red)
 * - Background: White with subtle texture
 * - Desktop: 400px width, 600px height
 * - Mobile: 100% width, 90vh height
 * - Border radius: 12px desktop, 0px mobile fullscreen
 */

/* ===== CSS Variables ===== */
:root {
  --chatbot-primary: #0039A6;
  --chatbot-primary-dark: #002366;
  --chatbot-accent: #D21034;
  --chatbot-accent-dark: #B00D2B;
  --chatbot-white: #FFFFFF;
  --chatbot-gray-50: #F9FAFB;
  --chatbot-gray-100: #F3F4F6;
  --chatbot-gray-200: #E5E7EB;
  --chatbot-gray-300: #D1D5DB;
  --chatbot-gray-400: #9CA3AF;
  --chatbot-gray-500: #6B7280;
  --chatbot-gray-600: #4B5563;
  --chatbot-gray-700: #374151;
  --chatbot-gray-800: #1F2937;
  --chatbot-gray-900: #111827;
  --chatbot-green: #10B981;
  --chatbot-yellow: #F59E0B;
  --chatbot-red: #EF4444;
  
  --chatbot-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --chatbot-shadow-lg: 0 35px 60px -12px rgba(0, 0, 0, 0.35);
  --chatbot-radius: 12px;
  --chatbot-radius-full: 9999px;
  
  --chatbot-width: 400px;
  --chatbot-height: 600px;
  --chatbot-trigger-size: 60px;
}

/* ===== Trigger Button ===== */
#chatbot-trigger {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
}

@media (max-width: 640px) {
  #chatbot-trigger {
    bottom: 16px;
    right: 16px;
  }
}

.chatbot-trigger-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--chatbot-trigger-size);
  height: var(--chatbot-trigger-size);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  outline: none;
}

.chatbot-trigger-btn:focus-visible {
  outline: 3px solid var(--chatbot-primary);
  outline-offset: 3px;
  border-radius: var(--chatbot-radius-full);
}

.chatbot-btn-main {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--chatbot-trigger-size);
  height: var(--chatbot-trigger-size);
  background: linear-gradient(135deg, var(--chatbot-primary) 0%, var(--chatbot-accent) 100%);
  border-radius: var(--chatbot-radius-full);
  box-shadow: var(--chatbot-shadow);
  transition: all 0.3s ease;
  color: var(--chatbot-white);
  font-size: 24px;
}

.chatbot-trigger-btn:hover .chatbot-btn-main {
  transform: scale(1.1);
  box-shadow: var(--chatbot-shadow-lg);
}

.chatbot-icon-close {
  display: none;
}

/* Pulse animation rings */
.chatbot-pulse-ring {
  position: absolute;
  inset: 0;
  border-radius: var(--chatbot-radius-full);
  background: var(--chatbot-accent);
  animation: chatbot-pulse-ring 2s ease-out infinite;
  opacity: 0;
}

.chatbot-pulse-ring.delay-1 {
  animation-delay: 1s;
}

@keyframes chatbot-pulse-ring {
  0% {
    transform: scale(0.8);
    opacity: 0.6;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

/* Online badge */
.chatbot-online-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--chatbot-white);
  padding: 2px 8px;
  border-radius: var(--chatbot-radius-full);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  font-size: 10px;
  font-weight: 600;
  color: var(--chatbot-green);
}

.chatbot-online-dot {
  width: 6px;
  height: 6px;
  background: var(--chatbot-green);
  border-radius: var(--chatbot-radius-full);
  animation: chatbot-online-pulse 2s infinite;
}

@keyframes chatbot-online-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Unread badge */
.chatbot-unread {
  position: absolute;
  top: -8px;
  left: -8px;
  min-width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--chatbot-accent);
  color: var(--chatbot-white);
  font-size: 11px;
  font-weight: 700;
  border-radius: var(--chatbot-radius-full);
  padding: 0 6px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  animation: chatbot-bounce 0.5s ease;
}

@keyframes chatbot-bounce {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
}

/* Tooltip */
.chatbot-tooltip {
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--chatbot-gray-900);
  color: var(--chatbot-white);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  box-shadow: var(--chatbot-shadow);
}

.chatbot-tooltip-arrow {
  position: absolute;
  right: -4px;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 8px;
  height: 8px;
  background: var(--chatbot-gray-900);
}

.chatbot-trigger-btn:hover .chatbot-tooltip {
  opacity: 1;
  visibility: visible;
}

/* Hidden state */
#chatbot-trigger.chatbot-hidden {
  opacity: 0;
  visibility: hidden;
  transform: scale(0.8);
  pointer-events: none;
}

/* Pulse animation for trigger */
#chatbot-trigger.pulse .chatbot-btn-main {
  animation: chatbot-trigger-pulse 1s ease;
}

@keyframes chatbot-trigger-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.15);
  }
}

/* ===== Chatbot Window ===== */
.chatbot-window {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 24px;
  pointer-events: none;
}

.chatbot-window.hidden {
  display: none;
}

.chatbot-window.active {
  pointer-events: auto;
}

/* Backdrop */
.chatbot-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.chatbot-window.active .chatbot-backdrop {
  opacity: 1;
}

/* Container */
.chatbot-container {
  position: relative;
  width: var(--chatbot-width);
  height: var(--chatbot-height);
  max-height: 80vh;
  background: var(--chatbot-white);
  border-radius: var(--chatbot-radius);
  box-shadow: var(--chatbot-shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(100%);
  opacity: 0;
  transition: all 0.3s ease;
}

.chatbot-window.active .chatbot-container {
  transform: translateY(0);
  opacity: 1;
}

.chatbot-container.minimized {
  height: 60px;
  overflow: hidden;
}

/* Mobile fullscreen */
@media (max-width: 640px) {
  .chatbot-window {
    padding: 0;
  }
  
  .chatbot-container {
    width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
  }
}

/* ===== Header ===== */
.chatbot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--chatbot-primary) 0%, var(--chatbot-primary-dark) 100%);
  color: var(--chatbot-white);
  flex-shrink: 0;
}

.chatbot-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chatbot-avatar {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--chatbot-radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.chatbot-header-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chatbot-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  font-weight: 700;
  margin: 0;
}

.chatbot-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
}

.chatbot-status-dot {
  width: 8px;
  height: 8px;
  background: var(--chatbot-green);
  border-radius: var(--chatbot-radius-full);
  animation: chatbot-online-pulse 2s infinite;
}

.chatbot-status-dot.offline {
  background: var(--chatbot-gray-400);
  animation: none;
}

.chatbot-header-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Header controls */
.chatbot-control-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--chatbot-white);
  cursor: pointer;
  border-radius: var(--chatbot-radius-full);
  transition: background 0.2s ease;
  font-size: 16px;
}

.chatbot-control-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.chatbot-control-btn:focus-visible {
  outline: 2px solid var(--chatbot-white);
  outline-offset: 2px;
}

/* Language selector */
.chatbot-lang-selector {
  position: relative;
}

.chatbot-lang-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  color: var(--chatbot-white);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.chatbot-lang-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.chatbot-lang-flag {
  font-size: 16px;
}

.chatbot-lang-arrow {
  font-size: 10px;
  transition: transform 0.2s ease;
}

.chatbot-lang-arrow.rotate-180 {
  transform: rotate(180deg);
}

.chatbot-lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 140px;
  background: var(--chatbot-white);
  border-radius: 8px;
  box-shadow: var(--chatbot-shadow);
  overflow: hidden;
  z-index: 10;
}

.chatbot-lang-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  background: none;
  border: none;
  color: var(--chatbot-gray-700);
  cursor: pointer;
  font-size: 14px;
  text-align: left;
  transition: background 0.2s ease;
}

.chatbot-lang-option:hover {
  background: var(--chatbot-gray-100);
}

.chatbot-lang-option.active {
  background: var(--chatbot-gray-100);
  color: var(--chatbot-primary);
  font-weight: 600;
}

/* Menu dropdown */
.chatbot-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 48px;
  width: 200px;
  background: var(--chatbot-white);
  border-radius: 8px;
  box-shadow: var(--chatbot-shadow);
  overflow: hidden;
  z-index: 10;
}

.chatbot-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  background: none;
  border: none;
  color: var(--chatbot-gray-700);
  cursor: pointer;
  font-size: 14px;
  text-align: left;
  transition: background 0.2s ease;
}

.chatbot-menu-item:hover {
  background: var(--chatbot-gray-100);
}

.chatbot-menu-item i {
  width: 16px;
  color: var(--chatbot-gray-500);
}

/* ===== Messages Area ===== */
.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: var(--chatbot-gray-50);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Custom scrollbar */
.chatbot-messages::-webkit-scrollbar {
  width: 6px;
}

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

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

.chatbot-messages::-webkit-scrollbar-thumb:hover {
  background: var(--chatbot-gray-400);
}

/* Message styles */
.chatbot-message {
  display: flex;
  gap: 10px;
  animation: chatbot-message-in 0.3s ease;
}

@keyframes chatbot-message-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chatbot-message-assistant {
  flex-direction: row;
}

.chatbot-message-user {
  flex-direction: row-reverse;
}

.chatbot-message-avatar {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--chatbot-primary) 0%, var(--chatbot-accent) 100%);
  border-radius: var(--chatbot-radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.chatbot-user-avatar {
  background: var(--chatbot-gray-200);
  color: var(--chatbot-gray-600);
  font-size: 14px;
}

.chatbot-message-content {
  max-width: 85%;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chatbot-message-user .chatbot-message-content {
  align-items: flex-end;
}

.chatbot-message-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  background: var(--chatbot-white);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.chatbot-message-assistant .chatbot-message-bubble {
  border-top-left-radius: 4px;
}

.chatbot-message-user .chatbot-message-bubble {
  background: var(--chatbot-primary);
  color: var(--chatbot-white);
  border-top-right-radius: 4px;
}

.chatbot-message-text {
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
}

.chatbot-message-text a {
  color: var(--chatbot-primary);
  text-decoration: underline;
}

.chatbot-message-user .chatbot-message-text a {
  color: var(--chatbot-white);
}

.chatbot-message-text ul {
  margin: 8px 0;
  padding-left: 20px;
}

.chatbot-message-text li {
  margin: 4px 0;
}

.chatbot-message-time {
  font-size: 10px;
  color: var(--chatbot-gray-400);
  margin-top: 4px;
}

.chatbot-message-user .chatbot-message-time {
  color: rgba(255, 255, 255, 0.7);
}

/* Message actions */
.chatbot-message-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.chatbot-message:hover .chatbot-message-actions {
  opacity: 1;
}

.chatbot-copy-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--chatbot-gray-100);
  border: none;
  border-radius: 6px;
  color: var(--chatbot-gray-500);
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s ease;
}

.chatbot-copy-btn:hover {
  background: var(--chatbot-gray-200);
  color: var(--chatbot-gray-700);
}

.chatbot-copy-btn.copied {
  background: var(--chatbot-green);
  color: var(--chatbot-white);
}

/* Feedback */
.chatbot-feedback {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--chatbot-gray-400);
}

.chatbot-feedback-btn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--chatbot-gray-400);
  cursor: pointer;
  border-radius: 4px;
  font-size: 11px;
  transition: all 0.2s ease;
}

.chatbot-feedback-btn:hover {
  background: var(--chatbot-gray-100);
  color: var(--chatbot-gray-600);
}

.chatbot-feedback-btn[data-feedback="positive"]:hover {
  color: var(--chatbot-green);
}

.chatbot-feedback-btn[data-feedback="negative"]:hover {
  color: var(--chatbot-red);
}

.chatbot-feedback.submitted .chatbot-feedback-btn {
  pointer-events: none;
  opacity: 0.5;
}

/* Response buttons */
.chatbot-response-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.chatbot-response-btn {
  padding: 8px 14px;
  background: var(--chatbot-gray-100);
  border: 1px solid var(--chatbot-gray-200);
  border-radius: 20px;
  color: var(--chatbot-gray-700);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
}

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

/* Response links */
.chatbot-response-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}

.chatbot-response-link {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--chatbot-primary);
  font-size: 13px;
  text-decoration: none;
}

.chatbot-response-link:hover {
  text-decoration: underline;
}

/* ===== Quick Actions ===== */
.chatbot-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 16px;
}

.chatbot-quick-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--chatbot-white);
  border: 1px solid var(--chatbot-gray-200);
  border-radius: 20px;
  color: var(--chatbot-gray-700);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.chatbot-quick-btn:hover {
  background: var(--chatbot-primary);
  border-color: var(--chatbot-primary);
  color: var(--chatbot-white);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 57, 166, 0.2);
}

.chatbot-quick-btn i {
  font-size: 14px;
}

.chatbot-quick-btn-emergency {
  border-color: var(--chatbot-accent);
  color: var(--chatbot-accent);
}

.chatbot-quick-btn-emergency:hover {
  background: var(--chatbot-accent);
  border-color: var(--chatbot-accent);
  color: var(--chatbot-white);
  box-shadow: 0 4px 12px rgba(210, 16, 52, 0.2);
}

/* ===== Privacy Notice ===== */
.chatbot-privacy-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 16px;
  background: var(--chatbot-gray-100);
  border-top: 1px solid var(--chatbot-gray-200);
  font-size: 11px;
  color: var(--chatbot-gray-500);
}

.chatbot-privacy-notice p {
  margin: 0;
  flex: 1;
}

.chatbot-privacy-close {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--chatbot-gray-400);
  cursor: pointer;
  flex-shrink: 0;
}

/* ===== Typing Indicator ===== */
.chatbot-typing {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px 16px;
}

.chatbot-typing.hidden {
  display: none;
}

.chatbot-typing-indicator {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  background: var(--chatbot-white);
  border-radius: 16px;
  border-top-left-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.chatbot-typing-indicator span {
  width: 8px;
  height: 8px;
  background: var(--chatbot-primary);
  border-radius: var(--chatbot-radius-full);
  animation: chatbot-typing-bounce 1.4s infinite ease-in-out both;
}

.chatbot-typing-indicator span:nth-child(1) {
  animation-delay: -0.32s;
}

.chatbot-typing-indicator span:nth-child(2) {
  animation-delay: -0.16s;
}

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

.chatbot-typing-text {
  font-size: 12px;
  color: var(--chatbot-gray-400);
  font-style: italic;
}

/* ===== Footer / Input ===== */
.chatbot-footer {
  padding: 12px 16px;
  background: var(--chatbot-white);
  border-top: 1px solid var(--chatbot-gray-200);
}

.chatbot-form {
  display: flex;
  flex-direction: column;
}

.chatbot-input-container {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 12px;
  background: var(--chatbot-gray-100);
  border-radius: 24px;
  border: 2px solid transparent;
  transition: all 0.2s ease;
}

.chatbot-input-container:focus-within {
  background: var(--chatbot-white);
  border-color: var(--chatbot-primary);
}

.chatbot-attach-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--chatbot-gray-400);
  cursor: pointer;
  border-radius: var(--chatbot-radius-full);
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.chatbot-attach-btn:hover {
  background: var(--chatbot-gray-200);
  color: var(--chatbot-gray-600);
}

.chatbot-input {
  flex: 1;
  min-height: 36px;
  max-height: 120px;
  padding: 8px 0;
  background: transparent;
  border: none;
  color: var(--chatbot-gray-800);
  font-family: 'Open Sans', sans-serif;
  font-size: 14px;
  line-height: 1.4;
  resize: none;
  outline: none;
}

.chatbot-input::placeholder {
  color: var(--chatbot-gray-400);
}

.chatbot-char-count {
  font-size: 10px;
  color: var(--chatbot-gray-400);
  flex-shrink: 0;
  align-self: flex-end;
  padding-bottom: 10px;
}

.chatbot-send-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--chatbot-primary) 0%, var(--chatbot-primary-dark) 100%);
  border: none;
  border-radius: var(--chatbot-radius-full);
  color: var(--chatbot-white);
  cursor: pointer;
  flex-shrink: 0;
  font-size: 16px;
  transition: all 0.2s ease;
}

.chatbot-send-btn:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 57, 166, 0.3);
}

.chatbot-send-btn:disabled {
  background: var(--chatbot-gray-300);
  cursor: not-allowed;
}

/* Powered by */
.chatbot-powered-by {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 10px;
  color: var(--chatbot-gray-400);
}

.chatbot-genspark-link {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--chatbot-primary);
  text-decoration: none;
  font-weight: 500;
}

.chatbot-genspark-link:hover {
  text-decoration: underline;
}

.chatbot-genspark-logo {
  width: 14px;
  height: 14px;
  border-radius: 3px;
}

/* ===== Tour ===== */
.chatbot-tour {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chatbot-tour.hidden {
  display: none;
}

.chatbot-tour-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
}

.chatbot-tour-content {
  position: relative;
  z-index: 1;
}

.chatbot-tour-step {
  display: none;
  padding: 20px;
  background: var(--chatbot-white);
  border-radius: var(--chatbot-radius);
  box-shadow: var(--chatbot-shadow-lg);
  max-width: 300px;
  text-align: center;
}

.chatbot-tour-step.active {
  display: block;
  animation: chatbot-tour-in 0.3s ease;
}

@keyframes chatbot-tour-in {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.chatbot-tour-step h3 {
  margin: 0 0 8px;
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--chatbot-gray-800);
}

.chatbot-tour-step p {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--chatbot-gray-600);
}

.chatbot-tour-nav {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.chatbot-tour-skip,
.chatbot-tour-next,
.chatbot-tour-done {
  flex: 1;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chatbot-tour-skip {
  background: var(--chatbot-gray-100);
  border: none;
  color: var(--chatbot-gray-600);
}

.chatbot-tour-skip:hover {
  background: var(--chatbot-gray-200);
}

.chatbot-tour-next,
.chatbot-tour-done {
  background: var(--chatbot-primary);
  border: none;
  color: var(--chatbot-white);
}

.chatbot-tour-next:hover,
.chatbot-tour-done:hover {
  background: var(--chatbot-primary-dark);
}

/* ===== Welcome Back Modal ===== */
.chatbot-welcome-back {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  z-index: 5;
}

.chatbot-welcome-back.hidden {
  display: none;
}

.chatbot-welcome-back-content {
  padding: 24px;
  background: var(--chatbot-white);
  border-radius: var(--chatbot-radius);
  text-align: center;
  max-width: 280px;
  animation: chatbot-tour-in 0.3s ease;
}

.chatbot-welcome-back-emoji {
  font-size: 40px;
  display: block;
  margin-bottom: 12px;
}

.chatbot-welcome-back-content h3 {
  margin: 0 0 8px;
  font-family: 'Montserrat', sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--chatbot-gray-800);
}

.chatbot-welcome-back-content p {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--chatbot-gray-500);
  line-height: 1.4;
}

.chatbot-welcome-back-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chatbot-continue-btn {
  padding: 12px 20px;
  background: var(--chatbot-primary);
  border: none;
  border-radius: 8px;
  color: var(--chatbot-white);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chatbot-continue-btn:hover {
  background: var(--chatbot-primary-dark);
}

.chatbot-start-new-btn {
  padding: 10px 20px;
  background: none;
  border: 1px solid var(--chatbot-gray-300);
  border-radius: 8px;
  color: var(--chatbot-gray-600);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chatbot-start-new-btn:hover {
  background: var(--chatbot-gray-100);
}

/* ===== Accessibility ===== */
@media (prefers-reduced-motion: reduce) {
  .chatbot-pulse-ring,
  .chatbot-online-dot,
  .chatbot-typing-indicator span,
  .chatbot-message,
  .chatbot-tour-step.active,
  .chatbot-welcome-back-content {
    animation: none !important;
  }
  
  .chatbot-container,
  .chatbot-backdrop {
    transition: none !important;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .chatbot-message-bubble {
    border: 2px solid var(--chatbot-gray-400);
  }
  
  .chatbot-quick-btn,
  .chatbot-response-btn {
    border-width: 2px;
  }
}

/* Focus visible for keyboard navigation */
*:focus-visible {
  outline: 3px solid var(--chatbot-primary);
  outline-offset: 2px;
}

/* ===== Print ===== */
@media print {
  #chatbot-trigger,
  .chatbot-window {
    display: none !important;
  }
}
