/* Styles for the enhanced NLP features */

/* Base styling and variables */
:root {
  --primary-color: #3887be;
  --primary-dark: #2d6a94;
  --secondary-color: #4CAF50;
  --light-bg: #f8f9fa;
  --light-blue-bg: #f0f7ff;
  --border-color: #cce5ff;
  --text-color: #333;
  --border-radius: 4px;
  --transition-speed: 0.3s;
}

* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  margin: 0;
  padding: 0;
  color: var(--text-color);
  line-height: 1.6;
  background-color: #f9f9f9;
  transition: all var(--transition-speed) ease;
}

/* Responsive containers */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* Message container */
.message-container {
  margin: 15px 0;
  padding: 15px;
  background-color: var(--light-bg);
  border-left: 4px solid var(--secondary-color);
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
  transition: all var(--transition-speed) ease;
  color: var(--text-color);
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Location chips styling */
.location-chips-container {
  margin: 15px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.location-chip {
  display: inline-block;
  background-color: var(--light-blue-bg);
  border-radius: 20px;
  padding: 10px 15px; /* Increased for better touch targets */
  margin: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  color: var(--primary-color);
  min-height: 44px; /* Mobile-friendly touch target */
  display: flex;
  align-items: center;
  justify-content: center;
}

.location-chip:hover {
  background-color: #dbeeff;
  border-color: var(--primary-color);
}

.location-chip.selected {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-dark);
}

.route-info {
  margin-top: 15px;
  padding: 15px;
  background-color: var(--light-blue-bg);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  font-size: 14px;
  line-height: 1.5;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Header styles */
header {
  background-color: white;
  padding: 20px 15px;
  text-align: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  position: relative;
  z-index: 10;
}

header h1 {
  margin: 0;
  font-size: 24px;
  color: var(--primary-color);
}

header .subtitle {
  margin: 10px 0 0;
  font-size: 16px;
  color: #666;
}

/* Input section styling - Mobile first approach */
.input-section {
  background-color: white;
  padding: 15px;
  border-radius: var(--border-radius);
  margin: 15px auto;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  max-width: 100%;
}

.input-wrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

#nlp-input {
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: var(--border-radius);
  font-size: 16px;
  flex-grow: 1;
  min-height: 44px; /* Mobile-friendly touch target */
}

#process-btn {
  padding: 12px 20px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 16px;
  transition: background-color var(--transition-speed) ease;
  min-height: 44px; /* Mobile-friendly touch target */
}

#process-btn:hover {
  background-color: var(--primary-dark);
}

/* Clear results button */
#clear-results-btn {
  padding: 10px 15px;
  background-color: #f8f9fa;
  color: #666;
  border: 1px solid #ddd;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 14px;
  transition: all var(--transition-speed) ease;
  margin-top: 10px;
  min-height: 44px; /* Mobile-friendly touch target */
}

#clear-results-btn:hover {
  background-color: #e9ecef;
  color: #333;
}

/* Visualization options */
.visualization-options {
  margin-top: 15px;
}

.option-label {
  font-weight: 500;
  margin-bottom: 8px;
}

.viz-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.viz-option {
  padding: 10px 15px;
  background-color: #f8f9fa;
  border: 1px solid #ddd;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  min-height: 44px; /* Mobile-friendly touch target */
  display: flex;
  align-items: center;
  justify-content: center;
}

.viz-option.selected {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-dark);
}

.viz-option:hover:not(.selected) {
  background-color: #e9ecef;
}

