/* Route Results UI Styles - Apple Maps Inspired */

/* ===== SHARED COMPONENTS ===== */

.back-button {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: #007AFF;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  padding: 8px 0;
  margin: 0;
  min-width: auto;
  transition: opacity 0.2s ease;
}

.back-button:hover {
  opacity: 0.7;
  background: none;
  transform: none;
  box-shadow: none;
}

.back-button svg {
  flex-shrink: 0;
}

/* ===== STATE 2: ROUTE OVERVIEW ===== */

.results-header {
  padding-bottom: 16px;
  border-bottom: 1px solid #E5E5E7;
  margin-bottom: 20px;
}

.results-title {
  font-size: 24px;
  font-weight: 700;
  color: #1D1D1F;
  margin: 12px 0 0 0;
}

.route-cards-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Route Cards */
.route-card {
  border-radius: 16px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  position: relative;
  overflow: hidden;
}

.route-card.primary {
  background: linear-gradient(135deg, #12a37a 0%, #0f8b67 100%);
  color: white;
  box-shadow: 0 4px 16px rgba(18, 163, 122, 0.3);
}

.route-card.secondary {
  background: white;
  color: #1D1D1F;
  border: 1px solid #E5E5E7;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.route-card:hover {
  transform: translateY(-2px);
}

.route-card.primary:hover {
  box-shadow: 0 8px 24px rgba(18, 163, 122, 0.4);
}

.route-card.secondary:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  border-color: #12a37a;
}

/* Route Card Header */
.route-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.route-time {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
}

.route-modes {
  display: flex;
  gap: 6px;
  font-size: 20px;
  align-items: center;
}

/* Route Card Info */
.route-card-info {
  margin-bottom: 12px;
}

.route-schedule {
  font-size: 16px;
  opacity: 0.8;
  margin-bottom: 8px;
}

.route-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.route-card.primary .route-badge {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.route-card.secondary .route-badge {
  background: #F2F2F7;
  color: #8E8E93;
}

.route-card.secondary .route-badge.secondary {
  background: #007AFF;
  color: white;
}

/* Route Impact */
.route-impact {
  display: flex;
  gap: 16px;
  font-size: 14px;
  opacity: 0.8;
}

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

/* ===== STATE 3: DETAILED ROUTE VIEW ===== */

.detail-header {
  padding-bottom: 20px;
  border-bottom: 1px solid #E5E5E7;
  margin-bottom: 24px;
}

.detail-summary {
  margin-top: 16px;
}

.detail-title {
  font-size: 28px;
  font-weight: 700;
  color: #1D1D1F;
  margin: 0 0 8px 0;
}

.detail-schedule {
  font-size: 16px;
  color: #8E8E93;
  margin: 0;
}

/* Route Steps */
.route-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.route-step {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid #F2F2F7;
  position: relative;
}

.route-step:last-child {
  border-bottom: none;
}

.step-icon {
  font-size: 24px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #F2F2F7;
  border-radius: 8px;
}

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

.step-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: default;
}

.step-main.transit-segment {
  cursor: pointer;
  padding: 8px 12px;
  margin: -8px -12px;
  border-radius: 8px;
  transition: background-color 0.2s ease;
}

.step-main.transit-segment:hover {
  background: #F2F2F7;
}

.step-description {
  font-size: 16px;
  font-weight: 500;
  color: #1D1D1F;
  margin-bottom: 4px;
}

.step-details {
  font-size: 14px;
  color: #8E8E93;
}

.expand-icon {
  font-size: 18px;
  color: #C7C7CC;
  transition: transform 0.3s ease;
  font-weight: bold;
}

.route-step.expanded .expand-icon {
  transform: rotate(90deg);
}

/* Transit Details */
.transit-details {
  margin-top: 16px;
  padding: 16px;
  background: #F2F2F7;
  border-radius: 12px;
  animation: expandDown 0.3s ease-out;
}

@keyframes expandDown {
  from {
    opacity: 0;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
  }
  to {
    opacity: 1;
    max-height: 400px;
    padding-top: 16px;
    padding-bottom: 16px;
  }
}

.transit-header {
  font-size: 14px;
  font-weight: 600;
  color: #8E8E93;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.transit-stops {
  position: relative;
}

.transit-stops::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 24px;
  bottom: 24px;
  width: 2px;
  background: #C7C7CC;
}

.transit-stop {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 0;
  position: relative;
}

.stop-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  border: 3px solid #C7C7CC;
  flex-shrink: 0;
  z-index: 1;
}

.transit-stop.boarding .stop-dot,
.transit-stop.alighting .stop-dot {
  border-color: #12a37a;
  background: #12a37a;
}

.stop-name {
  font-size: 15px;
  color: #1D1D1F;
  flex: 1;
  min-width: 0; /* Prevents text from squishing other elements */
}

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

.transit-info {
  padding: 8px 0;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 8px 0;
  font-size: 14px;
  color: #1D1D1F;
  border-bottom: 1px solid #F2F2F7;
  gap: 16px;
  line-height: 1.4;
}

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

.info-item strong {
  color: #8E8E93;
  font-weight: 500;
  flex-shrink: 0;
  min-width: 80px;
}

/* ===== STATUS INDICATOR ===== */

#status-indicator {
  color: #6c757d; /* Default gray */
  transition: color 0.3s ease;
}

#status-indicator.online {
  color: #28a745; /* Green when online */
}

/* ===== EMOJI MARKERS ===== */
.transport-emoji-marker {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  width: 28px;
  height: 28px;
}

.emoji-background {
  position: absolute;
  width: 100%;
  height: 100%;
  background: white;
  border: 2px solid;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* ===== NO RESULTS STATE ===== */

.no-results {
  text-align: center;
  padding: 40px 20px;
}

.no-results-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.no-results h3 {
  font-size: 20px;
  font-weight: 600;
  color: #1D1D1F;
  margin: 0 0 8px 0;
}

.no-results p {
  font-size: 16px;
  color: #8E8E93;
  margin: 0 0 24px 0;
}

/* ===== RESPONSIVE DESIGN ===== */

@media (max-width: 768px) {
  .route-card {
    padding: 16px;
  }
  
  .route-time {
    font-size: 24px;
  }
  
  .route-modes {
    font-size: 18px;
  }
  
  .detail-title {
    font-size: 24px;
  }
  
  .route-step {
    gap: 12px;
  }
  
  .step-icon {
    width: 28px;
    height: 28px;
    font-size: 20px;
  }
}
