/* HFX Traffic - Styles */
/* Mobile-first traffic app for Halifax */

:root {
  /* Colors - Orange/Amber theme for traffic */
  --bg-dark: #0a0a0f;
  --bg-card: #141419;
  --bg-elevated: #1a1a22;
  --text-primary: #ffffff;
  --text-secondary: #a0a0a8;
  --text-muted: #606068;
  --accent: #FFE500;
  --accent-light: #fbbf24;
  --accent-dark: #d97706;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --border: rgba(255, 255, 255, 0.08);
  
  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  
  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  
  /* Safe areas */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  overflow: hidden;
}

/* Override for scrollable sub-pages */
html:has(.scrollable-page),
html.scrollable {
  overflow: auto;
  overflow-x: hidden;
}

body.scrollable-page {
  overflow: auto;
  overflow-x: hidden;
  height: auto;
  min-height: 100%;
  scroll-behavior: smooth;
}

body.scrollable-page #app {
  height: auto;
  min-height: 100vh;
  overflow: visible;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

#app {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: linear-gradient(180deg, rgba(20, 20, 30, 0.98), rgba(15, 15, 23, 0.95));
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  padding-top: calc(var(--safe-top) + var(--space-md));
}

.header-left {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* Universal Close Button */
.close-btn,
.bus-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 400;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.close-btn:hover,
.bus-close-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.close-btn:active,
.bus-close-btn:active {
  transform: scale(0.95);
}

.header-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.header-center {
  flex: 1;
  text-align: center;
}

.header-time {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
}

.header-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

.header-right {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}

.header-weather {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  border: 1px solid var(--border);
}

.weather-icon {
  font-size: 16px;
}

.weather-temp {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Sub Header */
.sub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  background: rgba(251, 146, 60, 0.06);
  border-bottom: 1px solid rgba(251, 146, 60, 0.12);
}

/* Mobility ticker */
.ticker {
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.ticker-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px var(--space-md);
}

.ticker-track {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  white-space: nowrap;
  will-change: transform;
  animation: ticker-scroll 55s linear infinite;
}

.ticker-item {
  font-size: 12px;
  color: var(--text-secondary);
}

.ticker-link {
  text-decoration: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.2s;
}

.ticker-link:hover {
  color: var(--accent);
}

.ticker-sep {
  opacity: 0.45;
}

/* Note: We keep the ticker moving even when the OS requests reduced motion.
   This is a core usability feature for the app's "headline strip".
   If you later add a user-facing "Reduce motion" toggle, you can
   reintroduce a conditional pause here. */

@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.sub-header-location {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.logo-img {
  height: 40px;
  width: auto;
}

.logo-icon {
  font-size: 28px;
}

.logo-text {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.logo-accent {
  color: var(--accent);
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: 20px;
}

.live-dot {
  width: 6px;
  height: 6px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 1.5s ease-in-out infinite;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}

.live-text {
  font-size: 10px;
  font-weight: 700;
  color: var(--success);
  letter-spacing: 1px;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.9); }
}

/* Main Content */
#content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0;
  padding-bottom: calc(var(--safe-bottom) + var(--space-xl));
  -webkit-overflow-scrolling: touch;
}

.content-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px var(--space-md) var(--space-xl);
  padding-top: calc(80px + env(safe-area-inset-top, 0px));
}

/* Loading State */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 60vh;
  gap: var(--space-md);
  color: var(--text-secondary);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.hidden {
  display: none !important;
}

/* Skeleton loading */
body.is-loading .traffic-card {
  transition: none;
}

.skeleton-card {
  position: relative;
  overflow: hidden;
}

.skeleton-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -60%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
  animation: shimmer 1.2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(0); }
  100% { transform: translateX(220%); }
}

.skeleton-line {
  height: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  margin-bottom: var(--space-sm);
}

.skeleton-line:last-child {
  margin-bottom: 0;
}

.skeleton-line-lg {
  height: 16px;
  width: 78%;
}

.skeleton-line-sm {
  height: 10px;
  width: 52%;
}

.skeleton-text {
  display: inline-block;
  min-width: 22px;
  color: transparent;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 2px 8px;
}

/* Status Banner */
.status-banner {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  border-radius: var(--radius-lg);
  margin-top: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.status-banner.status-normal {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.15) 0%, rgba(34, 197, 94, 0.05) 100%);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-banner.status-warning {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(245, 158, 11, 0.05) 100%);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-banner.status-alert {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(239, 68, 68, 0.05) 100%);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
}

.status-normal .status-icon { color: var(--success); }
.status-warning .status-icon { color: var(--warning); }
.status-alert .status-icon { color: var(--danger); }

.status-title {
  font-size: 16px;
  font-weight: 600;
}

.status-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Quick Stats */
.quick-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  text-align: center;
}

.stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.stat-label {
  font-size: 10px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: var(--space-xs);
}

/* Sections */
.section {
  margin-bottom: var(--space-lg);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.section-title {
  font-size: 16px;
  font-weight: 600;
}

.section-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: rgba(245, 158, 11, 0.15);
  padding: 4px 10px;
  border-radius: 12px;
}

