/* FuchsTravels Chatbot - Viking/Nordic Theme CSS */
/* Designed to match the premium photography tour marketplace aesthetic */

/* ============================================
   CSS Variables & Theme Configuration
   ============================================ */
:root {
  /* Chat-specific color scheme matching Viking theme */
  --chat-primary: var(--fjord-blue, #1e3a5f);
  --chat-primary-hover: var(--nordic-blue, #2c5282);
  --chat-accent: var(--ice-blue, #4a90e2);
  --chat-accent-light: #60a5fa;

  /* Background colors */
  --chat-bg-primary: #ffffff;
  --chat-bg-secondary: #f9fafb;
  --chat-bg-tertiary: #f3f4f6;
  --chat-bg-overlay: rgba(0, 0, 0, 0.5);

  /* Message bubble colors */
  --chat-user-bubble: var(--fjord-blue, #1e3a5f);
  --chat-user-text: #ffffff;
  --chat-assistant-bubble: #f3f4f6;
  --chat-assistant-text: #1f2937;

  /* Border and divider colors */
  --chat-border: #e5e7eb;
  --chat-border-hover: #d1d5db;
  --chat-divider: #e5e7eb;

  /* Status colors */
  --chat-online: #10b981;
  --chat-typing: #60a5fa;
  --chat-error: #ef4444;
  --chat-warning: #f59e0b;
  --chat-success: #10b981;

  /* Notification colors */
  --chat-badge-bg: #ef4444;
  --chat-badge-text: #ffffff;

  /* Typography */
  --chat-font-primary: var(--font-body, 'Inter', sans-serif);
  --chat-font-heading: var(--font-heading, 'Montserrat', sans-serif);

  /* Spacing */
  --chat-spacing-xs: 0.25rem;
  --chat-spacing-sm: 0.5rem;
  --chat-spacing-md: 1rem;
  --chat-spacing-lg: 1.5rem;
  --chat-spacing-xl: 2rem;

  /* Border radius */
  --chat-radius-sm: 0.375rem;
  --chat-radius-md: 0.5rem;
  --chat-radius-lg: 0.75rem;
  --chat-radius-xl: 1rem;
  --chat-radius-full: 9999px;

  /* Shadows */
  --chat-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --chat-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --chat-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --chat-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  /* Transitions */
  --chat-transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --chat-transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --chat-transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Z-index layers */
  --chat-z-button: 2147483646;
  --chat-z-window: 2147483647;
  --chat-z-overlay: 2147483645;
}

/* Dark mode support */
[data-theme="dark"] {
  --chat-bg-primary: #1f2937;
  --chat-bg-secondary: #111827;
  --chat-bg-tertiary: #0f172a;
  --chat-assistant-bubble: #374151;
  --chat-assistant-text: #e5e7eb;
  --chat-border: #374151;
  --chat-border-hover: #4b5563;
}

/* ============================================
   Chat Button Styles
   ============================================ */

/* Floating chat button container */
.chat-button-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: var(--chat-z-button);
}

/* Main chat button */
.chat-button {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: var(--chat-radius-full);
  background: linear-gradient(135deg, var(--chat-primary) 0%, var(--chat-primary-hover) 100%);
  box-shadow: var(--chat-shadow-lg);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--chat-transition-base);
  overflow: hidden;
}

/* Button hover state */
.chat-button:hover {
  transform: scale(1.05);
  box-shadow: var(--chat-shadow-xl);
  background: linear-gradient(135deg, var(--chat-primary-hover) 0%, var(--chat-accent) 100%);
}

/* Button active state */
.chat-button:active {
  transform: scale(0.95);
}

/* Button when chat is open */
.chat-button.chat-open {
  transform: rotate(90deg);
  background: linear-gradient(135deg, var(--chat-accent) 0%, var(--chat-primary-hover) 100%);
}

/* Chat icon */
.chat-button-icon {
  width: 28px;
  height: 28px;
  color: white;
  transition: transform var(--chat-transition-base);
}

/* Close icon when open */
.chat-button.chat-open .chat-button-icon {
  transform: rotate(-90deg);
}

/* Notification badge */
.chat-notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background-color: var(--chat-badge-bg);
  color: var(--chat-badge-text);
  border-radius: var(--chat-radius-full);
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse 2s infinite;
  border: 2px solid white;
}

/* Pulse animation for notification */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.9;
  }
}

