/* Route Search Panel Styles */
.route-search-panel {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 420px;
  background: white;
  border: 1px solid black;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  overflow: hidden;
}

.route-search-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: white;
  color: black;
  border-bottom: 1px solid black;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s;
}

.route-search-header:hover {
  background: #f5f5f5;
}

.route-search-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 16px;
}

.route-search-title i {
  font-size: 18px;
}

.route-search-toggle {
  font-size: 18px;
  transition: transform 0.3s;
}

.route-search-panel.collapsed .route-search-toggle {
  transform: rotate(180deg);
}

.route-search-panel.collapsed .route-search-content {
  max-height: 0;
  overflow: hidden;
}

.route-search-content {
  padding: 20px;
  max-height: 600px;
  overflow-y: auto;
  background: white;
  transition: max-height 0.3s ease-out;
}

.search-input-group {
  margin-bottom: 16px;
  position: relative;
}

.search-input-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: black;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.search-input-group input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.2s ease;
  box-sizing: border-box;
  background: white;
  color: black;
}

.search-input-group input:focus {
  outline: none;
  border-color: black;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.search-input-group input::placeholder {
  color: #999;
}

/* Travel Mode Selector Styles */
.travel-mode-selector {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.travel-mode-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  background: white;
  border: 2px solid #ddd;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 11px;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.travel-mode-btn:hover {
  border-color: black;
  background: #f8f9fa;
}

.travel-mode-btn.active {
  border-color: black;
  background: black;
  color: white;
}

.travel-mode-btn i {
  font-size: 20px;
  transition: transform 0.2s ease;
}

.travel-mode-btn:hover i {
  transform: scale(1.1);
}

.travel-mode-btn.active i {
  color: white;
}

.travel-mode-btn span {
  font-size: 11px;
}

.search-route-btn {
  width: 100%;
  padding: 12px;
  background: black;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.search-route-btn:hover {
  background: #333;
}

.search-route-btn:active {
  transform: scale(0.98);
}

.search-route-btn:disabled {
  background: #ccc;
  color: #666;
  cursor: not-allowed;
}

.search-route-btn i {
  font-size: 14px;
}

.route-results {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e9ecef;
}

.route-result-item {
  padding: 12px 14px;
  background: #f8f9fa;
  border-radius: 6px;
  margin-bottom: 10px;
  border-left: 3px solid black;
  transition: background 0.2s ease;
}

.route-result-item:hover {
  background: #e9ecef;
}

.route-result-item h4 {
  margin: 0 0 6px 0;
  font-size: 13px;
  color: black;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.route-result-item p {
  margin: 4px 0;
  font-size: 12px;
  color: #333;
  line-height: 1.4;
}

.route-result-coords {
  font-family: 'Courier New', monospace;
  font-size: 10px;
  color: #333;
  background: white;
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid #ddd;
  display: inline-block;
  margin-top: 6px;
  font-weight: 500;
}

.route-error {
  padding: 12px;
  background: #fff3cd;
  border-left: 3px solid #856404;
  border-radius: 6px;
  color: #856404;
  font-size: 12px;
  display: flex;
  align-items: start;
  gap: 8px;
}

.route-error i {
  margin-top: 2px;
}

.route-loading {
  text-align: center;
  padding: 20px;
  color: #666;
}

.route-loading i {
  font-size: 32px;
  color: black;
  animation: spin 1s linear infinite;
}

.route-loading p {
  margin-top: 12px;
  font-size: 13px;
  color: #666;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.route-distance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: #f8f9fa;
  border-radius: 6px;
  margin-top: 10px;
  font-size: 13px;
  border: 1px solid #ddd;
}

.route-distance strong {
  color: black;
  font-size: 15px;
  font-weight: 700;
}

.clear-route-btn {
  width: 100%;
  padding: 10px;
  margin-top: 12px;
  background: white;
  color: black;
  border: 1px solid black;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.clear-route-btn:hover {
  background: #f5f5f5;
}

/* Autocomplete dropdown styling */
.pac-container {
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  margin-top: 4px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  border: 1px solid #ddd;
  border-top: none;
}

.pac-item {
  padding: 10px 12px;
  border-top: 1px solid #e9ecef;
  font-size: 13px;
  cursor: pointer;
}

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

.pac-item-query {
  font-size: 13px;
  font-weight: 600;
  color: black;
}

.pac-icon {
  margin-top: 6px;
}

/* Route Alternative Styles */
.route-alternative {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 12px;
  transition: all 0.2s ease;
}

.route-alternative:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-color: #ddd;
}

.route-alt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 14px;
  color: black;
}

.route-alt-header strong {
  font-weight: 600;
}

.route-badge {
  background: black;
  color: white;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.route-alt-details {
  display: flex;
  gap: 16px;
  margin-bottom: 8px;
}

.route-alt-detail {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #333;
}

.route-alt-detail i {
  color: #666;
  font-size: 12px;
}

.route-alt-detail span {
  font-weight: 500;
}

.route-alt-summary {
  font-size: 12px;
  color: #666;
  font-style: italic;
  padding-top: 8px;
  border-top: 1px solid #f5f5f5;
}

/* Pagination Styles */
.route-pagination-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  margin: 16px 0 12px 0;
}

.pagination-controls {
  display: flex;
  gap: 8px;
}

.pagination-btn {
  width: 32px;
  height: 32px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: black;
}

.pagination-btn:hover:not(:disabled) {
  background: black;
  color: white;
  border-color: black;
}

.pagination-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.pagination-btn i {
  font-size: 12px;
}

.route-alternative.active {
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Turn-by-turn Instructions Styles */
.route-instructions-section {
  margin-top: 12px;
  border-top: 1px solid #f5f5f5;
  padding-top: 12px;
}

.toggle-instructions-btn {
  width: 100%;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: black;
  transition: all 0.2s ease;
  text-align: left;
}

.toggle-instructions-btn:hover {
  background: #e9ecef;
  border-color: #ddd;
}

.toggle-instructions-btn i {
  font-size: 10px;
  transition: transform 0.2s;
}

.route-instructions-content {
  margin-top: 12px;
  max-height: 400px;
  overflow-y: auto;
}

.instructions-loading {
  text-align: center;
  padding: 20px;
  color: #666;
  font-size: 13px;
}

.instructions-loading i {
  margin-right: 8px;
}

.instructions-error {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 4px;
  padding: 10px 12px;
  margin-bottom: 12px;
  color: #856404;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Weather Summary Styles */
.weather-summary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 6px;
  padding: 14px;
  margin-bottom: 16px;
  color: white;
}

.weather-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 14px;
}

.weather-header i {
  font-size: 18px;
}

.weather-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.weather-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.15);
  padding: 8px 10px;
  border-radius: 4px;
}