.section-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ad-slot {
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  min-height: 90px;
  margin: var(--space-md) 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ad-slot.ad-placeholder {
  opacity: 0.8;
}

.ad-slot .ad-label {
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

/* Card List */
.card-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

/* Ensure transit list displays cards vertically */
#transit-list,
#transit-alerts-list,
.transit-alerts-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.traffic-card {
  display: block;
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}

.traffic-card:active {
  transform: scale(0.98);
  background: var(--bg-elevated);
}

.traffic-card.severity-high {
  border-left: 3px solid var(--danger);
}

.traffic-card.severity-medium {
  border-left: 3px solid var(--warning);
}

.traffic-card.severity-low {
  border-left: 3px solid var(--info);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.card-location {
  font-size: 15px;
  font-weight: 600;
  flex: 1;
}

.card-badge {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.card-badge.active {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.card-badge.scheduled {
  background: rgba(59, 130, 246, 0.15);
  color: var(--info);
}

.card-badge.ongoing {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.card-description {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: var(--space-sm);
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.card-tag {
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 8px;
  border-radius: 6px;
}

.card-tag.time {
  color: var(--accent-light);
}

/* Bridge Status */
.bridge-status {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
}

.bridge-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  text-align: center;
}

.bridge-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.bridge-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 20px;
}

.bridge-indicator.open {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.bridge-indicator.restricted {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.bridge-indicator.closed {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.bridge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

/* Ferry Status */
.ferry-status {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.ferry-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ferry-route {
  font-size: 14px;
  font-weight: 600;
}

.ferry-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.ferry-indicator.running {
  color: var(--success);
}

.ferry-indicator.delayed {
  color: var(--warning);
}

.ferry-indicator.reduced {
  color: var(--warning);
}

.ferry-indicator.cancelled {
  color: var(--danger);
}

.ferry-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

/* Last Updated */
.last-updated {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-lg) 0;
  font-size: 13px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.refresh-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.refresh-btn:active {
  background: var(--bg-card);
}

/* Source Info */
.source-info {
  text-align: center;
  padding: var(--space-lg) var(--space-md);
  border-top: 1px solid var(--border);
}

.source-info p {
  font-size: 13px;
  color: var(--text-secondary);
}

.source-info a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.source-info .source-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.source-info .source-sub a {
  color: var(--text-secondary);
}

/* Data source badges in cards */
.card-tag.source-hrm {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.card-tag.source-511 {
  background: rgba(59, 130, 246, 0.15);
  color: var(--info);
}

.card-tag.source-haligonia {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent);
}

/* Section Badge */
.section-badge {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 10px;
  letter-spacing: 0.5px;
}

.section-badge.live {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
  animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Transit Section */
.transit-status-banner {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
}

.transit-status-banner.normal {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(34, 197, 94, 0.05));
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.transit-status-banner.disrupted {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.05));
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.transit-status-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--success);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: bold;
}

.transit-status-banner.disrupted .transit-status-icon {
  background: var(--warning);
}

.transit-status-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.transit-status-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Route Pills */
.transit-routes {
  margin-bottom: var(--space-md);
}

.transit-routes-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-sm);
}

.route-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

/* Horizontal scrolling terminal pills */
.route-pills.terminal-scroll {
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 4px;
  margin: 0 -16px;
  padding-left: 16px;
  padding-right: 16px;
}

.route-pills.terminal-scroll::-webkit-scrollbar {
  display: none;
}

.route-pills.terminal-scroll .terminal-pill {
  flex-shrink: 0;
}

.route-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  transition: all 0.2s ease;
}

.route-pill:active {
  transform: scale(0.97);
}

/* Terminal pill active state */
.terminal-pill {
  cursor: pointer;
  color: var(--text-primary);
}

.terminal-pill.active {
  background: var(--route-color, var(--accent));
  border-color: var(--route-color, var(--accent));
}

.terminal-pill.active .route-number {
  background: rgba(255, 255, 255, 0.2);
}

.terminal-pill.active .route-name {
  color: white;
}

.route-number {
  background: var(--route-color, var(--accent));
  color: white;
  font-weight: 700;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  min-width: 20px;
  text-align: center;
}

.route-name {
  color: var(--text-primary);
  font-weight: 500;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.route-status.ok {
  background: var(--success);
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
}

.route-status.delayed {
  background: var(--warning);
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.5);
}

.route-status.disrupted {
  background: var(--danger);
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.5);
}

/* Ferry Quick Cards */
.ferry-quick {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.ferry-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.ferry-icon {
  font-size: 24px;
  margin-bottom: var(--space-xs);
}

.ferry-info {
  margin-bottom: var(--space-sm);
}

.ferry-route {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.ferry-detail {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.ferry-status {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 10px;
}

.ferry-status.running {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.ferry-status.delayed {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.ferry-status.reduced {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.ferry-status.cancelled {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

/* Transit Teaser */
.transit-teaser {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: linear-gradient(135deg, rgba(251, 146, 60, 0.08), rgba(251, 146, 60, 0.03));
  border: 1px dashed rgba(251, 146, 60, 0.3);
  border-radius: var(--radius-md);
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
}

.transit-teaser-icon {
  font-size: 16px;
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* HRFE (Fire & Emergency) Section */
.hrfe-card {
  padding: var(--space-md);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--text-muted);
  margin-bottom: var(--space-sm);
  transition: all 0.2s ease;
}

.hrfe-card:active {
  transform: scale(0.98);
}

.hrfe-card.hrfe-high {
  border-left-color: var(--danger);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), var(--bg-card));
}

.hrfe-card.hrfe-medium {
  border-left-color: var(--warning);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), var(--bg-card));
}

.hrfe-card.hrfe-low {
  border-left-color: var(--info);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), var(--bg-card));
}

.hrfe-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-xs);
}

.hrfe-type {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.hrfe-high .hrfe-type {
  color: var(--danger);
}

.hrfe-medium .hrfe-type {
  color: var(--warning);
}

.hrfe-time {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.hrfe-location {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.hrfe-location-link {
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 1px dotted var(--text-muted);
}

.hrfe-location-link:hover,
.hrfe-location-link:active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.hrfe-units {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}

/* Section Footer */
.section-footer {
  margin-top: var(--space-md);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border);
  text-align: center;
}

/* Section Link */
.section-link {
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

/* Flight Section */
.flight-alerts {
  margin-bottom: var(--space-md);
}

.flight-alert-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
}

.flight-alert-card.delayed {
  border-left: 3px solid var(--warning);
}

.flight-alert-card.cancelled {
  border-left: 3px solid var(--danger);
}

.flight-alert-icon {
  font-size: 24px;
}

.flight-alert-info {
  flex: 1;
}

.flight-alert-route {
  font-size: 14px;
  font-weight: 600;
}

.flight-alert-detail {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.flight-alert-status {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 6px;
}

.flight-alert-status.delayed {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.flight-alert-status.cancelled {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

/* Flight Ticker */
.flight-ticker-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: var(--space-md);
}

.flight-ticker {
  overflow: hidden;
  white-space: nowrap;
  padding: var(--space-sm) 0;
}

.flight-ticker-content {
  display: inline-flex;
  animation: ticker 55s linear infinite;
}

.flight-ticker-content:hover {
  animation-play-state: paused;
}

@keyframes ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.flight-ticker-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0 var(--space-lg);
  font-size: 13px;
  color: var(--text-secondary);
}

.flight-ticker-item .flight-num {
  font-weight: 600;
  color: var(--text-primary);
}

.flight-ticker-item .flight-dest {
  color: var(--text-primary);
}

.flight-ticker-item .flight-time {
  color: var(--accent);
}

.flight-ticker-item .flight-status {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 4px;
}

.flight-ticker-item .flight-status.on-time {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.flight-ticker-item .flight-status.delayed {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.flight-ticker-item .flight-status.cancelled {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.flight-ticker-item::after {
  content: '•';
  margin-left: var(--space-lg);
  color: var(--border);
}

/* Flight Stats */
.flight-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
}

.flight-stat {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.flight-stat-icon {
  font-size: 24px;
}

.flight-stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.flight-stat-label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* No Alerts State */
.no-alerts {
  padding: var(--space-md);
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.no-alerts-icon {
  font-size: 24px;
  margin-bottom: var(--space-xs);
}

/* Camera Section */
.camera-group {
  margin-bottom: var(--space-lg);
}

.camera-group-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-sm);
}

.camera-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
}

.camera-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}

.camera-card:active {
  transform: scale(0.98);
}

.camera-card:hover {
  border-color: var(--accent);
}

.camera-img-wrap {
  position: relative;
  aspect-ratio: 4/3;
  background: var(--bg-dark);
  overflow: hidden;
}

.camera-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s;
}

.camera-img-wrap img[src=""],
.camera-img-wrap img:not([src]) {
  opacity: 0;
}

/* Camera unavailable placeholder */
.camera-unavailable {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  color: var(--text-muted);
}

.camera-unavailable-icon {
  font-size: 32px;
  margin-bottom: 8px;
  opacity: 0.5;
}

.camera-unavailable-text {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.7;
}

.camera-modal-unavailable {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  color: rgba(255,255,255,0.6);
}

.camera-live-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(239, 68, 68, 0.9);
  color: white;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.camera-live-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  background: white;
  border-radius: 50%;
  animation: pulse 1.5s ease-in-out infinite;
}

.camera-label {
  padding: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.refresh-cam-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s;
}

.refresh-cam-btn:active {
  transform: rotate(180deg);
}

.view-all-cams-btn {
  display: block;
  width: 100%;
  padding: var(--space-md);
  margin-top: var(--space-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  text-align: center;
  text-decoration: none;
}

.view-all-cams-btn:active {
  background: var(--bg-card);
}

/* Section Note */
.section-note {
  font-size: 12px;
  color: var(--text-muted);
  padding: 0 var(--space-md) var(--space-sm);
  margin: 0;
}

/* Link List (for external links) */
.link-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: 0 var(--space-md);
}

.link-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all 0.2s;
}

.link-card:active {
  background: var(--bg-elevated);
  transform: scale(0.98);
}

.link-icon {
  font-size: 24px;
  flex-shrink: 0;
}

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

.link-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.link-desc {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-arrow {
  font-size: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Header Title (for sub-pages) */
.header-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Camera Modal */
.camera-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 300;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  display: flex;
  flex-direction: column;
}

.camera-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Camera Fullscreen Modal (cameras.html) */
.camera-fullscreen-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.camera-fullscreen-modal.hidden {
  display: none;
}

.camera-fullscreen-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.camera-fullscreen-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 90vw;
  max-height: 90vh;
}

.camera-fullscreen-close {
  position: absolute;
  top: -50px;
  right: 0;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.camera-fullscreen-close:active {
  background: rgba(255, 255, 255, 0.25);
}

.camera-fullscreen-modal #modal-camera-img {
  max-width: 100%;
  max-height: 70vh;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.camera-fullscreen-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 400px;
  padding: 16px 0;
  color: #fff;
  gap: 16px;
}

.camera-fullscreen-info span {
  font-size: 15px;
  font-weight: 500;
}

.camera-fullscreen-refresh {
  background: var(--accent);
  color: #000;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s;
}

.camera-fullscreen-refresh:active {
  transform: scale(0.96);
}

.camera-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  padding-top: calc(var(--safe-top) + var(--space-md));
  gap: var(--space-md);
}

.camera-modal-close-left {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-size: 20px;
  cursor: pointer;
  transition: background 0.2s;
}

.camera-modal-close-left:hover {
  background: rgba(255, 255, 255, 0.2);
}

.camera-modal-title {
  font-size: 16px;
  font-weight: 600;
  flex: 1;
  text-align: center;
}

.camera-modal-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 20px;
  cursor: pointer;
}

