/* CSS Variables for consistent theming */
:root {
  --warm-white: #FEFCF8;
  --dark-brown: #2D2A26;
  --warm-orange: #E8612C;
  --warm-orange-light: #FF8B5A;
  --cream: rgba(247, 245, 243, 0.9);
  --safe-area-top: env(safe-area-inset-top);
  --safe-area-bottom: env(safe-area-inset-bottom);

}

:root {
  /* Existing variables */
  --warm-white: #FEFCF8;
  --dark-brown: #2D2A26;
  --warm-orange: #E8612C;
  --warm-orange-light: #FF8B5A;
  --cream: rgba(247, 245, 243, 0.9);
  --safe-area-top: env(safe-area-inset-top);
  --safe-area-bottom: env(safe-area-inset-bottom);

  /* Category-specific colors */
  --cuisine-color: #E8612C;
  --cuisine-bg: #FFF4ED;
  --scenario-color: #7C3AED;
  --scenario-bg: #F3F0FF;
  --dietary-color: #059669;
  --dietary-bg: #ECFDF5;
  --price-color: #DC2626;
  --price-bg: #FEF2F2;



  /* NEW: Smart scaling system */
  --ui-scale: clamp(0.85, 2vw + 0.5rem, 1.15);
  --text-scale: clamp(0.875, 1.5vw + 0.5rem, 1.125);
  --space-scale: clamp(0.8, 2.5vw + 0.4rem, 1.2);

  /* Touch-friendly minimums (accessibility) */
  --touch-target: max(44px, 10vw);
  --button-height: max(44px, 8vw);
  --input-height: max(44px, 12vw);

  /* Fluid spacing */
  --space-xs: calc(4px * var(--space-scale));
  --space-sm: calc(8px * var(--space-scale));
  --space-md: calc(12px * var(--space-scale));
  --space-lg: calc(16px * var(--space-scale));
  --space-xl: calc(24px * var(--space-scale));

  /* Fluid font sizes */
  --text-xs: calc(0.75rem * var(--text-scale));
  --text-sm: calc(0.875rem * var(--text-scale));
  --text-base: calc(1rem * var(--text-scale));
  --text-lg: calc(1.125rem * var(--text-scale));
  --text-xl: calc(1.25rem * var(--text-scale));
}

* {
  box-sizing: border-box;
}

body {
  background-color: var(--warm-white);
  color: var(--dark-brown);
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  overflow-x: hidden;
}

/* Mobile-first: Full screen chat layout */
.mobile-container {
  height: 100vh; /* Full viewport height */
  height: 100dvh; /* Full dynamic viewport height */
  display: flex;
  flex-direction: column;
  padding-top: var(--safe-area-top);
}

/* Chat container adjusts for header */
.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0; /* Prevents flex item from overflowing */
}

/* Mobile header - hidden on mobile to save space */
.mobile-header {
  background: rgba(254, 252, 248, 0.8);
  backdrop-filter: blur(10px);
  color: var(--dark-brown);
  padding: 12px 16px;
  box-shadow: none;
  display: none; /* Hidden on mobile */
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 100;
}

.mobile-header h1 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
}

.mobile-header .logo {
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, var(--warm-orange), var(--warm-orange-light));
  border-radius: 50%;
  margin-right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: white;
}

.mobile-header.glass-effect {
  background: rgba(254, 252, 248, 0.5);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(232, 97, 44, 0.05);
}

/* Header controls */
.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Header map button */
.header-map-btn {
  background: white;
  border: 1px solid rgba(232, 97, 44, 0.3);
  color: var(--warm-orange);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
  position: relative;
}

/* Fix header map button visibility */
@media (max-width: 767px) {
  .header-map-btn {
    display: flex !important;
  }
}

/* Show floating map button on mobile */
@media (max-width: 767px) {
  .floating-map-btn {
    display: flex !important;
  }
}

/* Ensure header map button is hidden on desktop */
@media (min-width: 768px) {
  .header-map-btn {
    display: none !important;
  }
}

.header-map-btn:active {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(0.9);
}

.header-map-btn .restaurant-count {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #e53e3e;
  color: white;
  border-radius: 50%;
  min-width: 18px;
  height: 18px;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: bold;
  border: 1px solid white;
  padding: 0 2px;
}

