html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 80px; /* Increased to prevent footer overlap on mobile */
}

@media (min-width: 768px) {
  body {
    margin-bottom: 60px;
  }
}

/* ===== Mobile Optimization Styles ===== */

/* Map responsive height */
#routeMap {
  width: 100%;
  height: 300px;
}

@media (min-width: 576px) {
  #routeMap {
    height: 400px;
  }
}

@media (min-width: 768px) {
  #routeMap {
    height: 500px;
  }
}

@media (min-width: 992px) {
  #routeMap {
    height: 600px;
  }
}

/* Touch-friendly buttons on mobile */
@media (max-width: 767px) {
  .btn {
    padding: 0.5rem 1rem;
    font-size: 1rem;
    min-height: 44px; /* iOS recommended touch target */
  }

  .btn-lg {
    min-height: 48px;
  }

  .popular-route {
    min-height: 40px;
    margin: 0.25rem;
  }
}

/* Mobile-optimized spacing */
@media (max-width: 767px) {
  .container {
    padding-left: 15px;
    padding-right: 15px;
  }

  .card-body {
    padding: 1rem;
  }

  h1.display-4 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  h5 {
    font-size: 1.1rem;
  }
}

/* Mobile table styling */
@media (max-width: 767px) {
  .table-responsive {
    font-size: 0.85rem;
  }

  .table th,
  .table td {
    padding: 0.5rem 0.25rem;
  }
}

/* Collapsible card headers on mobile */
@media (max-width: 767px) {
  .collapsible-mobile {
    cursor: pointer;
    user-select: none;
  }

  .collapsible-mobile::after {
    content: ' ▼';
    float: right;
    font-size: 0.8em;
  }

  .collapsible-mobile.collapsed::after {
    content: ' ▶';
  }
}

/* Chart canvas mobile optimization */
@media (max-width: 767px) {
  canvas {
    max-height: 250px !important;
  }
}

/* Mobile navigation improvements */
@media (max-width: 767px) {
  .navbar-brand {
    font-size: 1.1rem;
  }

  .navbar-nav .nav-link {
    padding: 0.75rem 1rem;
  }
}

/* Badge sizing for mobile */
@media (max-width: 767px) {
  .badge {
    font-size: 0.85rem;
    padding: 0.35em 0.65em;
  }

  .display-4 .badge {
    font-size: 1.5rem;
    padding: 0.5rem 1rem;
  }
}

/* Improve touch targets for map markers */
.maplibregl-marker {
  cursor: pointer;
}

.maplibregl-popup-content {
  padding: 10px;
  max-width: 280px;
}

@media (max-width: 767px) {
  .maplibregl-popup-content {
    font-size: 0.85rem;
    padding: 8px;
    max-width: 240px;
  }
}

/* MapLibre controls repositioning for mobile */
@media (max-width: 767px) {
  .maplibregl-ctrl-top-right {
    top: 10px;
    right: 10px;
  }

  .maplibregl-ctrl-bottom-right {
    bottom: 10px;
    right: 10px;
  }
}

/* Prevent horizontal scroll on mobile */
body {
  overflow-x: hidden;
}

.container-fluid,
.row {
  max-width: 100%;
  overflow-x: hidden;
}

/* Improve form inputs on mobile */
@media (max-width: 767px) {
  input[type="text"],
  input[type="datetime-local"],
  .form-control {
    font-size: 16px; /* Prevents iOS zoom on focus */
  }
}

/* ===== Cookie Consent Banner ===== */
.cookie-consent-banner {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1.5rem;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
  z-index: 9999;
  transform: translateY(100%);
  transition: transform 0.3s ease-in-out;
}

.cookie-consent-banner.show {
  transform: translateY(0);
}

.cookie-consent-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

.cookie-consent-text {
  flex: 1;
}

.cookie-consent-text h5 {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.cookie-consent-text p {
  margin-bottom: 0;
  font-size: 0.95rem;
  line-height: 1.5;
}

.cookie-consent-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.cookie-consent-actions .btn {
  white-space: nowrap;
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
}

/* Mobile responsive */
@media (max-width: 767px) {
  .cookie-consent-banner {
    padding: 1rem;
  }

  .cookie-consent-content {
    flex-direction: column;
    gap: 1rem;
  }

  .cookie-consent-text h5 {
    font-size: 1rem;
  }

  .cookie-consent-text p {
    font-size: 0.85rem;
  }

  .cookie-consent-actions {
    width: 100%;
    flex-direction: column;
  }

  .cookie-consent-actions .btn {
    width: 100%;
    margin: 0;
  }
}

/* ===== Airport Autocomplete Styles ===== */
.airport-autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #dee2e6;
  border-top: none;
  border-radius: 0 0 0.375rem 0.375rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
  margin-top: 1px;
}

.airport-autocomplete-item {
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid #f1f3f5;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: background-color 0.15s ease;
}

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

.airport-autocomplete-item:hover,
.airport-autocomplete-item.active {
  background-color: #f8f9fa;
}

.airport-autocomplete-item.active {
  background-color: #e7f3ff;
}

.airport-code {
  font-weight: 600;
  font-size: 1rem;
  color: #0d6efd;
  min-width: 50px;
  font-family: 'Courier New', monospace;
}

.airport-details {
  flex: 1;
  min-width: 0;
}

.airport-name {
  font-weight: 500;
  color: #212529;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.95rem;
}

.airport-location {
  font-size: 0.85rem;
  color: #6c757d;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.airport-autocomplete-no-results {
  padding: 1rem;
  text-align: center;
  color: #6c757d;
  font-style: italic;
}

/* Mobile optimization */
@media (max-width: 767px) {
  .airport-autocomplete-dropdown {
    max-height: 250px;
  }

  .airport-autocomplete-item {
    padding: 0.5rem 0.75rem;
    gap: 0.75rem;
  }

  .airport-code {
    min-width: 40px;
    font-size: 0.9rem;
  }

  .airport-name {
    font-size: 0.85rem;
  }

  .airport-location {
    font-size: 0.75rem;
  }
}

/* ===== Timeframe Selection Styles ===== */
.btn-group[role="group"] {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-group .btn-check:checked + .btn-outline-primary {
  background-color: #0d6efd;
  border-color: #0d6efd;
  color: white;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.btn-group .btn-outline-primary {
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-group .btn-outline-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-group .btn-outline-primary i {
  margin-right: 0.5rem;
}

/* Mobile optimization for timeframe buttons */
@media (max-width: 767px) {
  .btn-group {
    display: flex;
    flex-direction: column;
    width: 100%;
  }

  .btn-group .btn {
    border-radius: 0.375rem !important;
    margin-bottom: 0.5rem;
  }

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