/* Fixed Station Route Mode Selection Styles */

/* Route Mode Selection */
.route-mode-selection {
  margin-bottom: 1.5rem;
}

.route-mode-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.radio-option {
  display: flex;
  align-items: flex-start;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.radio-option:hover {
  background: rgba(0, 0, 0, 0.4);
  border-color: rgba(196, 18, 48, 0.5);
}

.radio-option input[type="radio"] {
  margin-top: 4px;
  margin-right: 10px;
  cursor: pointer;
}

.radio-option input[type="radio"]:checked + .radio-label {
  color: var(--primary-color);
  font-weight: 600;
}

.radio-option:has(input[type="radio"]:checked) {
  background: rgba(196, 18, 48, 0.2);
  border-color: var(--primary-color);
  border-width: 2px;
}

.radio-label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
  color: rgba(255, 255, 255, 0.9) !important;
}

.radio-label strong {
  display: block;
  font-size: 1rem;
  color: #ffffff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.radio-label small {
  color: rgba(255, 255, 255, 0.7) !important;
  font-size: 0.875rem;
}

/* Fixed Station Selectors */
.fixed-station-section {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: rgba(196, 18, 48, 0.05);
  border-radius: 8px;
  border: 2px dashed rgba(196, 18, 48, 0.3);
  transition: all 0.3s ease;
}

.fixed-station-section.hidden {
  display: none;
}

.fixed-station-section label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 1rem;
  color: #ffffff;
}

.fixed-station-section small {
  display: block;
  margin-top: 0.5rem;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.875rem;
  font-style: italic;
}

/* Autocomplete wrapper for proper positioning */
.autocomplete-wrapper {
  position: relative;
  width: 100%;
}

/* Station Line Indicators */
.station-line-indicator {
  display: inline-flex;
  gap: 0.25rem;
  margin-left: 0.5rem;
  flex-wrap: wrap;
}

.line-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Autocomplete Input */
.station-input-autocomplete {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  border: 2px solid rgba(196, 18, 48, 0.3);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  color: #1a1a1a;
  transition: all 0.2s ease;
}

.station-input-autocomplete:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(196, 18, 48, 0.1);
  background: rgba(255, 255, 255, 1);
}

.station-input-autocomplete::placeholder {
  color: rgba(0, 0, 0, 0.5);
}

/* Autocomplete Dropdown */
.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 300px;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid var(--primary-color);
  border-radius: 8px;
  margin-top: 0.25rem;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.autocomplete-dropdown.hidden {
  display: none;
}

.autocomplete-item {
  padding: 0.75rem 1rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.15s ease;
  color: #1a1a1a;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
  background: rgba(196, 18, 48, 0.15);
  color: #000000;
}

.autocomplete-item-name {
  font-weight: 500;
  color: #1a1a1a;
}

.autocomplete-item-lines {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

/* Info Messages */
.info-message {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 8px;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  border: 2px solid;
}

.info-message.hidden {
  display: none;
}

.info-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.warning-text {
  color: #ff9800;
  background: rgba(255, 152, 0, 0.1);
  border-color: rgba(255, 152, 0, 0.3);
}

.error-text {
  color: #f44336;
  background: rgba(244, 67, 54, 0.1);
  border-color: rgba(244, 67, 54, 0.3);
}

.success-text {
  color: #4caf50;
  background: rgba(76, 175, 80, 0.1);
  border-color: rgba(76, 175, 80, 0.3);
}

.info-text {
  color: #2196f3;
  background: rgba(33, 150, 243, 0.1);
  border-color: rgba(33, 150, 243, 0.3);
}

/* Loop Route Indicator */
.loop-indicator {
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.1), rgba(33, 150, 243, 0.1));
  border-color: rgba(76, 175, 80, 0.3);
}

.loop-indicator .info-icon {
  animation: rotate 3s linear infinite;
}

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

/* Loop Route Display */
.route-header.loop-route {
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.2), rgba(33, 150, 243, 0.2));
  border-left: 4px solid #4caf50;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.station-item.loop-start {
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.2), rgba(33, 150, 243, 0.2));
  border: 2px solid #4caf50;
}

.loop-return-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  background: rgba(76, 175, 80, 0.1);
  border-radius: 8px;
  margin-top: 0.5rem;
  border: 2px dashed #4caf50;
}

.return-arrow {
  font-size: 1.5rem;
  color: #4caf50;
}

.return-text {
  font-weight: 600;
  color: #4caf50;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .route-mode-options {
    grid-template-columns: 1fr;
  }

  .radio-option {
    padding: 0.75rem;
  }

  .fixed-station-section {
    padding: 1rem;
  }

  .autocomplete-dropdown {
    max-height: 200px;
  }
}

@media (max-width: 480px) {
  .radio-label strong {
    font-size: 0.9rem;
  }

  .radio-label small {
    font-size: 0.8rem;
  }

  .station-input-autocomplete {
    font-size: 0.9rem;
    padding: 0.6rem;
  }
}