.map-modal,
.map-header,
.map-content {
  will-change: transform, opacity;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {

  .map-modal,
  .map-header,
  .map-content {
    transition: none !important;
  }

  .map-modal.active {
    transform: none !important;
    opacity: 1 !important;
  }
}

/* User location indicator - mobile optimized */
.location-indicator {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 4px 8px;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  backdrop-filter: blur(10px);
}

.location-indicator i {
  margin-right: 4px;
  font-size: 0.7rem;
}

/* Chat container - full screen */
.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--warm-white);
  overflow: hidden;
}

/* Chat messages area */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* Message bubbles */
.message-container {
  display: flex;
  margin-bottom: 16px;
  transform: translateY(10px);
  opacity: 0;
  animation: messageSlideIn 0.3s ease-out forwards;
}

@keyframes messageSlideIn {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ai-avatar {
  width: 32px !important;
  height: 32px !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, var(--warm-orange), var(--warm-orange-light)) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: white !important;
  font-size: 14px !important;
  flex-shrink: 0 !important;
  margin-right: 10px !important;
}

.message-bubble {
  background: var(--cream);
  border-radius: 16px 16px 16px 4px;
  padding: 12px 16px;
  max-width: calc(100% - 50px);
  box-shadow: 0 2px 8px rgba(45, 42, 38, 0.08);
  border: 1px solid rgba(232, 97, 44, 0.1);
  backdrop-filter: blur(10px);
}

.user-message {
  justify-content: flex-end !important;
}

.user-message .message-bubble {
  background: linear-gradient(135deg, var(--warm-orange), var(--warm-orange-light)) !important;
  color: white !important;
  border-radius: 16px 16px 4px 16px !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  max-width: calc(100% - 50px) !important;
}

/* Suggestion chips - mobile optimized */
.suggestion-section {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
  margin: 0 16px;
}

.suggestion-section.expanded {
  max-height: 400px;
  padding-bottom: 16px;
  overflow-y: auto;
}

.suggestion-controls {
  padding: 12px 16px;
  background: rgba(247, 245, 243, 0.5);
  border-bottom: 1px solid rgba(232, 97, 44, 0.1);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.inspire-btn,
.clear-btn {
  background: var(--warm-orange);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.inspire-btn:active,
.clear-btn:active {
  transform: scale(0.98);
  background: #D55529;
}

.clear-btn {
  background: rgba(45, 42, 38, 0.7);
  display: none;
}

.suggestion-chip {
  background: #FFF4ED;
  border: 1px solid var(--warm-orange);
  color: var(--warm-orange);
  padding: 8px 12px;
  border-radius: 16px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  text-align: left;
  justify-content: flex-start;
  min-height: 44px;
  box-sizing: border-box;
  width: 100%;
  /* Ensure full width within grid cell */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;

}

.suggestion-chip:active {
  transform: scale(0.95);
}

.suggestion-chip.selected {
  background: var(--warm-orange);
  color: white;
  border-color: var(--warm-orange);
  font-weight: 600;
}

/* Category-specific colors */
.suggestion-chip[data-category="cuisine"] {
  background: var(--cuisine-bg);
  border-color: var(--cuisine-color);
  color: var(--cuisine-color);
}

.suggestion-chip[data-category="scenario"] {
  background: var(--scenario-bg);
  border-color: var(--scenario-color);
  color: var(--scenario-color);
}

.suggestion-chip[data-category="dietary"] {
  background: var(--dietary-bg);
  border-color: var(--dietary-color);
  color: var(--dietary-color);
}

.suggestion-chip[data-category="price"] {
  background: var(--price-bg);
  border-color: var(--price-color);
  color: var(--price-color);
}

/* Selected state for each category */
.suggestion-chip[data-category="cuisine"].selected {
  background: var(--cuisine-color);
  color: white;
  border-color: var(--cuisine-color);
  font-weight: 600;
}

.suggestion-chip[data-category="scenario"].selected {
  background: var(--scenario-color);
  color: white;
  border-color: var(--scenario-color);
  font-weight: 600;
}

.suggestion-chip[data-category="dietary"].selected {
  background: var(--dietary-color);
  color: white;
  border-color: var(--dietary-color);
  font-weight: 600;
}

.suggestion-chip[data-category="price"].selected {
  background: var(--price-color);
  color: white;
  border-color: var(--price-color);
  font-weight: 600;
}


.category-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--dark-brown);
  margin: 12px 0 8px 0;
  padding-left: 4px;
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.category-title::before {
  content: '';
  width: 3px;
  height: 16px;
  border-radius: 2px;
  background: var(--warm-orange);
}

/* Category-specific title indicators */
.category-title[data-category="cuisine"]::before {
  background: var(--cuisine-color);
}

.category-title[data-category="scenario"]::before {
  background: var(--scenario-color);
}

.category-title[data-category="dietary"]::before {
  background: var(--dietary-color);
}

.category-title[data-category="price"]::before {
  background: var(--price-color);
}

/* Desktop styles - revert to flex layout */
@media (min-width: 768px) {
  .category-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
  }

  .suggestion-chip {
    min-height: auto;
    padding: 6px 12px;
    font-size: 0.8rem;
    gap: 6px;
    width: auto;
    white-space: normal;
  }
}