.weather-item i {
  font-size: 14px;
  opacity: 0.9;
}

.weather-warning {
  background: rgba(255, 193, 7, 0.2);
  border: 1px solid rgba(255, 193, 7, 0.4);
  border-radius: 4px;
  padding: 10px 12px;
  margin-top: 12px;
  font-size: 12px;
  display: flex;
  align-items: start;
  gap: 8px;
}

.weather-warning i {
  margin-top: 2px;
  color: #ffc107;
  font-size: 14px;
}

.weather-warning strong {
  display: block;
  margin-bottom: 4px;
}

/* Instruction Steps Styles */
.instructions-list {
  margin-top: 8px;
}

.instruction-step {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  margin-bottom: 8px;
  transition: all 0.2s ease;
}

.instruction-step.has-weather-impact {
  border-left: 3px solid #ffc107;
  background: #fffbf0;
}

.instruction-step:hover {
  background: #f8f9fa;
  border-color: #ddd;
}

.instruction-step.has-weather-impact:hover {
  background: #fff8e1;
}

.step-number {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  background: black;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.step-content {
  flex: 1;
  min-width: 0;
}

.step-instruction {
  font-size: 13px;
  color: black;
  font-weight: 500;
  margin-bottom: 6px;
  line-height: 1.4;
}

.step-details {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: #666;
}

.step-details span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.step-details i {
  font-size: 10px;
  color: #999;
}

/* Step-level Weather Styles - Compact Version */
.step-weather.compact {
  margin-top: 10px;
  padding: 0;
  background: transparent;
  border-radius: 0;
  color: inherit;
}

.step-weather-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.weather-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
}

.weather-badge i {
  font-size: 10px;
  color: #666;
}

.weather-badge.warning {
  background: #fff3cd;
  border-color: #ffc107;
  color: #856404;
}

.weather-badge.warning i {
  color: #ffc107;
}

.weather-badge.alert {
  background: #d1ecf1;
  border-color: #17a2b8;
  color: #0c5460;
}

.weather-badge.alert i {
  color: #17a2b8;
}

.weather-badge.danger {
  background: #f8d7da;
  border-color: #dc3545;
  color: #721c24;
  animation: pulse 2s infinite;
}

.weather-badge.danger i {
  color: #dc3545;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.step-weather-alert {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 500;
  color: #856404;
  margin-top: 6px;
}

.step-weather-alert i {
  color: #ffc107;
  font-size: 11px;
  flex-shrink: 0;
}

/* Old weather styles - keep for backward compatibility but hidden */
.step-weather:not(.compact) {
  display: none;
}

/* Gemini AI Analysis Styles - Professional Panel */
.gemini-analysis {
  margin-top: 16px;
  padding: 0;
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.gemini-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-size: 14px;
  font-weight: 600;
  border-bottom: 1px solid #ddd;
}

.gemini-header i {
  font-size: 18px;
}

.gemini-header strong {
  flex: 1;
}

.safety-score {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
}

.safety-score.score-high {
  background: #10b981;
  color: white;
}

.safety-score.score-medium {
  background: #fbbf24;
  color: #000;
}

.safety-score.score-low {
  background: #ef4444;
  color: white;
}

.gemini-analysis-text {
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 12px;
  background: #f8f9fa;
  padding: 12px;
  border-radius: 6px;
  color: #333;
}