/* Examples styling */
.info-box {
  background-color: white;
  padding: 15px;
  border-radius: var(--border-radius);
  margin: 15px auto;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.examples-container {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.example {
  display: inline-block;
  padding: 10px 15px;
  background-color: var(--light-blue-bg);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: background-color 0.2s ease;
  font-size: 14px;
  border: 1px solid var(--border-color);
  min-height: 44px; /* Mobile-friendly touch target */
  display: flex;
  align-items: center;
  justify-content: center;
}

.example:hover {
  background-color: #dbeeff;
}

/* Map container */
#map {
  width: 100%;
  height: 400px;
  border-radius: var(--border-radius);
  margin: 15px 0;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Loading indicator */
#loading-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: var(--border-radius);
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  margin: 15px auto;
  animation: fadeIn 0.3s ease;
}

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

.spinner {
  border: 4px solid rgba(0, 0, 0, 0.1);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border-left-color: var(--primary-color);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-text {
  margin-top: 10px;
  font-size: 14px;
  color: #666;
}

/* Debug section - now collapsible */
.debug-section {
  background-color: white;
  border-radius: var(--border-radius);
  margin: 15px auto;
  padding: 0;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  overflow: hidden;
  transition: max-height var(--transition-speed) ease;
  max-height: 40px; /* Collapsed by default */
}

.debug-section.expanded {
  max-height: 500px;
}

.debug-section h3 {
  margin: 0;
  padding: 10px 15px;
  background-color: #f8f9fa;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.debug-section h3:after {
  content: "▼";
  font-size: 12px;
  transition: transform var(--transition-speed) ease;
}

.debug-section.expanded h3:after {
  transform: rotate(180deg);
}

.debug-controls {
  padding: 15px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.debug-controls button {
  padding: 8px 12px;
  background-color: #f8f9fa;
  border: 1px solid #ddd;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 14px;
  min-height: 44px; /* Mobile-friendly touch target */
}

.debug-controls button:hover {
  background-color: #e9ecef;
}

#debug-info {
  margin: 0 15px 15px;
  padding: 10px;
  background-color: #f8f9fa;
  border: 1px solid #ddd;
  border-radius: var(--border-radius);
  font-family: monospace;
  font-size: 12px;
  white-space: pre-wrap;
  max-height: 200px;
  overflow-y: auto;
}

/* Map verification tools */
#map-verification {
  background-color: white;
  border-radius: var(--border-radius);
  margin: 15px auto;
  padding: 0;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  overflow: hidden;
  transition: max-height var(--transition-speed) ease;
  max-height: 40px; /* Collapsed by default */
}

#map-verification.expanded {
  max-height: 300px;
}

#map-verification h3 {
  margin: 0;
  padding: 10px 15px;
  background-color: #f8f9fa;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#map-verification h3:after {
  content: "▼";
  font-size: 12px;
  transition: transform var(--transition-speed) ease;
}

#map-verification.expanded h3:after {
  transform: rotate(180deg);
}

.verification-tools {
  padding: 15px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.verification-tools button {
  padding: 8px 12px;
  background-color: #f8f9fa;
  border: 1px solid #ddd;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 14px;
  min-height: 44px; /* Mobile-friendly touch target */
}

.verification-tools button:hover {
  background-color: #e9ecef;
}

#map-check-result {
  margin: 0 15px 15px;
  padding: 10px;
  background-color: #f8f9fa;
  border: 1px solid #ddd;
  border-radius: var(--border-radius);
}

/* User history section */
.history-section {
  background-color: white;
  border-radius: var(--border-radius);
  margin: 15px auto;
  padding: 15px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.history-items {
  margin-top: 10px;
}

.history-item {
  padding: 10px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  transition: background-color 0.2s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.history-item:hover {
  background-color: #f8f9fa;
}

.history-query {
  flex-grow: 1;
}

.history-delete {
  color: #dc3545;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 5px 10px;
}

/* Share button */
.share-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 15px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 14px;
  transition: background-color var(--transition-speed) ease;
  margin-top: 10px;
  min-height: 44px; /* Mobile-friendly touch target */
}

.share-button:hover {
  background-color: var(--primary-dark);
}

.share-button svg {
  margin-right: 5px;
}

/* Media queries for responsive design */
@media (min-width: 768px) {
  header h1 {
    font-size: 28px;
  }
  
  .input-wrapper {
    flex-direction: row;
  }
  
#map {
    height: 500px;
  }
  
  .debug-section, #map-verification {
    max-height: 43px; /* Slightly larger for desktop */
  }
}