/* Tablet and larger mobile - single column for very narrow screens */
@media (max-width: 320px) {
  .category-chips {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

@media (max-width: 767px) {
  .category-chips {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 6px 8px !important;
  }
}



/* Input area - mobile optimized */
.input-container {
  background: var(--warm-white);
  padding: 12px 16px;
  padding-bottom: calc(12px + var(--safe-area-bottom));
  border-top: 1px solid rgba(232, 97, 44, 0.1);
  box-shadow: 0 -2px 10px rgba(45, 42, 38, 0.05);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: flex-end;
  background: white;
  border-radius: 24px;
  border: 2px solid rgba(232, 97, 44, 0.2);
  overflow: hidden;
  transition: border-color 0.2s ease;
  min-height: 52px;
  max-height: 120px;
}

.input-wrapper:focus-within {
  border-color: var(--warm-orange);
  box-shadow: 0 0 0 4px rgba(232, 97, 44, 0.1);
}

#user-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 14px 16px;
  padding-right: 60px;
  font-size: 16px;
  /* Prevent zoom on iOS */
  background: transparent;
  color: var(--dark-brown);
  resize: none;
  overflow-y: auto;
  min-height: 24px;
  max-height: 88px;
  line-height: 1.4;
  word-wrap: break-word;
  white-space: pre-wrap;
}

#user-input::placeholder {
  color: rgba(45, 42, 38, 0.6);
}

.send-button {
  background: linear-gradient(135deg, var(--warm-orange), var(--warm-orange-light));
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  }

.send-button:active {
  transform: scale(0.9);
}

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

/* Floating map button - draggable, positioned to not take layout space */
.floating-map-btn {
  position: fixed; /* Fixed positioning doesn't affect layout flow */
  top: calc(20px + var(--safe-area-top)); /* Top-right position */
  right: 20px;
  width: 44px; /* Same size as send button */
  height: 44px; /* Same size as send button */
  background: linear-gradient(135deg, var(--warm-orange), var(--warm-orange-light));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 20px rgba(232, 97, 44, 0.4);
  cursor: grab; /* Drag cursor */
  z-index: 1000; /* High z-index to stay above content */
  transition: all 0.2s ease; /* Faster transition like send button */
  border: none;
  touch-action: none; /* Prevent default touch behaviors for dragging */
  user-select: none; /* Prevent text selection while dragging */
}

.floating-map-btn:active {
  transform: scale(0.9);
}

.floating-map-btn.dragging {
  cursor: grabbing;
  transition: none; /* Disable transitions while dragging */
  box-shadow: 0 8px 30px rgba(232, 97, 44, 0.6); /* Enhanced shadow while dragging */
}

.floating-map-btn.pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 4px 20px rgba(232, 97, 44, 0.4);
  }

  50% {
    box-shadow: 0 4px 20px rgba(232, 97, 44, 0.8);
    transform: scale(1.05);
  }

  100% {
    box-shadow: 0 4px 20px rgba(232, 97, 44, 0.4);
  }
}

.restaurant-count {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #e53e3e;
  color: white;
  border-radius: 50%;
  min-width: 20px; /* Smaller for smaller button */
  height: 20px; /* Smaller for smaller button */
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 10px; /* Smaller font for smaller badge */
  font-weight: bold;
  border: 2px solid white;
  padding: 0 2px; /* Reduced padding */
}