.camera-modal-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
}

.camera-modal-content img {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--radius-md);
}

.camera-modal-footer {
  padding: var(--space-md);
  padding-bottom: calc(var(--safe-bottom) + var(--space-md));
  text-align: center;
}

.camera-modal-timestamp {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.camera-modal-nav {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
}

.camera-nav-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.camera-nav-btn:active {
  background: var(--bg-card);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: var(--space-xl);
  color: var(--text-secondary);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

.empty-state-text {
  font-size: 14px;
}

/* Article Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 85vh;
  background: var(--bg-dark);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  z-index: 201;
  transform: translateY(100%);
  transition: transform 0.3s ease-out;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: none;
  border-radius: 50%;
  color: var(--text-primary);
  font-size: 18px;
  cursor: pointer;
}

.modal-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-lg);
  -webkit-overflow-scrolling: touch;
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: var(--space-md);
}

.modal-body {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.modal-body p {
  margin-bottom: var(--space-md);
}

.modal-link {
  display: inline-block;
  margin-top: var(--space-md);
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}


/* Header link */
.header-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  background: rgba(255,255,255,0.08);
  font-size: 0.9rem;
  line-height: 1;
}

/* Cover screen */
.cover-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  overflow: hidden;
  background: #0a0a0f;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.cover-screen.hidden {
  display: none;
}

.cover-image {
  display: none; /* We'll use a real img element instead */
}

.cover-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 400px;
  width: 100%;
}

.cover-logo {
  width: 80px;
  height: 80px;
  margin-bottom: 8px;
}

.cover-welcome {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.05em;
}

.cover-brand {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent, #FFE500);
  margin-bottom: 24px;
  letter-spacing: -0.02em;
}

.cover-camera-wrap {
  width: 100%;
  max-width: 360px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 
    0 4px 6px rgba(0, 0, 0, 0.3),
    0 10px 20px rgba(0, 0, 0, 0.4),
    0 20px 40px rgba(0, 0, 0, 0.3);
  margin-bottom: 16px;
}

.cover-camera-img {
  width: 100%;
  height: auto;
  display: block;
}

.cover-camera-label {
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  margin-bottom: 4px;
}

.cover-camera-source {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 20px;
}

.cover-kicker {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent, #FFE500);
  margin-bottom: 8px;
  display: none; /* Hide for cleaner look */
}

.cover-title {
  display: none; /* Using camera label instead */
}

.cover-meta {
  display: none; /* Simplified */
}