.gemini-pros-cons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.gemini-pros,
.gemini-cons {
  font-size: 12px;
  background: #f8f9fa;
  padding: 12px;
  border-radius: 6px;
}

.gemini-pros strong,
.gemini-cons strong {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 13px;
  color: #333;
}

.gemini-pros i {
  color: #10b981;
}

.gemini-cons i {
  color: #f59e0b;
}

.gemini-pros ul,
.gemini-cons ul {
  margin: 0;
  padding-left: 20px;
  list-style: none;
}

.gemini-pros ul li,
.gemini-cons ul li {
  margin-bottom: 6px;
  line-height: 1.5;
  position: relative;
  color: #555;
}

.gemini-pros ul li::before {
  content: "✓";
  position: absolute;
  left: -18px;
  color: #10b981;
  font-weight: bold;
  font-size: 14px;
}

.gemini-cons ul li::before {
  content: "⚠";
  position: absolute;
  left: -18px;
  color: #f59e0b;
  font-weight: bold;
  font-size: 12px;
}

.gemini-recommendation {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-radius: 6px;
  padding: 12px;
  display: flex;
  align-items: start;
  gap: 10px;
  color: white;
}

.gemini-recommendation i {
  color: #ffd700;
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

.gemini-recommendation strong {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
}

.gemini-recommendation p {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  opacity: 0.95;
}

.gemini-content {
  padding: 16px;
}

.gemini-loading {
  text-align: center;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 6px;
  color: #666;
  font-size: 12px;
  margin-top: 12px;
}

.gemini-loading i {
  margin-right: 6px;
  color: #667eea;
}

/* Transit Details Styles */
.instruction-step.transit-step {
  border-left: 3px solid #1976d2;
  background: #f0f7ff;
}

.instruction-step.transit-step:hover {
  background: #e3f2fd;
}

.transit-details {
  margin-top: 12px;
  padding: 12px;
  background: white;
  border-radius: 6px;
  border: 1px solid #90caf9;
}

.transit-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e3f2fd;
}

.transit-route-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 16px;
  font-weight: 700;
  font-size: 13px;
  color: white;
  white-space: nowrap;
}

.transit-route-badge i {
  font-size: 14px;
}

.transit-route-badge .route-number {
  font-size: 14px;
  font-weight: 700;
}

/* Vehicle type colors */
.vehicle-bus {
  background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
}

.vehicle-subway {
  background: linear-gradient(135deg, #f57c00 0%, #ef6c00 100%);
}

.vehicle-train {
  background: linear-gradient(135deg, #7b1fa2 0%, #6a1b9a 100%);
}

.vehicle-tram {
  background: linear-gradient(135deg, #00897b 0%, #00796b 100%);
}

.vehicle-rail {
  background: linear-gradient(135deg, #5d4037 0%, #4e342e 100%);
}

.vehicle-ferry {
  background: linear-gradient(135deg, #0288d1 0%, #0277bd 100%);
}

.vehicle-cable-car {
  background: linear-gradient(135deg, #c62828 0%, #b71c1c 100%);
}

.transit-line-name {
  flex: 1;
  font-size: 12px;
  color: #666;
  font-weight: 500;
}

/* Transit Stops Header (Always Expanded) */
.transit-stops-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #e3f2fd;
  border: 1px solid #90caf9;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #1976d2;
  margin-bottom: 12px;
}

.transit-stops-header i {
  font-size: 12px;
  color: #1976d2;
}

.transit-stops-header .stop-count {
  flex: 1;
  text-align: left;
  font-weight: 600;
}

/* Transit Stops Container */
.transit-stops {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: none;
  overflow: visible;
}

.transit-stop {
  display: flex;
  align-items: start;
  gap: 10px;
  transition: background 0.2s ease;
}

.transit-stop.departure:hover,
.transit-stop.arrival:hover {
  background: #e3f2fd;
  border-radius: 4px;
  padding: 4px;
  margin: -4px;
}

.transit-stop i.fa-circle {
  font-size: 10px;
  margin-top: 5px;
  flex-shrink: 0;
}

.transit-stop.departure i {
  color: #4caf50;
}

.transit-stop.arrival i {
  color: #f44336;
}

.transit-stop.intermediate i {
  color: #1976d2;
  font-size: 6px;
}

.transit-stop.intermediate .stop-name {
  font-size: 11px;
  color: #555;
  font-weight: 500;
}

.stop-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.stop-label {
  font-size: 10px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.stop-name {
  font-size: 12px;
  color: #333;
  font-weight: 600;
}

.stop-time {
  font-size: 11px;
  color: #666;
  font-family: 'Courier New', monospace;
}

.transit-journey {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0 6px 13px;
  color: #999;
}

.transit-journey i {
  font-size: 14px;
}

.intermediate-stops {
  font-size: 11px;
  color: #666;
  font-weight: 500;
  font-style: italic;
}

.transit-headsign {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e3f2fd;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #1976d2;
  font-weight: 600;
}

.transit-headsign i {
  font-size: 10px;
}