/* Tooltip on hover */
.chat-button-tooltip {
  position: absolute;
  bottom: 100%;
  right: 0;
  margin-bottom: 0.5rem;
  padding: 0.5rem 0.75rem;
  background-color: var(--chat-primary);
  color: white;
  font-size: 0.875rem;
  border-radius: var(--chat-radius-md);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--chat-transition-fast);
}

.chat-button:hover .chat-button-tooltip {
  opacity: 1;
}

/* Ripple effect on click */
.chat-button::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.chat-button:active::after {
  width: 100px;
  height: 100px;
}

/* ============================================
   Chat Window Styles
   ============================================ */

/* Chat window container */
.chat-window {
  position: fixed;
  bottom: 6rem;
  right: 2rem;
  width: 400px;
  height: 600px;
  background-color: var(--chat-bg-primary);
  border-radius: var(--chat-radius-xl);
  box-shadow: var(--chat-shadow-xl);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: scale(0.9) translateY(20px);
  transition: all var(--chat-transition-base);
  z-index: var(--chat-z-window);
  visibility: hidden;
  overflow: hidden;
}

/* Chat window open state */
.chat-window.chat-open {
  opacity: 1;
  transform: scale(1) translateY(0);
  visibility: visible;
}

/* Chat header */
.chat-header {
  background: linear-gradient(135deg, var(--chat-primary) 0%, var(--chat-primary-hover) 100%);
  color: white;
  padding: var(--chat-spacing-md) var(--chat-spacing-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: var(--chat-radius-xl) var(--chat-radius-xl) 0 0;
  position: relative;
  overflow: hidden;
}

/* Nordic pattern overlay for header */
.chat-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 10px,
      rgba(255, 255, 255, 0.03) 10px,
      rgba(255, 255, 255, 0.03) 20px
    );
  pointer-events: none;
}

/* Chat header content */
.chat-header-content {
  display: flex;
  align-items: center;
  gap: var(--chat-spacing-md);
  z-index: 1;
  position: relative;
}

/* Agent avatar */
.chat-agent-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--chat-radius-full);
  background: linear-gradient(135deg, var(--chat-accent) 0%, var(--chat-accent-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.2rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

/* Agent info */
.chat-agent-info {
  flex: 1;
}

.chat-agent-name {
  font-family: var(--chat-font-heading);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.125rem;
}

.chat-agent-status {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  opacity: 0.9;
}

/* Status indicator dot */
.chat-status-indicator {
  width: 8px;
  height: 8px;
  border-radius: var(--chat-radius-full);
  background-color: var(--chat-online);
  animation: blink 2s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Header actions */
.chat-header-actions {
  display: flex;
  gap: var(--chat-spacing-sm);
  z-index: 1;
  position: relative;
}

.chat-header-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--chat-radius-md);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--chat-transition-fast);
}

.chat-header-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

/* ============================================
   Message Area Styles
   ============================================ */

/* Messages container */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--chat-spacing-lg);
  background: var(--chat-bg-secondary);
  scroll-behavior: smooth;
}

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

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

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

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

/* Message wrapper */
.chat-message {
  display: flex;
  margin-bottom: var(--chat-spacing-md);
  animation: fadeInUp var(--chat-transition-base);
}

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

/* User message */
.chat-message.user {
  justify-content: flex-end;
}

/* Assistant message */
.chat-message.assistant {
  justify-content: flex-start;
}

/* Message bubble */
.chat-message-bubble {
  max-width: 75%;
  padding: var(--chat-spacing-md);
  border-radius: var(--chat-radius-lg);
  position: relative;
  word-wrap: break-word;
  box-shadow: var(--chat-shadow-sm);
}

/* User message bubble */
.chat-message.user .chat-message-bubble {
  background: linear-gradient(135deg, var(--chat-user-bubble) 0%, var(--chat-primary-hover) 100%);
  color: var(--chat-user-text);
  border-bottom-right-radius: var(--chat-radius-sm);
}

