/* ============================================================================
   TIME WINDOW TABS
   ============================================================================ */

#duration-tabs {
  position: relative;
  height: 3rem;
  min-height: 3rem;
  box-shadow: inset 0 1px 3px rgb(0 0 0 / 0.1);
  --indicator-left: 0px;
  --indicator-width: 0px;
}

#duration-tabs::before {
  content: '';
  position: absolute;
  top: 0.25rem;
  bottom: 0.25rem;
  left: var(--indicator-left);
  width: var(--indicator-width);
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.1), 0 1px 2px rgb(0 0 0 / 0.06);
  transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 0;
}

[data-theme="dark"] #duration-tabs::before {
  background: rgba(255, 255, 255, 0.1);
}

#duration-tabs .tab {
  position: relative;
  z-index: 1;
  padding: 0.5rem 0.5rem;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  color: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  opacity: 0.6;
  cursor: pointer;
  transition: opacity 300ms cubic-bezier(0.4, 0, 0.2, 1), 
              background 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

#duration-tabs .tab:hover {
  opacity: 0.9;
  background: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] #duration-tabs .tab:hover {
  background: rgba(255, 255, 255, 0.05);
}

#duration-tabs .tab.tab-active {
  font-weight: 600;
  opacity: 1;
  background: transparent;
  box-shadow: none;
}

[data-theme="dark"] #duration-tabs .tab.tab-active {
  background: transparent;
}


/* ============================================================================
   SCROLLBAR UTILITIES
   ============================================================================ */

.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* ============================================================================
   SEARCH RESULTS DROPDOWN
   ============================================================================ */

#results .menu,
#journey-origin-results .menu,
#journey-destination-results .menu {
  width: 100%;
  display: block;
}

#results .menu li,
#results .menu li a,
#journey-origin-results .menu li,
#journey-origin-results .menu li a,
#journey-destination-results .menu li,
#journey-destination-results .menu li a {
  width: 100%;
  display: block;
}

/* ============================================================================
   RADAR MAP - LEAFLET INTEGRATION
   ============================================================================ */

#radar-map {
  width: 100%;
  height: 100%;
  z-index: 0;
}

/* Custom markers */
.vehicle-marker {
  background: transparent !important;
  border: none !important;
}

.stop-marker {
  background: transparent !important;
  border: none !important;
  color: var(--p, #570df8);
}

.leaflet-popup-content-wrapper {
  background: hsl(var(--b1)) !important;
  color: hsl(var(--bc)) !important;
  border-radius: 0.5rem;
  box-shadow: 0 10px 25px -5px rgb(0 0 0 / 0.2), 0 8px 10px -6px rgb(0 0 0 / 0.2);
  opacity: 1 !important;
}

.leaflet-popup-tip {
  background: hsl(var(--b1)) !important;
}

.leaflet-popup-content {
  margin: 0 !important;
  min-width: 240px;
}

[data-theme="dark"] .leaflet-popup-content-wrapper {
  background: oklch(var(--b1)) !important;
  color: oklch(var(--bc)) !important;
}

[data-theme="dark"] .leaflet-popup-tip {
  background: oklch(var(--b1)) !important;
}

[data-theme="light"] .leaflet-popup-content-wrapper,
[data-theme="winter"] .leaflet-popup-content-wrapper {
  background: #ffffff !important;
  color: #1f2937 !important;
}

[data-theme="light"] .leaflet-popup-tip,
[data-theme="winter"] .leaflet-popup-tip {
  background: #ffffff !important;
}

/* ============================================================================
   RADAR POPUP
   ============================================================================ */

.radar-popup .leaflet-popup-content-wrapper {
  background: #ffffff !important;
  color: #1f2937 !important;
  border-radius: 12px !important;
  padding: 0 !important;
  opacity: 1 !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
}

.radar-popup .leaflet-popup-tip {
  background: #ffffff !important;
}

[data-theme="dark"] .radar-popup .leaflet-popup-content-wrapper {
  background: #1f2937 !important;
  color: #f3f4f6 !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
}

[data-theme="dark"] .radar-popup .leaflet-popup-tip {
  background: #1f2937 !important;
}

.radar-popup-container {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

/* Header section */
.radar-popup-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid rgba(128, 128, 128, 0.1);
}

[data-theme="dark"] .radar-popup-header {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.radar-popup-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.radar-popup-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.6;
}

.radar-popup-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2rem;
  padding: 0 0.75rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 700;
  color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.radar-popup-product {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.6;
}

/* Body section */
.radar-popup-body {
  padding: 1rem;
}

.radar-popup-stop-name {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
}

.radar-popup-route {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.radar-popup-route-icon {
  font-size: 1.25rem;
  opacity: 0.4;
}

.radar-popup-destination {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
}

.radar-popup-divider {
  height: 1px;
  margin: 0.875rem 0;
  background: rgba(128, 128, 128, 0.15);
}

[data-theme="dark"] .radar-popup-divider {
  background: rgba(255, 255, 255, 0.1);
}

.radar-popup-info-grid {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.radar-popup-info-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.radar-popup-info-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.5;
}

.radar-popup-info-value {
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.3;
}

.radar-popup-info-time {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.125rem;
  font-size: 0.8125rem;
  opacity: 0.7;
}

/* Delay badges within popup */
.radar-popup-delay {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.025em;
}

.radar-popup-delay-late {
  background: rgba(239, 68, 68, 0.15);
  color: #dc2626;
}

[data-theme="dark"] .radar-popup-delay-late {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.radar-popup-delay-early {
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
}

[data-theme="dark"] .radar-popup-delay-early {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

/* ============================================================================
   RADAR MODAL
   ============================================================================ */

#radar-modal .modal-box {
  background: var(--b1);
}

/* ============================================================================
   JOURNEY CARDS
   ============================================================================ */

.journey-card {
  cursor: pointer;
  transition: all 250ms cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
}

.journey-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px -4px rgb(0 0 0 / 0.12), 0 4px 8px -2px rgb(0 0 0 / 0.08);
  border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .journey-card:hover {
  border-color: rgba(255, 255, 255, 0.08);
}

.journey-card.collapsed .journey-details {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.journey-card.expanded .journey-details {
  max-height: 2000px;
  opacity: 1;
  transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.journey-expand-icon {
  transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.journey-card.expanded .journey-expand-icon {
  transform: rotate(180deg);
}

/* ============================================================================
   VIEW SECTIONS
   ============================================================================ */

#departures-view,
#journey-view,
#settings-view {
  animation: fadeIn 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ============================================================================
   PLACEHOLDER TEXT STYLING
   ============================================================================ */

input::placeholder {
  opacity: 0.35;
}

input:focus::placeholder {
  opacity: 0.3;
}

/* ============================================================================
   TIME PICKER STYLING
   ============================================================================ */

input[type="time"] {
  cursor: pointer;
  text-align: center;
  font-weight: 500;
}

input[type="time"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 200ms ease;
}

input[type="time"]:hover::-webkit-calendar-picker-indicator {
  opacity: 1;
}

input[type="time"]::-webkit-datetime-edit-fields-wrapper {
  padding: 0;
}

input[type="time"]::-webkit-datetime-edit {
  padding: 0;
}