.cover-enter {
  display: block;
  width: 100%;
  max-width: 280px;
  padding: 14px 24px;
  border-radius: 10px;
  border: none;
  background: var(--accent, #FFE500);
  color: #000;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s;
}

.cover-enter:active {
  transform: scale(0.98);
  opacity: 0.9;
}

.cover-caption {
  display: none; /* Moved to cover-camera-source */
}

.cover-datetime {
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  margin-top: 16px;
}

.cover-screen.fade-out {
  animation: coverFadeOut 400ms ease-out forwards;
}

@keyframes coverFadeOut {
  to { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .cover-screen.fade-out { animation: none; opacity: 0; }
}


/* Page header (for section views) */
.page-header {
  padding: var(--space-lg) var(--space-md) var(--space-md);
  text-align: center;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 4px;
}

.page-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

/* Small refresh button for header */
.refresh-btn-sm {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.refresh-btn-sm:active {
  background: var(--bg-card);
  transform: scale(0.95);
}

/* Header link button */
.header-link-btn {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
}

.header-link-btn:active {
  background: var(--bg-card);
  transform: scale(0.98);
}

/* Dataset page helpers */
.search-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: inherit;
  outline: none;
}

.search-input:focus {
  border-color: var(--accent);
  background: rgba(255,255,255,0.08);
}

.dataset-badge {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 4px;
}

.dataset-badge.active {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.dataset-badge.planned {
  background: rgba(107, 114, 128, 0.15);
  color: var(--text-muted);
}

.dataset-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
}

.dataset-link:hover {
  text-decoration: underline;
}

.pull-status {
  font-size: 14px;
  font-weight: 600;
}

.pull-status.success {
  color: var(--success);
}

.pull-status.error {
  color: var(--danger);
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.card-text {
  margin-top: 8px;
  opacity: 0.9;
  line-height: 1.35;
}


/* Responsive layout */
@media (min-width: 640px) {
  .content-inner { padding-left: 18px; padding-right: 18px; }
}

@media (min-width: 768px) {
  body { font-size: 16px; }
  .camera-grid { grid-template-columns: repeat(3, 1fr); gap: var(--space-md); }
  .header-center .header-time { font-size: 18px; }
}

@media (min-width: 1024px) {
  .content-inner { padding-left: 20px; padding-right: 20px; }
  .camera-grid { grid-template-columns: repeat(4, 1fr); }
  .quick-stats { gap: var(--space-md); }
  .section { margin-bottom: 18px; }
}

@media (min-width: 1280px) {
  body { font-size: 17px; }
}


/* Summary tiles (home) */
.summary-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  margin: 14px 0 6px;
}

.summary-tile{
  text-align:left;
  border-radius:18px;
  padding:16px 16px 18px;
  border:1px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  box-shadow: 0 8px 18px rgba(0,0,0,0.35);
  color: var(--text-primary);
  min-height: 108px;
  cursor:pointer;
}

.summary-tile:active{
  transform: translateY(1px);
}

.summary-kicker{
  font-size:11px;
  letter-spacing:0.08em;
  text-transform:uppercase;
  color: var(--text-secondary);
  margin-bottom:8px;
  display:flex;
  align-items:center;
  gap:6px;
}

.summary-title{
  font-size:15px;
  line-height:1.3;
  font-weight:700;
}

.summary-breaking{
  border-color: rgba(239,68,68,0.35);
  background: radial-gradient(120% 120% at 0% 0%, rgba(239,68,68,0.22), rgba(255,255,255,0.02));
}
.summary-breaking .summary-kicker{ color: rgba(239,68,68,0.85); }

.summary-detours{
  border-color: rgba(245,158,11,0.35);
  background: radial-gradient(120% 120% at 0% 0%, rgba(245,158,11,0.20), rgba(255,255,255,0.02));
}
.summary-detours .summary-kicker{ color: rgba(245,158,11,0.9); }

.summary-transit{
  border-color: rgba(59,130,246,0.30);
  background: radial-gradient(120% 120% at 0% 0%, rgba(59,130,246,0.18), rgba(255,255,255,0.02));
}
.summary-transit .summary-kicker{ color: rgba(59,130,246,0.9); }

.summary-flights{
  border-color: rgba(34,197,94,0.28);
  background: radial-gradient(120% 120% at 0% 0%, rgba(34,197,94,0.16), rgba(255,255,255,0.02));
}
.summary-flights .summary-kicker{ color: rgba(34,197,94,0.9); }

@media (min-width: 768px){
  .summary-grid{ gap:14px; }
  .summary-title{ font-size:16px; }
  .summary-tile{ min-height: 116px; }
}
@media (min-width: 1024px){
  .summary-grid{ grid-template-columns: repeat(4, 1fr); }
  .summary-tile{ min-height: 126px; }
}

/* Breaking Now Section */
.breaking-now {
  margin: var(--space-md) 0 var(--space-lg);
  border-radius: var(--radius-lg);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.breaking-now-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(239, 68, 68, 0.15);
  border-bottom: 1px solid rgba(239, 68, 68, 0.2);
}

.breaking-now-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(239, 68, 68, 0.9);
}

.breaking-now-live {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(239, 68, 68, 0.25);
  color: #ef4444;
  animation: pulse-live 2s ease-in-out infinite;
}

@keyframes pulse-live {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.breaking-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}

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

.breaking-item:active {
  background: rgba(255, 255, 255, 0.05);
}

.breaking-item.no-data {
  opacity: 0.5;
}

.breaking-icon {
  font-size: 24px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  flex-shrink: 0;
}

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

.breaking-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.breaking-headline {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.breaking-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.breaking-arrow {
  font-size: 20px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Breaking item color accents */
.breaking-hrfe .breaking-icon { background: rgba(239, 68, 68, 0.15); }
.breaking-hrfe .breaking-label { color: rgba(239, 68, 68, 0.8); }

.breaking-transit .breaking-icon { background: rgba(59, 130, 246, 0.15); }
.breaking-transit .breaking-label { color: rgba(59, 130, 246, 0.8); }

.breaking-construction .breaking-icon { background: rgba(245, 158, 11, 0.15); }
.breaking-construction .breaking-label { color: rgba(245, 158, 11, 0.8); }

.breaking-flights .breaking-icon { background: rgba(34, 197, 94, 0.15); }
.breaking-flights .breaking-label { color: rgba(34, 197, 94, 0.8); }

.breaking-bridges .breaking-icon { background: rgba(139, 92, 246, 0.15); }
.breaking-bridges .breaking-label { color: rgba(139, 92, 246, 0.8); }

.breaking-ferries .breaking-icon { background: rgba(6, 182, 212, 0.15); }
.breaking-ferries .breaking-label { color: rgba(6, 182, 212, 0.8); }

/* Scroll to top button */
.scroll-to-top {
  position: fixed;
  bottom: 90px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 107, 0, 0.9);
  border: none;
  color: white;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-to-top:active {
  transform: scale(0.95);
}

@supports (bottom: env(safe-area-inset-bottom)) {
  .scroll-to-top {
    bottom: calc(90px + env(safe-area-inset-bottom, 0));
  }
}

/* Map interstitial */
.map-interstitial{
  position:fixed;
  inset:0;
  z-index: 9999;
  display:flex;
  align-items:center;
  justify-content:center;
}
.map-interstitial.hidden{ display:none; }

.map-interstitial-backdrop{
  position:absolute;
  inset:0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
}

.map-interstitial-card{
  position:relative;
  width:min(520px, calc(100% - 28px));
  border-radius:18px;
  padding:18px;
  border:1px solid rgba(255,255,255,0.12);
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
  box-shadow: 0 18px 40px rgba(0,0,0,0.55);
}

.map-interstitial-title{
  font-size:16px;
  font-weight:700;
  margin-bottom:8px;
}

.map-interstitial-text{
  color: var(--text-secondary);
  font-size:14px;
  line-height:1.4;
  margin-bottom:14px;
}

.map-interstitial-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
}

.map-btn{
  border-radius:12px;
  padding:10px 12px;
  border:1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
  font-weight:600;
}

.map-btn-primary{
  background: rgba(245,158,11,0.18);
  border-color: rgba(245,158,11,0.35);
}

.map-btn:active{ transform: translateY(1px); }


/* ============================================
   Provincial Ferries Section (511 NS Twitter)
   ============================================ */

.provincial-ferries-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  padding: 0 16px 16px;
}

.provincial-ferry-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border-radius: 14px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,0.08);
}