/* Assistant message bubble */
.chat-message.assistant .chat-message-bubble {
  background: var(--chat-assistant-bubble);
  color: var(--chat-assistant-text);
  border-bottom-left-radius: var(--chat-radius-sm);
}

/* Message timestamp */
.chat-message-time {
  font-size: 0.625rem;
  opacity: 0.5;
  margin-top: 0.25rem;
}

/* Typing indicator */
.chat-typing-indicator {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: var(--chat-spacing-sm) var(--chat-spacing-md);
}

.chat-typing-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--chat-radius-full);
  background-color: var(--chat-typing);
  animation: typing 1.4s infinite;
}

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

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

@keyframes typing {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.7;
  }
  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

/* ============================================
   Special Message Types
   ============================================ */

/* Tour card in message */
.chat-tour-card {
  background: white;
  border-radius: var(--chat-radius-md);
  overflow: hidden;
  margin-top: var(--chat-spacing-sm);
  border: 1px solid var(--chat-border);
  transition: all var(--chat-transition-fast);
}

.chat-tour-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--chat-shadow-md);
}

.chat-tour-card-image {
  width: 100%;
  height: 120px;
  object-fit: cover;
}

.chat-tour-card-content {
  padding: var(--chat-spacing-md);
}

.chat-tour-card-title {
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
  color: var(--chat-primary);
}

.chat-tour-card-price {
  font-size: 0.75rem;
  color: var(--chat-accent);
  font-weight: 500;
}

/* Quick action buttons */
.chat-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--chat-spacing-sm);
  margin-top: var(--chat-spacing-sm);
}

.chat-quick-action-btn {
  padding: var(--chat-spacing-sm) var(--chat-spacing-md);
  background: white;
  border: 1px solid var(--chat-border);
  border-radius: var(--chat-radius-full);
  font-size: 0.875rem;
  color: var(--chat-primary);
  cursor: pointer;
  transition: all var(--chat-transition-fast);
}

.chat-quick-action-btn:hover {
  background: var(--chat-primary);
  color: white;
  transform: translateY(-1px);
  box-shadow: var(--chat-shadow-sm);
}

/* Error message */
.chat-error-message {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: var(--chat-spacing-md);
  border-radius: var(--chat-radius-md);
  margin: var(--chat-spacing-md) 0;
  display: flex;
  align-items: center;
  gap: var(--chat-spacing-sm);
}

/* Success message */
.chat-success-message {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
  padding: var(--chat-spacing-md);
  border-radius: var(--chat-radius-md);
  margin: var(--chat-spacing-md) 0;
  display: flex;
  align-items: center;
  gap: var(--chat-spacing-sm);
}

/* ============================================
   Input Area Styles
   ============================================ */

/* Input container */
.chat-input-container {
  padding: var(--chat-spacing-md) var(--chat-spacing-lg);
  background: var(--chat-bg-primary);
  border-top: 1px solid var(--chat-border);
  border-radius: 0 0 var(--chat-radius-xl) var(--chat-radius-xl);
}

/* Input wrapper */
.chat-input-wrapper {
  display: flex;
  gap: var(--chat-spacing-sm);
  align-items: flex-end;
}

/* Text input */
.chat-input {
  flex: 1;
  min-height: 40px;
  max-height: 120px;
  padding: var(--chat-spacing-sm) var(--chat-spacing-md);
  background: var(--chat-bg-tertiary);
  border: 1px solid var(--chat-border);
  border-radius: var(--chat-radius-lg);
  font-family: var(--chat-font-primary);
  font-size: 0.875rem;
  resize: none;
  transition: all var(--chat-transition-fast);
  outline: none;
}

.chat-input:focus {
  background: white;
  border-color: var(--chat-accent);
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.chat-input::placeholder {
  color: #9ca3af;
}

/* Input actions */
.chat-input-actions {
  display: flex;
  gap: var(--chat-spacing-xs);
}

/* Send button */
.chat-send-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--chat-radius-full);
  background: linear-gradient(135deg, var(--chat-primary) 0%, var(--chat-primary-hover) 100%);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--chat-transition-fast);
}

.chat-send-btn:hover:not(:disabled) {
  transform: scale(1.05);
  background: linear-gradient(135deg, var(--chat-primary-hover) 0%, var(--chat-accent) 100%);
}

