.segment-carrier {
  text-align: right;
}

.segment-carrier a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.segment-carrier a:hover {
  background: rgba(37, 99, 235, 0.1);
  transform: translateX(2px);
}

.transfer-time {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin: 1rem 0;
  text-align: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  color: #92400e;
  font-size: 0.95rem;
}/* Modern Route Planner Styles */

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary: #64748b;
  --success: #10b981;
  --danger: #ef4444;
  --border: #e2e8f0;
  --bg-light: #f8fafc;
  --bg-card: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius: 12px;
  --radius-sm: 8px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 2rem 1rem;
  color: var(--text-primary);
  line-height: 1.6;
}

.container {
  max-width: 700px;
  margin: 0 auto;
  animation: fadeIn 0.5s ease-in;
}

.header-with-lang {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  gap: 1rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.guide-link {
  color: white;
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.guide-link:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateX(2px);
}

.language-switcher {
  display: flex;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.2);
  padding: 0.25rem;
  border-radius: 8px;
  backdrop-filter: blur(10px);
}

.lang-btn {
  padding: 0.5rem 1rem;
  border: none;
  background: transparent;
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lang-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lang-btn.active {
  background: white;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.title {
  font-size: 2rem;
  font-weight: 700;
  color: white;
  text-align: center;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
  flex: 1;
}

.route-form {
  background: var(--bg-card);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  margin-bottom: 2rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group:last-child {
  margin-bottom: 0;
}

label {
  display: block;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

select,
input[type="date"],
input[type="time"] {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  background: white;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23475569' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

input[type="date"],
input[type="time"] {
  background-image: none;
  padding-right: 1rem;
}

select:hover,
input[type="date"]:hover,
input[type="time"]:hover {
  border-color: var(--primary);
}

select:focus,
input[type="date"]:focus,
input[type="time"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

button[type="submit"] {
  width: 100%;
  padding: 1rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 1rem;
  box-shadow: var(--shadow-sm);
}

button[type="submit"]:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

button[type="submit"]:active {
  transform: translateY(0);
}

.results {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  transition: all 0.3s ease;
  animation: slideIn 0.4s ease-out;
}

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

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -4px rgb(0 0 0 / 0.15);
}

.card-duration {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-duration::before {
  content: "⏱️";
  font-size: 1.5rem;
}

.segment-row {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem 0;
}

.segment-row:last-of-type {
  border-bottom: none;
}

.segment-icon {
  font-size: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.segment-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.segment-time {
  font-size: 0.95rem;
  color: var(--text-secondary);
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.segment-time strong {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1.1rem;
  min-width: 70px;
  flex-shrink: 0;
}

.segment-time > span {
  flex: 1;
}

.time-column {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 70px;
}

.time-column strong {
  min-width: auto;
}

.arrival-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.arrival-info > span {
  display: block;
}

.time-with-badge {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.next-day-badge {
  display: inline-block;
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  color: #1e40af;
  padding: 0.15rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  width: fit-content;
}

.text-red-600 {
  color: var(--danger);
  background: #fee2e2;
  padding: 1rem;
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--danger);
  font-weight: 500;
}

/* Loading state */
.results p:first-child {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
}

/* Modern animated loader for route planner */
.loader {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 3rem 2rem;
}

.spinner {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  animation: pulse 1.5s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
}

@keyframes pulse {
  0% {
    transform: scale(0.8);
    box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
  }
  50% {
    transform: scale(1);
    box-shadow: 0 0 0 15px rgba(102, 126, 234, 0);
  }
  100% {
    transform: scale(0.8);
    box-shadow: 0 0 0 0 rgba(102, 126, 234, 0);
  }
}

/* Alternative spinning loader (if you want to switch back) */
.spinner-spin {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(102, 126, 234, 0.2);
  border-top-color: #667eea;
  border-right-color: #764ba2;
  border-radius: 50%;
  animation: spin 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
  box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
}

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

/* Debug details */
details {
  margin-top: 1rem;
  padding: 0.75rem;
  background: var(--bg-light);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0.25rem;
}

summary:hover {
  color: var(--primary);
}

pre {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  overflow-x: auto;
  padding: 0.5rem;
  background: white;
  border-radius: 4px;
}

/* Responsive */
@media (max-width: 640px) {
  body {
    padding: 1rem 0.5rem;
  }

  .header-with-lang {
    flex-direction: column;
    align-items: center;
  }

  .title {
    font-size: 1.5rem;
  }

  .route-form,
  .card {
    padding: 1.25rem;
  }

  .segment-row {
    grid-template-columns: 32px 1fr;
    gap: 0.75rem;
  }

  .segment-carrier {
    grid-column: 2;
    text-align: left;
    margin-top: 0.5rem;
  }

  .segment-time strong {
    min-width: 60px;
    font-size: 1rem;
  }
}

/* Smooth transitions for dynamic content */
#minTransferGroup {
  transition: all 0.3s ease;
  overflow: hidden;
}

#minTransferGroup[style*="display: none"] {
  max-height: 0;
  opacity: 0;
  margin: 0;
}

#minTransferGroup[style*="display: block"] {
  max-height: 200px;
  opacity: 1;
}