/* Map modal - embedded at top of screen to preserve restaurant cards below */
.map-modal {
  position: fixed;
  /* Position at top to avoid covering restaurant cards */
  top: calc(10px + var(--safe-area-top));
  left: 5%;
  right: 5%;
  height: 60vh; /* Fixed height instead of bottom positioning */
  max-height: 500px; /* Prevent being too tall on large screens */
  background: var(--warm-white);
  z-index: 2000;
  display: none;
  flex-direction: column;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(45, 42, 38, 0.3);

  /* Animation */
  opacity: 0;
  transform: translateY(-30px) scale(0.95);
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Full screen state for mobile */
.map-modal.full-screen {
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  height: 100vh; /* Override height for full screen */
  max-height: none; /* Remove height limit for full screen */
  border-radius: 0;
  transform: translateY(0) scale(1);
}

.map-modal.active {
  display: flex;
  opacity: 1;
  transform: translateY(0) scale(1);
}

.map-modal.active.full-screen {
  transform: translateY(0) scale(1);
}

.map-modal.closing {
  opacity: 0;
  transform: translateY(-30px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.55, 0.055, 0.675, 0.19);
  /* Different easing for closing */
}






/* Background overlay - subtle for embedded, stronger for full-screen */
.map-modal::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.05); /* Very subtle for embedded */
  backdrop-filter: blur(1px);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none; /* Ensure backdrop doesn't block interactions */
}

.map-modal.active::before {
  opacity: 1;
}

/* Stronger backdrop for full-screen mode */
.map-modal.full-screen::before {
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(3px);
}

.map-header {
  background: rgba(254, 252, 248, 0.8);
  backdrop-filter: blur(10px);
  color: var(--dark-brown);
  padding: calc(16px + var(--safe-area-top)) 16px 16px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  
  
  /* Keep only the animation properties */
  transform: translateY(-30px);
  opacity: 0;
  transition: all 0.3s ease;
  transition-delay: 0.1s;
}

.map-modal.active .map-header {
  transform: translateY(0);
  opacity: 1;
}

.map-modal.closing .map-header {
  transform: translateY(-30px);
  opacity: 0;
  transition: all 0.2s ease;
  transition-delay: 0s;
  /* No delay when closing */
}

.map-modal.closing .map-content {
  opacity: 0;
  transition: opacity 0.15s ease;
  transition-delay: 0s;
  /* Fade out quickly when closing */
}

.map-info h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 4px 0;
  color: var(--dark-brown);
  display: flex;
  align-items: center;
  gap: 8px;
}

.map-info h2::before {
  content: '🗺️';
  font-size: 1rem;
}

.map-info p {
  font-size: 0.85rem;
  margin: 0;
  color: rgba(45, 42, 38, 0.7);
  opacity: 1;
}




/* Map Modal Controls */
.map-modal-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.expand-map-btn,
.close-map-btn {
  background: white;
  border: 1px solid rgba(232, 97, 44, 0.3);
  color: var(--warm-orange);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
}

.expand-map-btn:active,
.close-map-btn:active {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(0.9);
}

.map-modal.closing .close-map-btn {
  transform: rotate(90deg);
  transition: transform 0.3s ease;
}

.map-content {
  flex: 1;
  position: relative;
  opacity: 0;
  transition: opacity 0.3s ease;
  transition-delay: 0.2s;

  margin-top: 0;
  padding-top: 0;
}

.map-modal.active .map-content {
  opacity: 1;
}

/* Location indicator in map header - consistent styling */
.map-header .location-indicator {
  background: rgba(232, 97, 44, 0.1) !important;
  color: var(--warm-orange) !important;
  border: 1px solid rgba(232, 97, 44, 0.2);
  font-size: 0.75rem;
}

.map-header .location-indicator:hover {
  background: rgba(232, 97, 44, 0.15) !important;
  border-color: var(--warm-orange);
}

.map-header .location-indicator span {
  color: var(--warm-orange) !important;
}

.map-header .location-indicator .fa-location-dot {
  color: var(--warm-orange) !important;
}

.map-header .location-indicator .fa-edit {
  color: var(--warm-orange) !important;
}


#map-modal-content {
  width: 100%;
  height: 100%;
}

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

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

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(232, 97, 44, 0.3);
  border-radius: 2px;
}

/* Original glass styling for compatibility */
.glass {
  background: var(--cream);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(232, 97, 44, 0.1);
  box-shadow: 0 4px 12px rgba(45, 42, 38, 0.08);
}