@media (min-width: 992px) {
  header h1 {
    font-size: 32px;
  }
  
  #map {
    height: 600px;
  }
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  :root {
    --light-bg: #2c2c2c;
    --light-blue-bg: #223446;
    --border-color: #3a3a3a;
    --text-color: #e0e0e0;
  }
  
  body {
    background-color: #1a1a1a;
    color: var(--text-color);
  }
  
  header, .input-section, .info-box, .debug-section, #map-verification, .history-section {
    background-color: #2c2c2c;
  }
  
  #nlp-input {
    background-color: #333;
    color: #e0e0e0;
    border-color: #444;
  }
  
  .debug-section h3, #map-verification h3, .debug-controls button, .verification-tools button, #clear-results-btn {
    background-color: #333;
    color: #e0e0e0;
  }
  
  .viz-option, .example, #debug-info, #map-check-result {
    background-color: #333;
    color: #e0e0e0;
    border-color: #444;
  }
  
  .viz-option:hover:not(.selected), .example:hover, .debug-controls button:hover, .verification-tools button:hover {
    background-color: #444;
  }
  
  .history-item {
    border-color: #333;
  }
  
  .history-item:hover {
    background-color: #333;
  }
}

/* Animations */
@keyframes slideInRight {
  from {
    transform: translateX(20px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.message-container, .location-chips-container {
  animation: slideInRight 0.3s ease forwards;
}

/* Transparent Mode Styles */
.transparent-mode-indicator {
    display: none;
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    pointer-events: none;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.3s ease-in-out;
    text-align: center;
}

.transparent-mode-active .transparent-mode-indicator {
    display: block;
}

.transparent-mode-active #map {
    background-image: repeating-linear-gradient(
        45deg,
        rgba(0, 0, 0, 0.03),
        rgba(0, 0, 0, 0.03) 10px,
        rgba(255, 255, 255, 0.03) 10px,
        rgba(255, 255, 255, 0.03) 20px
    );
}

.transparent-mode-active .mapboxgl-canvas {
    border: 2px dashed rgba(56, 135, 190, 0.5);
    border-radius: 4px;
}

.transparent-mode-active .viz-option[data-type="transparent"] {
    background-color: #3887be;
    color: white;
    box-shadow: 0 0 0 2px rgba(56, 135, 190, 0.4);
}

/* Animation for transparent mode indicator */
@keyframes fadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Route Type Indicators */
.route-type-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    background-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    z-index: 5;
}

.route-type-indicator.driving {
    color: #3887be;
    border-left: 4px solid #3887be;
}

.route-type-indicator.air {
    color: #e91e63;
    border-left: 4px solid #e91e63;
}

.route-type-indicator.sea {
    color: #009688;
    border-left: 4px solid #009688;
}

.route-type-indicator:before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 8px;
    background-size: contain;
    background-repeat: no-repeat;
}

.route-type-indicator.driving:before {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%233887be"><path d="M18.92 6.01C18.72 5.42 18.16 5 17.5 5h-11c-.66 0-1.21.42-1.42 1.01L3 12v8c0 .55.45 1 1 1h1c.55 0 1-.45 1-1v-1h12v1c0 .55.45 1 1 1h1c.55 0 1-.45 1-1v-8l-2.08-5.99zM6.5 16c-.83 0-1.5-.67-1.5-1.5S5.67 13 6.5 13s1.5.67 1.5 1.5S7.33 16 6.5 16zm11 0c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5zM5 11l1.5-4.5h11L19 11H5z"/></svg>');
}

.route-type-indicator.air:before {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23e91e63"><path d="M21 16v-2l-8-5V3.5c0-.83-.67-1.5-1.5-1.5S10 2.67 10 3.5V9l-8 5v2l8-2.5V19l-2 1.5V22l3.5-1 3.5 1v-1.5L13 19v-5.5l8 2.5z"/></svg>');
}

.route-type-indicator.sea:before {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23009688"><path d="M20 21c-1.39 0-2.78-.47-4-1.32-2.44 1.71-5.56 1.71-8 0C6.78 20.53 5.39 21 4 21H2v2h2c1.38 0 2.74-.35 4-.99 2.52 1.29 5.48 1.29 8 0 1.26.65 2.62.99 4 .99h2v-2h-2zM3.95 19H4c1.6 0 3.02-.88 4-2 .98 1.12 2.4 2 4 2s3.02-.88 4-2c.98 1.12 2.4 2 4 2h.05l1.89-6.68c.08-.26.06-.54-.06-.78s-.34-.42-.6-.5L20 10.62V6c0-1.1-.9-2-2-2h-3V1H9v3H6c-1.1 0-2 .9-2 2v4.62l-1.29.42c-.26.08-.48.26-.6.5s-.15.52-.06.78L3.95 19zM6 6h12v3.97L12 8 6 9.97V6z"/></svg>');
} 