.provincial-ferry-card.ferry-running {
  border-color: rgba(34, 197, 94, 0.3);
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.08), rgba(34, 197, 94, 0.02));
}

.provincial-ferry-card.ferry-suspended {
  border-color: rgba(239, 68, 68, 0.3);
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.08), rgba(239, 68, 68, 0.02));
}

.pf-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.pf-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
}

.pf-status-icon {
  font-size: 14px;
}

.pf-status {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.pf-reason {
  font-size: 12px;
  color: rgba(239, 68, 68, 0.9);
  margin-bottom: 4px;
}

.pf-time {
  font-size: 11px;
  color: var(--text-muted);
}

/* ============================================
   Provincial Alerts Section (511 NS Twitter)
   ============================================ */

.provincial-alert-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border-radius: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 10px;
}

.provincial-alert-card.pa-high {
  border-left: 3px solid #ef4444;
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.06), transparent 50%);
}

.provincial-alert-card.pa-medium {
  border-left: 3px solid #f59e0b;
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.06), transparent 50%);
}

.provincial-alert-card.pa-low {
  border-left: 3px solid #22c55e;
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.06), transparent 50%);
}

.pa-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.pa-icon {
  font-size: 16px;
}

.pa-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
}

.pa-description {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 10px;
}

.pa-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pa-time {
  font-size: 11px;
  color: var(--text-muted);
}

.pa-link {
  font-size: 12px;
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 500;
}

.pa-link:hover {
  text-decoration: underline;
}

/* Alert route badge */
.alert-route-badge {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-left: 8px;
}

/* Alert location link */
.pa-location {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.alert-location-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 6px;
  color: #60a5fa;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s;
}

.alert-location-link:active {
  background: rgba(59, 130, 246, 0.25);
}

/* ============================================
   Modal Action Buttons
   ============================================ */

.modal-actions {
  display: flex;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.modal-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
}

.modal-btn-map {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #60a5fa;
}

.modal-btn-map:hover {
  background: rgba(59, 130, 246, 0.25);
}

.modal-btn-link {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text-primary);
}

.modal-btn-link:hover {
  background: rgba(255,255,255,0.1);
}

/* ============================================
   Ferry Detail Modal
   ============================================ */

.ferry-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.ferry-modal-overlay.hidden {
  display: none;
}

.ferry-modal {
  width: min(400px, 100%);
  background: linear-gradient(180deg, rgba(30,30,35,0.98), rgba(20,20,25,0.98));
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 25px 50px rgba(0,0,0,0.5);
  overflow: hidden;
}

.ferry-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.ferry-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.ferry-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: rgba(255,255,255,0.06);
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s;
}

.ferry-modal-close:hover {
  background: rgba(255,255,255,0.12);
  color: var(--text-primary);
}

.ferry-modal-body {
  padding: 20px;
}

.ferry-detail-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 12px;
  margin-bottom: 16px;
}