/* Desktop styles */
@media (min-width: 768px) {
  .mobile-container {
    height: 100vh;
    flex-direction: row;
    padding-top: 0;
  }

  .mobile-header {
    display: none; /* Header remains hidden on desktop since it's not needed */
  }

  /* Desktop map modal should always be full screen */
  .map-modal {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: 100vh;
    max-height: none;
    border-radius: 0;
  }

  /* Hide expand button on desktop since it's always full screen */
  .expand-map-btn {
    display: none;
  }

  .chat-container {
    width: 60%;
    border-radius: 12px;
    margin: 16px 0 16px 16px;
    background: var(--cream);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(232, 97, 44, 0.1);
    box-shadow: 0 4px 12px rgba(45, 42, 38, 0.08);
  }

  .chat-messages {
    padding: 24px;
  }

  .input-container {
    padding: 16px 24px;
    background: transparent;
    border-top: 1px solid rgba(232, 97, 44, 0.1);
  }

  .desktop-map {
    width: 40%;
    display: flex;
    flex-direction: column;
    margin: 16px 16px 16px 0;
    background: var(--cream);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(232, 97, 44, 0.1);
    box-shadow: 0 4px 12px rgba(45, 42, 38, 0.08);
    border-radius: 12px;
    padding: 16px;
  }

  .desktop-map h2 {
    color: var(--warm-orange);
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0 0 12px 0;
  }

  .desktop-map-info {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.75rem;
    color: var(--warm-orange);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  #map {
    flex: 1;
    border-radius: 8px;
    overflow: hidden;
  }

  .floating-map-btn {
    display: none;
  }

  .suggestion-section {
    margin: 0 24px;
  }

  .suggestion-controls {
    margin: 0 24px;
    padding: 16px 0;
    background: transparent;
    border: none;
  }
}

/* Mobile responsive - hide desktop map */
@media (max-width: 767px) {
  .desktop-map {
    display: none !important;
  }
}

/* Landscape mobile adjustments */
@media (max-width: 767px) and (orientation: landscape) {
  .mobile-header {
    padding: 8px 16px;
  }

  .mobile-header h1 {
    font-size: 1rem;
  }

  .suggestion-section.expanded {
    max-height: 200px;
  }
}

@media (max-width: 767px) {

  .suggestion-chip,
  .inspire-btn,
  .clear-btn,
  .send-button,
  .floating-map-btn,
  .close-map-btn {
    min-height: 44px;
    min-width: 44px;
  }
}

.message-bubble p {
  line-height: 1.5;
  margin: 0;
}

.message-bubble p+p {
  margin-top: 8px;
}

.typing-indicator,
.loading-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--warm-orange);
  font-style: italic;
  padding: 8px 0;
}

/* Loading states */
.loading-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.loading-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--warm-orange);
  opacity: 0.4;
  animation: loading 1.4s infinite ease-in-out;
}

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

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

@keyframes loading {

  0%,
  80%,
  100% {
    opacity: 0.4;
    transform: scale(0.8);
  }

  40% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Hidden class */
.hidden {
  display: none !important;
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

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

  .suggestion-chip {
    border-width: 2px;
  }
}

/* Mobile location indicator - ensure text is visible */
.location-indicator {
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 12px;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.3) !important;
  backdrop-filter: blur(10px);
  color: white !important;
  /* Ensure text is visible on mobile header */
}

.location-indicator:hover {
  background-color: rgba(255, 255, 255, 0.4) !important;
}

.location-indicator span {
  color: inherit !important;
}

.location-indicator .fa-edit {
  margin-left: 8px;
  font-size: 12px;
  opacity: 0.7;
  transition: opacity 0.2s;
  color: inherit !important;
}

.location-indicator:hover .fa-edit {
  opacity: 1;
}

/* Desktop location indicator - consistent with app style */
.desktop-location-indicator {
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(232, 97, 44, 0.2);
  margin-bottom: 12px;
  color: var(--warm-orange);
  font-size: 0.85rem;
  font-weight: 500;
}

.desktop-location-indicator:hover {
  background: rgba(255, 255, 255, 0.8);
  border-color: var(--warm-orange);
  box-shadow: 0 2px 8px rgba(232, 97, 44, 0.1);
}

.desktop-location-indicator .fa-location-dot {
  color: var(--warm-orange);
}

.desktop-location-indicator .fa-edit {
  font-size: 12px;
  opacity: 0.6;
  transition: opacity 0.2s;
  color: var(--warm-orange);
}

.desktop-location-indicator:hover .fa-edit {
  opacity: 1;
}