.chat-send-btn:active:not(:disabled) {
  transform: scale(0.95);
}

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

/* Attachment button */
.chat-attach-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--chat-radius-full);
  background: var(--chat-bg-tertiary);
  border: 1px solid var(--chat-border);
  color: var(--chat-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--chat-transition-fast);
}

.chat-attach-btn:hover {
  background: var(--chat-primary);
  color: white;
  transform: scale(1.05);
}

/* ============================================
   Empty States & Onboarding
   ============================================ */

/* Welcome screen */
.chat-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--chat-spacing-xl);
  height: 100%;
}

.chat-welcome-icon {
  width: 80px;
  height: 80px;
  margin-bottom: var(--chat-spacing-lg);
  background: linear-gradient(135deg, var(--chat-accent) 0%, var(--chat-primary) 100%);
  border-radius: var(--chat-radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 2rem;
}

.chat-welcome-title {
  font-family: var(--chat-font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--chat-primary);
  margin-bottom: var(--chat-spacing-sm);
}

.chat-welcome-text {
  color: #6b7280;
  font-size: 0.875rem;
  margin-bottom: var(--chat-spacing-lg);
  line-height: 1.5;
}

/* Suggested questions */
.chat-suggestions {
  display: flex;
  flex-direction: column;
  gap: var(--chat-spacing-sm);
  width: 100%;
}

.chat-suggestion-btn {
  padding: var(--chat-spacing-md);
  background: white;
  border: 1px solid var(--chat-border);
  border-radius: var(--chat-radius-md);
  text-align: left;
  font-size: 0.875rem;
  color: var(--chat-primary);
  cursor: pointer;
  transition: all var(--chat-transition-fast);
}

.chat-suggestion-btn:hover {
  background: var(--chat-bg-tertiary);
  border-color: var(--chat-accent);
  transform: translateX(4px);
}

/* ============================================
   Mobile Responsive Styles
   ============================================ */

/* Tablet adjustments */
@media (max-width: 768px) {
  .chat-window {
    width: 350px;
    height: 500px;
    right: 1rem;
    bottom: 5rem;
  }

  .chat-button-container {
    right: 1rem;
    bottom: 1rem;
  }
}

/* Mobile full-screen mode */
@media (max-width: 480px) {
  .chat-window {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
  }

  .chat-window.chat-open {
    transform: scale(1) translateY(0);
  }

  .chat-header {
    border-radius: 0;
    padding-top: env(safe-area-inset-top, 20px);
  }

  .chat-input-container {
    padding-bottom: env(safe-area-inset-bottom, 20px);
    border-radius: 0;
  }

  .chat-message-bubble {
    max-width: 85%;
  }

  /* Hide minimize button on mobile */
  .chat-minimize-btn {
    display: none;
  }
}

/* ============================================
   Loading & Skeleton States
   ============================================ */

/* Loading skeleton for messages */
.chat-skeleton {
  display: flex;
  flex-direction: column;
  gap: var(--chat-spacing-md);
  padding: var(--chat-spacing-lg);
}

.chat-skeleton-message {
  display: flex;
  gap: var(--chat-spacing-sm);
}

.chat-skeleton-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--chat-radius-full);
  background: linear-gradient(90deg, #f3f4f6 0%, #e5e7eb 50%, #f3f4f6 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.chat-skeleton-bubble {
  flex: 1;
  height: 60px;
  border-radius: var(--chat-radius-lg);
  background: linear-gradient(90deg, #f3f4f6 0%, #e5e7eb 50%, #f3f4f6 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* ============================================
   Accessibility Features
   ============================================ */

/* Focus styles */
.chat-button:focus-visible,
.chat-header-btn:focus-visible,
.chat-send-btn:focus-visible,
.chat-attach-btn:focus-visible,
.chat-quick-action-btn:focus-visible {
  outline: 2px solid var(--chat-accent);
  outline-offset: 2px;
}

/* Screen reader only text */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .chat-message-bubble {
    border: 2px solid currentColor;
  }

  .chat-button {
    border: 2px solid white;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
  .chat-button-container,
  .chat-window {
    display: none;
  }
}/* Cache bust: Wed Sep 10 03:30:37 EDT 2025 */