.ferry-detail-status.running {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.ferry-detail-status.suspended {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.ferry-detail-status.unknown {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
}

.ferry-detail-icon {
  font-size: 20px;
}

.ferry-detail-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.ferry-detail-message {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.5;
}

.ferry-detail-reason {
  font-size: 14px;
  color: #f87171;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: rgba(239, 68, 68, 0.08);
  border-radius: 8px;
}

.ferry-detail-info {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.ferry-detail-info strong {
  color: var(--text-primary);
}

.ferry-modal-actions {
  display: flex;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.ferry-modal-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
}

.ferry-modal-btn-map {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #60a5fa;
}

.ferry-modal-btn-map:hover {
  background: rgba(59, 130, 246, 0.25);
}

.ferry-modal-btn-info {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text-primary);
}

.ferry-modal-btn-info:hover {
  background: rgba(255,255,255,0.1);
}

/* Make ferry cards clickable */
.provincial-ferry-card {
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.provincial-ferry-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.provincial-ferry-card:active {
  transform: translateY(0);
}

/* ============================================
   HRFE Help Link & Modal
   ============================================ */

.info-btn {
  background: none;
  border: none;
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 4px;
  margin-left: 4px;
  opacity: 0.5;
  transition: opacity 0.2s, color 0.2s;
  line-height: 1;
  vertical-align: middle;
}

.info-btn:hover {
  opacity: 1;
  color: var(--accent);
}

.hrfe-help-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--text-secondary);
}

.hrfe-help-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.hrfe-help-dot.high {
  background: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

.hrfe-help-dot.medium {
  background: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

.hrfe-help-dot.low {
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

.hrfe-help-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

.hrfe-help-list div {
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.hrfe-help-list div:last-child {
  border-bottom: none;
}

/* ============================================
   Ad Slots
   ============================================ */

.ad-slot {
  padding: 12px 16px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.ad-container {
  width: 100%;
  max-width: 320px;
  min-height: 100px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.ad-image {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.ad-link {
  display: block;
  transition: transform 0.2s, opacity 0.2s;
}

.ad-link:hover {
  transform: scale(1.02);
}

.ad-link:active {
  transform: scale(0.98);
  opacity: 0.9;
}

.ad-placeholder {
  color: var(--text-muted);
  font-size: 13px;
  padding: 20px;
  text-align: center;
  background: rgba(255,255,255,0.03);
  border-radius: 12px;
  border: 1px dashed rgba(255,255,255,0.1);
  width: 100%;
  max-width: 320px;
}

/* ============================================
   Cover Screen Warning
   ============================================ */

.cover-warning {
  margin-top: 20px;
  font-size: 12px;
  color: var(--text-muted);
  opacity: 0.7;
}

/* ============================================
   iOS-Style Button Polish
   ============================================ */

/* Primary buttons (like Enter on cover) */
button, .btn {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
  font-weight: 600;
  border-radius: 12px;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button:active, .btn:active {
  transform: scale(0.97);
  opacity: 0.9;
}

/* Cover enter button - iOS style */
.cover-enter {
  background: linear-gradient(180deg, #3b82f6, #2563eb);
  border: none;
  color: white;
  padding: 14px 48px;
  font-size: 17px;
  font-weight: 600;
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
  cursor: pointer;
}

.cover-enter:hover {
  background: linear-gradient(180deg, #60a5fa, #3b82f6);
}

.cover-enter:active {
  transform: scale(0.96);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* Section links - iOS style */
.section-link {
  font-weight: 500;
  color: #60a5fa;
  transition: opacity 0.15s;
}

.section-link:active {
  opacity: 0.6;
}

/* Card tap states - iOS style */
.traffic-card,
.hrfe-card,
.provincial-ferry-card,
.provincial-alert-card {
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.traffic-card:active,
.hrfe-card:active {
  transform: scale(0.98);
  opacity: 0.9;
}

/* Modal buttons - iOS style */
.modal-btn,
.ferry-modal-btn {
  font-weight: 600;
  border-radius: 12px;
  padding: 14px 20px;
  font-size: 15px;
}

/* Close buttons - iOS style */
.modal-close,
.ferry-modal-close {
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 16px;
}

/* Badge pills - iOS style */
.section-badge,
.card-badge {
  border-radius: 20px;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.3px;
}

/* ============================================
   Section & Modal Disclaimers
   ============================================ */

.section-disclaimer {
  font-size: 12px;
  color: var(--text-muted);
  padding: 10px 16px;
  margin-bottom: 12px;
  background: rgba(255,255,255,0.03);
  border-radius: 10px;
  line-height: 1.5;
}

.modal-disclaimer {
  font-size: 11px;
  color: var(--text-muted);
  padding: 10px 12px;
  margin-top: 10px;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  line-height: 1.4;
  width: 100%;
}

/* ============================================
   Haligonia Interstitial
   ============================================ */

.haligonia-interstitial {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(8px);
  padding: 20px;
}

.haligonia-interstitial.hidden {
  display: none;
}

.haligonia-interstitial-card {
  background: linear-gradient(180deg, rgba(30,30,35,0.98), rgba(20,20,25,0.98));
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.1);
  padding: 28px 24px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}

.haligonia-interstitial-icon {
  font-size: 40px;
  margin-bottom: 16px;
}

.haligonia-interstitial-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.haligonia-interstitial-text {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.haligonia-interstitial-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.haligonia-btn {
  width: 100%;
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
}

.haligonia-btn:active {
  transform: scale(0.97);
}

.haligonia-btn-back {
  background: rgba(255,255,255,0.08);
  color: var(--text-secondary);
  border: 1px solid rgba(255,255,255,0.12);
}

.haligonia-btn-back:hover {
  background: rgba(255,255,255,0.12);
  color: var(--text-primary);
}

.haligonia-btn-continue {
  background: linear-gradient(180deg, #3b82f6, #2563eb);
  color: white;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

.haligonia-btn-continue:hover {
  background: linear-gradient(180deg, #60a5fa, #3b82f6);
}

/* ============================================
   Hamburger Menu & Slide-out Nav
   ============================================ */

.hamburger-btn {
  display: none; /* Hidden on index - using bottom nav instead */
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  width: 40px;
  height: 40px;
  font-size: 20px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s;
  margin-left: 10px;
}

.hamburger-btn:hover {
  background: rgba(255,255,255,0.12);
}

.hamburger-btn:active {
  transform: scale(0.95);
}

.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 9998;
  opacity: 1;
  transition: opacity 0.3s;
}

.menu-overlay.hidden {
  display: none;
}

.slide-menu {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 85%);
  background: linear-gradient(180deg, #1a1a1f, #0f0f12);
  border-left: 1px solid rgba(255,255,255,0.1);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  transform: translateX(0);
  transition: transform 0.3s ease;
  box-shadow: -10px 0 40px rgba(0,0,0,0.5);
}

.slide-menu.hidden {
  transform: translateX(100%);
  display: flex;
}

.menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.menu-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.menu-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.08);
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  transition: all 0.15s;
}

.menu-close:hover {
  background: rgba(255,255,255,0.15);
  color: var(--text-primary);
}

.menu-items {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.menu-item {
  display: block;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.15s;
  border-left: 3px solid transparent;
}

.menu-item:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
  border-left-color: var(--accent-primary);
}

.menu-item:active {
  background: rgba(255,255,255,0.08);
}

.menu-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

.menu-footer a {
  color: var(--accent-primary);
  text-decoration: none;
}

/* ============================================
   About & Advertise Pages
   ============================================ */

.page-content {
  padding: 16px;
  max-width: 1200px;
  margin: 0 auto;
}

/* Narrow pages (about, advertise) get smaller width */
.narrow-page {
  max-width: 600px !important;
}

.about-hero, .advertise-hero {
  text-align: center;
  padding: 30px 0 20px;
}

.about-logo {
  width: 80px;
  height: auto;
  margin-bottom: 16px;
}

.about-title, .advertise-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.about-tagline, .advertise-tagline {
  font-size: 16px;
  color: var(--text-muted);
}

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

.about-section, .advertise-section {
  margin-bottom: 28px;
}

.about-section h2, .advertise-section h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.about-section p, .advertise-section p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
}

.about-section a, .advertise-section a {
  color: var(--accent-primary);
}

.about-footer {
  text-align: center;
  padding: 30px 0;
  color: var(--text-muted);
  font-size: 14px;
}

.about-footer a {
  color: var(--accent-primary);
  text-decoration: none;
}

/* Advertise page specifics */
.advertise-section.highlight {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 16px;
  padding: 20px;
}

.advertise-quote {
  font-size: 17px;
  font-style: italic;
  color: var(--text-primary);
  line-height: 1.5;
}

.advertise-cta {
  text-align: center;
  padding: 30px 0;
}

.advertise-cta h2 {
  font-size: 20px;
  margin-bottom: 12px;
}

.advertise-email-btn {
  display: inline-block;
  padding: 16px 32px;
  background: linear-gradient(180deg, #3b82f6, #2563eb);
  color: white;
  font-size: 18px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
  margin: 16px 0;
  transition: all 0.15s;
}

.advertise-email-btn:active {
  transform: scale(0.97);
}

.advertise-note {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 12px;
}

/* ============================================
   Bridges & Ferries Page
   ============================================ */

.bridge-status-large, .ferry-status-large, .provincial-ferries-large {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.bridge-card-large, .ferry-card-large, .pf-card-large {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 16px;
}

.bridge-name, .ferry-name, .pf-name-large {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.bridge-meta, .ferry-route, .pf-route {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 8px;
}

.pf-time {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.pf-header-large {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pf-status-large {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 8px;
}

.pf-reason-large {
  font-size: 13px;
  color: #f87171;
  margin-top: 8px;
}

.pf-card-large.ferry-running {
  border-color: rgba(34, 197, 94, 0.3);
}

.pf-card-large.ferry-suspended {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.05);
}

/* ============================================
   Flights Page
   ============================================ */

.stanfield-link-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.05));
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 14px;
  text-decoration: none;
  transition: all 0.15s;
}

.stanfield-link-card:active {
  transform: scale(0.98);
}

.stanfield-link-icon {
  font-size: 32px;
}

.stanfield-link-text {
  flex: 1;
}

.stanfield-link-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.stanfield-link-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.stanfield-link-arrow {
  font-size: 20px;
  color: var(--accent-primary);
}

.flight-alert-card {
  background: rgba(255,255,255,0.04);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
}

.flight-alert-card.delay {
  border-left: 3px solid #f59e0b;
}

.flight-alert-card.cancelled {
  border-left: 3px solid #ef4444;
}

.flight-alert-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

.flight-number {
  font-weight: 600;
  color: var(--text-primary);
}

.flight-status {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.flight-route {
  font-size: 14px;
  color: var(--text-secondary);
}

.flight-time {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.info-banner {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  color: var(--text-primary);
}

/* ============================================
   External Links
   ============================================ */

.external-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.external-link-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.15s;
}

.external-link-card:hover {
  background: rgba(255,255,255,0.06);
}

.external-link-card:active {
  transform: scale(0.98);
}

.external-link-icon {
  font-size: 20px;
}

.external-link-text {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.external-link-arrow {
  color: var(--text-muted);
}

/* ============================================
   Camera Modal
   ============================================ */

.camera-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.camera-modal-content {
  position: relative;
  max-width: 100%;
  max-height: 100%;
}

.camera-modal-content img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 12px;
}

.camera-modal-label {
  text-align: center;
  margin-top: 12px;
  font-size: 14px;
  color: var(--text-secondary);
}

.camera-modal-close {
  position: absolute;
  top: -40px;
  right: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.1);
  color: white;
  font-size: 18px;
  cursor: pointer;
}

/* ============================================
   Loading & Error States
   ============================================ */

.loading-state, .error-state {
  padding: 30px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

.error-state {
  color: #f87171;
}

/* ============================================
   Section Note
   ============================================ */

.section-note {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
  padding: 0 4px;
}

/* ============================================
   Transit Alerts Page
   ============================================ */

.transit-page {
  padding-bottom: 80px;
}

.transit-status-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: 14px;
  margin-bottom: 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}

.transit-status-header.status-good {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.25);
}

.transit-status-header.status-warning {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.25);
}

.transit-status-header.status-alert {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.25);
}

.transit-status-icon {
  font-size: 32px;
}

.transit-status-info {
  flex: 1;
}

.transit-status-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.transit-status-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.transit-quick-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.transit-stat {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
}

.transit-stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

.transit-stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.transit-filter {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 0 4px;
}

.transit-filter label {
  font-size: 13px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.transit-filter-select {
  flex: 1;
  min-width: 0;
  padding: 10px 36px 10px 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 14px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='white' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.transit-filter-select option {
  background: #1a1a1f;
  color: var(--text-primary);
  padding: 10px;
}

/* Old transit-alert-card styles removed - now using .traffic-card */

.transit-alert-card.alert-info {
  border-left: 4px solid #6b7280;
}

.alert-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  cursor: pointer;
  transition: background 0.15s;
}

.alert-header:hover {
  background: rgba(255,255,255,0.02);
}

.alert-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.alert-main {
  flex: 1;
  min-width: 0;
}

.alert-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

.alert-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.alert-route {
  display: inline-block;
  padding: 3px 8px;
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

.alert-direction {
  display: inline-block;
  padding: 3px 8px;
  background: rgba(255,255,255,0.08);
  color: var(--text-secondary);
  border-radius: 6px;
  font-size: 11px;
}

.alert-cause {
  display: inline-block;
  padding: 3px 8px;
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-radius: 6px;
  font-size: 11px;
}

.alert-date-full {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.alert-stops-inline {
  color: var(--text-muted);
  font-size: 11px;
}

.alert-date {
  color: var(--text-muted);
  font-size: 11px;
  margin-left: auto;
  padding-left: 8px;
}

.alert-location {
  color: var(--text-muted);
  font-size: 11px;
}

.alert-expand {
  font-size: 12px;
  color: var(--text-muted);
  transition: transform 0.2s;
  padding: 4px;
}

.transit-alert-card.expanded .alert-expand {
  transform: rotate(180deg);
}

.alert-details {
  display: none;
  padding: 0 14px 14px 50px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.transit-alert-card.expanded .alert-details {
  display: block;
}

.alert-stops {
  margin-bottom: 12px;
}

.alert-stops-label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.alert-stop-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.stop-badge {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: monospace;
}

.alert-detour-routing {
  margin-bottom: 12px;
}

.alert-detour-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.alert-detour-steps {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  padding: 10px;
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
  font-family: monospace;
}

.alert-no-service {
  font-size: 13px;
  color: #f87171;
  padding: 10px;
  background: rgba(239, 68, 68, 0.1);
  border-radius: 8px;
}

.transit-last-updated {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 20px;
  padding: 10px;
}

.loading-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

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

.retry-btn {
  margin-top: 12px;
  padding: 10px 20px;
  background: var(--accent-primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}

.empty-state-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.refresh-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  width: 40px;
  height: 40px;
  font-size: 18px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s;
}

.refresh-btn:hover {
  background: rgba(255,255,255,0.12);
}

.refresh-btn:active {
  transform: scale(0.95);
}

/* ============================================
   Transit Alerts Mini Cards (Dashboard)
   ============================================ */

.transit-alert-mini {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  background: rgba(255,255,255,0.03);
  border-radius: 10px;
  margin-bottom: 8px;
  border-left: 3px solid rgba(255,255,255,0.2);
  width: 100%;
  box-sizing: border-box;
}

.transit-alert-mini.detour {
  border-left-color: #f59e0b;
}

.transit-alert-mini.cancellation {
  border-left-color: #ef4444;
}

.transit-alert-mini.closure {
  border-left-color: #8b5cf6;
}

.transit-alert-mini-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.transit-alert-mini-content {
  flex: 1;
  min-width: 0;
}

.transit-alert-mini-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

.transit-alert-mini-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
  font-size: 11px;
}

.transit-alert-cause {
  color: #fbbf24;
}

.transit-alert-stops {
  color: var(--text-muted);
}

.transit-alert-date {
  color: var(--text-muted);
  margin-left: auto;
  font-size: 11px;
}

/* Status banner states */
.transit-status-banner.warning {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.25);
}

.transit-status-banner.alert {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.25);
}

.transit-status-banner.warning .transit-status-title,
.transit-status-banner.alert .transit-status-title {
  color: var(--text-primary);
}

/* Traffic Impact Alert in Transit Section */
.transit-alert-mini.traffic-impact {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
}

.transit-alert-mini.traffic-impact .transit-alert-mini-icon {
  color: #ef4444;
}

.transit-alert-mini.traffic-impact .transit-alert-cause {
  color: rgba(239, 68, 68, 0.9);
}

/* Error Handling Styles */
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  min-height: 400px;
}

.error-icon {
  font-size: 64px;
  margin-bottom: 20px;
  opacity: 0.6;
}

.error-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.error-message {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 500px;
  margin-bottom: 24px;
  line-height: 1.5;
}

.error-retry-btn {
  background: var(--accent);
  color: #000;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s;
}

.error-retry-btn:hover {
  opacity: 0.9;
}

.error-retry-btn:active {
  transform: scale(0.96);
}

.error-technical {
  margin-top: 20px;
  text-align: left;
  max-width: 600px;
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  padding: 12px;
}

.error-technical summary {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 13px;
  padding: 4px 0;
}

.error-technical code {
  display: block;
  margin-top: 8px;
  padding: 8px;
  background: rgba(0,0,0,0.3);
  border-radius: 4px;
  font-size: 12px;
  color: #ff6b6b;
  overflow-x: auto;
}

.warning-banner {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.warning-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.warning-text {
  flex: 1;
  font-size: 14px;
  color: var(--text-primary);
}

.warning-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.warning-close:hover {
  opacity: 1;
}

/* ==========================================================================
   Live Bus Preview (Homepage Mini Map)
   ========================================================================== */

.live-bus-preview {
  display: block;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  margin-top: 16px;
  transition: border-color 0.2s, transform 0.2s;
}

.live-bus-preview:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.live-bus-preview:active {
  transform: translateY(0);
}

.live-bus-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.03);
}

.live-bus-preview-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.live-bus-preview-open {
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
}

.live-bus-preview-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 107, 0, 0.15);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
}

.live-bus-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  animation: busPulse 2s infinite;
}

@keyframes busPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.live-bus-active-count {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.live-bus-preview-map {
  height: 180px;
  background: #1a1a2e;
  position: relative;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.live-bus-preview-map .leaflet-container {
  background: #1a1a2e;
}

.live-bus-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--text-muted);
  font-size: 14px;
}

/* Mini bus speech bubble markers */
.mini-bus-marker {
  background: transparent !important;
  border: none !important;
}

.mini-bus-bubble {
  display: inline-block;
  padding: 2px 5px;
  font-size: 10px;
  font-weight: 700;
  color: white;
  border-radius: 3px;
  white-space: nowrap;
  position: relative;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.mini-bus-point {
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid;
}

.live-bus-preview-footer {
  padding: 10px 14px;
  border-top: 1px solid var(--border-color);
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
}

/* Route pills as links */
a.route-pill {
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

a.route-pill:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Mini map marker styling */
.mini-bus-marker {
  background: transparent;
  border: none;
}

/* Disable interactions on mini map */
.live-bus-preview-map .leaflet-control-zoom,
.live-bus-preview-map .leaflet-control-attribution {
  display: none !important;
}

/* ==========================================================================
   Camera Modal - Enhanced Navigation
   ========================================================================== */

/* Return to Dashboard Button */
.camera-return-btn {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 32px;
  background: #FF6B00;
  border: 2px solid white;
  border-radius: 30px;
  color: white;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s, box-shadow 0.2s;
  z-index: 1002;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.camera-return-btn:hover {
  transform: translateX(-50%) scale(1.05);
  box-shadow: 0 6px 25px rgba(255, 107, 0, 0.5);
}

.camera-return-btn:active {
  transform: translateX(-50%) scale(0.98);
}

.camera-return-icon {
  font-size: 20px;
}

.camera-return-text {
  white-space: nowrap;
}

/* Camera Navigation Buttons */
.camera-fullscreen-nav {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
}

.camera-nav-btn {
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: white;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.camera-nav-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

.camera-nav-btn:active {
  background: rgba(255, 107, 0, 0.3);
}

/* Camera Source Text */
.camera-source {
  display: block;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 4px;
}

/* Improved Close Button */
.camera-fullscreen-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  background: rgba(0, 0, 0, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  color: white;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  z-index: 1003;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.camera-fullscreen-close:hover {
  background: rgba(255, 107, 0, 0.8);
  border-color: #FF6B00;
  transform: scale(1.1);
}

/* Mobile adjustments */
@media (max-width: 480px) {
  .camera-return-btn {
    bottom: 16px;
    padding: 12px 24px;
    font-size: 15px;
  }
  
  .camera-nav-btn {
    padding: 8px 16px;
    font-size: 13px;
  }
  
  .camera-fullscreen-close {
    top: 8px;
    right: 8px;
    width: 40px;
    height: 40px;
    font-size: 24px;
  }
}
/* ==========================================================================
   Bottom Navigation Bar
   ========================================================================== */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 0;
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0));
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 12px;
  min-width: 64px;
  background: none;
  border: none;
  text-decoration: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item:active {
  transform: scale(0.95);
}

.bottom-nav-item.active {
  color: var(--accent);
}

.bottom-nav-item:hover {
  color: var(--text-primary);
}

.bottom-nav-item.active:hover {
  color: var(--accent);
}

.bottom-nav-icon {
  font-size: 22px;
  line-height: 1;
}

.bottom-nav-label {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Scroll to Top Button */
.scroll-top-btn {
  position: fixed;
  bottom: 80px;
  right: 16px;
  z-index: 999;
  width: 48px;
  height: 48px;
  background: var(--accent);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(255, 107, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: opacity 0.3s, visibility 0.3s, transform 0.3s, background 0.2s;
}

.scroll-top-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-top-btn:hover {
  background: var(--accent-hover);
}

.scroll-top-btn:active {
  transform: scale(0.95);
}

/* Adjust scroll-top position when safe area is present */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .scroll-top-btn {
    bottom: calc(80px + env(safe-area-inset-bottom, 0));
  }
}

/* Bottom More Menu */
.bottom-more-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1001;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s;
}

.bottom-more-overlay.active {
  opacity: 1;
}

.bottom-more-menu {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1002;
  background: var(--bg-card);
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  transform: translateY(100%);
  transition: transform 0.3s ease-out;
  max-height: 70vh;
  overflow-y: auto;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-more-menu.active {
  transform: translateY(0);
}

.bottom-more-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 16px;
  font-weight: 600;
}

.bottom-more-close {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  color: var(--text-primary);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bottom-more-items {
  padding: 8px 0;
}

.bottom-more-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 15px;
  transition: background 0.2s;
}

.bottom-more-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.bottom-more-item:active {
  background: rgba(255, 255, 255, 0.1);
}

/* Add bottom padding to main content to account for bottom nav */
#content {
  padding-bottom: 80px;
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
  #content {
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0));
  }
}

/* Hide hamburger menu button on pages with bottom nav */
.menu-btn {
  display: none;
}

/* Version Tags */
.version-footer {
  text-align: center;
  padding: 16px;
  margin-bottom: 80px;
}

.version-tag {
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.6;
}

.section-version {
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0.5;
  font-weight: 400;
  margin-left: 4px;
}


/* AI Status Indicator */
.ai-status-indicator {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  margin: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
}

.ai-status-indicator.degraded {
  background: rgba(255, 193, 7, 0.15);
  border: 1px solid rgba(255, 193, 7, 0.3);
  color: #ffc107;
}

.ai-status-indicator.down {
  background: rgba(244, 67, 54, 0.15);
  border: 1px solid rgba(244, 67, 54, 0.3);
  color: #f44336;
}

.ai-status-icon {
  font-size: 14px;
}

.ai-status-text {
  opacity: 0.9;
}