/* Location input containers - app-consistent styling */
#location-input-container,
.location-input-container {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px;
  background: var(--cream);
  border-radius: 12px;
  border: 1px solid rgba(232, 97, 44, 0.2);
  backdrop-filter: blur(12px);
}

/* Location input fields - consistent styling */
#location-input,
.location-input {
  flex: 1;
  min-width: 200px;
  padding: 10px 14px;
  border: 2px solid rgba(232, 97, 44, 0.2);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: all 0.2s ease;
  background-color: white !important;
  color: var(--dark-brown) !important;
  font-family: inherit;
}

#location-input:focus,
.location-input:focus {
  border-color: var(--warm-orange);
  box-shadow: 0 0 0 4px rgba(232, 97, 44, 0.1);
}

#location-input::placeholder,
.location-input::placeholder {
  color: rgba(45, 42, 38, 0.6) !important;
}

/* Location setting buttons - app-consistent styling */
.set-location-btn {
  background: linear-gradient(135deg, var(--warm-orange), var(--warm-orange-light));
  color: white;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  font-family: inherit;
}

.set-location-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(232, 97, 44, 0.3);
}

.set-location-btn:active {
  transform: scale(0.98);
}

.set-location-btn:disabled {
  background: rgba(45, 42, 38, 0.3);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.cancel-location-btn {
  background: rgba(45, 42, 38, 0.7);
  color: white;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  font-family: inherit;
}

.cancel-location-btn:hover {
  background: rgba(45, 42, 38, 0.9);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(45, 42, 38, 0.2);
}

.cancel-location-btn:active {
  transform: scale(0.98);
}

/* Mobile specific adjustments */
@media (max-width: 767px) {

  /* Mobile location input - inline style */
  #location-input-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 16px;
    margin: 12px 16px;
    border: 2px solid var(--warm-orange);
    box-shadow: 0 4px 12px rgba(232, 97, 44, 0.2);
    animation: slideDownFade 0.3s ease-out;
  }

  @keyframes slideDownFade {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* Input field */
  #location-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid rgba(232, 97, 44, 0.2);
    border-radius: 10px;
    font-size: 16px;
    outline: none;
    transition: all 0.2s ease;
    background: white;
    color: var(--dark-brown);
    font-family: inherit;
    margin-bottom: 12px;
    box-sizing: border-box;
  }

  #location-input:focus {
    border-color: var(--warm-orange);
    box-shadow: 0 0 0 3px rgba(232, 97, 44, 0.1);
  }

  #location-input::placeholder {
    color: rgba(45, 42, 38, 0.5);
  }

  /* Button container */
  #location-input-container .location-buttons {
    display: flex;
    gap: 10px;
  }

  /* Buttons */
  .set-location-btn,
  .cancel-location-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
  }

  .set-location-btn {
    background: linear-gradient(135deg, var(--warm-orange), var(--warm-orange-light));
    color: white;
    box-shadow: 0 2px 8px rgba(232, 97, 44, 0.3);
  }

  .set-location-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 4px rgba(232, 97, 44, 0.3);
  }

  .set-location-btn:disabled {
    background: rgba(45, 42, 38, 0.3);
    color: rgba(255, 255, 255, 0.7);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
  }

  .cancel-location-btn {
    background: rgba(45, 42, 38, 0.1);
    color: var(--dark-brown);
    border: 1px solid rgba(45, 42, 38, 0.2);
  }

  .cancel-location-btn:active {
    background: rgba(45, 42, 38, 0.2);
    transform: translateY(1px);
  }
}

/* Desktop specific adjustments */
@media (min-width: 768px) {

  /* Desktop location container */
  .desktop-location-container {
    margin-bottom: 16px;
  }

  /* Desktop input container */
  #desktop-location-input-container {
    margin: 8px 0;
    background: white;
    border: 2px solid rgba(232, 97, 44, 0.2);
    border-radius: 8px;
    padding: 12px;
  }

  #desktop-location-input {
    margin-bottom: 8px;
  }

  /* Desktop buttons in row */
  .desktop-location-container .location-input-container {
    flex-direction: row;
    gap: 8px;
  }

  .desktop-location-container .set-location-btn,
  .desktop-location-container .cancel-location-btn {
    flex: 1;
  }
}

.map-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: rgba(45, 42, 38, 0.8);
  margin: 4px 0;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-item i {
  color: var(--warm-orange);
  font-size: 0.75rem;
}

.stat-divider {
  color: rgba(45, 42, 38, 0.4);
  font-weight: bold;
}