html, body {
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
}

/* Loading indicator animation */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Android WebView compatibility for spinner animation */
@-webkit-keyframes spin {
  0% { -webkit-transform: rotate(0deg); }
  100% { -webkit-transform: rotate(360deg); }
}

a {
  text-decoration: none;
}

#myMap {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  /* Performance optimization for tablets */
  will-change: transform;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

span.tripStartEnd { 
font-size: 9px;
font-style: italic;
}

.route-card {
  background: white;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  margin: 4px 0;
  padding: 3px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.route-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  border-color: #ccc;
}

.route-square {
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.5em;
  text-align: center;
  height: 100%;
  opacity: 0.9;
}

#route-results-container {
  max-width: 550px;
  margin: auto;
}

.routeResultContainer {
  padding: 8px;
}

.routeResultContainer .row {
  margin-bottom: 6px;
}

.routeResultContainer i {
  width: 20px;
  text-align: center;
  opacity: 0.8;
}

.btn-secondary {
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
  background: #4A90E2;
  color: white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  width: 100%;
  max-width: 400px;
  margin: 8px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
}

.btn-secondary:hover {
  background: #357ABD;
  transform: translateY(-1px);
}

.btn-secondary:active {
  transform: translateY(1px);
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

@media (min-width: 768px) {
  .btn-secondary {
    width: auto;
    margin: 0;
  }
}

#route-input-container {
  width: 100%;
  max-width: 800px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  padding: 8px;
  margin: auto;
  max-width: 500px;
}

.accordion {
  width: 100% !important;
}

.accordion-item {
  border: none;
}

#leftNavAccordion {
  --bs-accordion-active-bg: white !important;
  z-index: 10;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}

@media (max-width: 768px) {
  #route-input-container {
    max-width: 90%;
  }
}

.input-group {
  display: flex;
  align-items: center;
  padding: 8px;
}

.pin-icon {
  width: 24px;
  text-align: center;
  margin-right: 12px;
}

.blue-pin {
  color: #4285F4;
}

.red-pin {
  color: #EA4335;
}

.input-divider {
  height: 1px;
  background: #eee;
  margin: 0 8px;
}

#route-input-container input { 
  width: calc(100% - 36px); /* Adjust width to accommodate pin icon */
  padding: 8px 12px;
  border: none;
  font-size: 20px;
  background: transparent;
}

#route-input-container input:focus {
  outline: none;
}

#route-input-container input:focus {
  outline: none;
  border-color: #31AB32;
  box-shadow: 0 1px 4px rgba(49,171,50,0.2);
}

#route-input-container input::placeholder {
  color: #999;
}

#helpButton {
  position: fixed;
  bottom: 20px;
  right: 20px;
  font-size: 18px;
  background: orange;
  border: none;
}

#configButton {
  position: fixed;
  bottom: 20px;
  left: 20px;
  font-size: 18px;
  background: lightslategray;
  border: none;
}

#nav-logo { 
  max-height: 4rem;
}

/* CSS styles used by custom popup template */
/* Autocomplete styling */
.ui-autocomplete {
  max-height: 300px;
  overflow-y: auto;
  overflow-x: auto;
  background-color: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  z-index: 1000;
}
.ui-autocomplete .ui-menu-item {
  padding: 12px 15px;
  font-size: 1.1rem;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box;
}
.ui-autocomplete .ui-menu-item:last-child {
  border-bottom: none;
}
.ui-autocomplete .ui-menu-item:hover,
.ui-autocomplete .ui-menu-item.ui-state-focus {
  background-color: #f8f9fa;
  border-color: #ddd;
  margin: 0;
}
.ui-autocomplete .ui-menu-item div {
  padding: 3px 0;
}
/* Autocomplete spinner styling */
.autocomplete-spinner {
  display: inline-block;
  vertical-align: middle;
}
.autocomplete-spinner .spinner-border {
  color: #667eea;
}

.ui-autocomplete .ui-menu-item .ui-menu-item-wrapper {
  padding: 0;
}

/* Directions Modal Styling */
.directions-table-container {
  border-radius: 8px;
  overflow: hidden;
}

.directions-table-container table {
  margin-bottom: 0;
  background: white;
}

.directions-table-container table td {
  padding: 1rem 1.25rem;
  vertical-align: middle;
  border-color: #f0f0f0;
}

.directions-table-container table td:first-child {
  width: 100px;
  font-weight: 500;
  color: #666;
  white-space: nowrap;
}

.directions-table-container table td:last-child {
  font-size: 1.1em;
  color: #333;
}

.directions-table-container tr:hover {
  background-color: #f8f9fa;
}

#showDirectionsModal .modal-content {
  border: none;
  border-radius: 12px;
  overflow: hidden;
}

#showDirectionsModal .modal-header {
  background: #f8f9fa;
  border-bottom: 1px solid #eee;
  padding: 1.25rem;
}

#showDirectionsModal .modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #333;
}

#showDirectionsModal .modal-title i {
  color: #4A90E2;
  margin-right: 0.5rem;
}

/* Ensure modals appear above loading indicator */
.modal {
  z-index: 11000 !important;
}

.modal-backdrop {
  z-index: 10999 !important;
}

.customInfobox {
  max-width: 200px;
  padding: 10px;
  font-size: 12px;
}

.customInfobox .name {
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 5px;
}

#find-routes {
  border: none;
  padding: 8px 16px;
  width: 90%;
  margin: 16px auto;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  border-radius: 8px;
}

#calculating-routes {
  border: none;
  padding: 8px 16px;
  width: 90%;
  margin: 16px auto;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  border-radius: 8px;
}

#leftNavCollapse {
  border: none;
  background: transparent;
}

.accordion {
  background: transparent !important;
}

.accordion-item {
  border: none;
  background: transparent;
}


.route-card a.text-decoration-none {
  color: inherit !important;
}

/* Settings for the Truck Type Selector */
.tile-select {
  flex: 1;
  aspect-ratio: 1;
  max-width: 150px;
}
.tile-select .btn {
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  transition: all 0.2s ease-in-out;
  gap: 0.5rem;
}
.tile-select .btn i {
  font-size: 1.5rem;
}
.tile-select .btn:hover {
  transform: translateY(-2px);
}
.btn-check:checked + .btn {
  background-color: var(--bs-primary);
  color: white;
  border-color: var(--bs-primary);
}

/* Home V2 - Modern Beautiful Design */
.hero-v2 {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 6rem 0 4rem 0;
  color: white;
  position: relative;
  overflow: hidden;
}

.hero-v2::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.1);
  z-index: 1;
}

.hero-v2 .container {
  position: relative;
  z-index: 2;
}

.hero-headline {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  color: white;
  line-height: 1.1;
  margin-bottom: 2rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.underline-emphasis {
  position: relative;
  background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.underline-emphasis::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
  border-radius: 2px;
}

.hero-savings-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50px;
  padding: 1rem 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.hero-subheadline {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.hero-explainer {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.9);
  max-width: 700px;
  margin: 0 auto 3rem;
  line-height: 1.6;
}

.hero-cta {
  margin-top: 3rem;
}

/* Features Overview */
.features-overview {
  background: #f8f9fa;
  padding: 5rem 0;
}

.feature-highlight {
  background: white;
  border-radius: 20px;
  padding: 3rem 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  height: 100%;
}

.feature-highlight:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.feature-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  color: white;
  font-size: 2rem;
}

.feature-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 1rem;
}

.feature-description {
  color: #6c757d;
  line-height: 1.6;
  margin: 0;
}

/* Benefits Section */
.benefits-section {
  background: white;
  padding: 5rem 0;
}

.section-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  color: #2c3e50;
  margin-bottom: 1rem;
}

.section-subtitle {
  font-size: 1.2rem;
  color: #6c757d;
  margin-bottom: 0;
}

.benefit-card {
  background: #f8f9fa;
  border-radius: 20px;
  padding: 3rem;
  height: 100%;
  border: 1px solid #e9ecef;
  transition: all 0.3s ease;
}

.benefit-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
  border-color: #667eea;
}

.benefit-header {
  display: flex;
  align-items: center;
  margin-bottom: 2rem;
}

.benefit-icon {
  font-size: 2.5rem;
  color: #667eea;
  margin-right: 1rem;
}

.benefit-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: #2c3e50;
  margin: 0;
}

.benefit-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.benefit-list li {
  display: flex;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
  color: #495057;
  line-height: 1.5;
}

.benefit-list li:last-child {
  margin-bottom: 0;
}

.tagline-callout {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 20px;
  padding: 3rem;
  color: white;
  text-align: center;
  box-shadow: 0 15px 35px rgba(102, 126, 234, 0.3);
}

.tagline-text {
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  margin: 0;
  line-height: 1.4;
}

/* Video Section */
.video-section {
  background: #f8f9fa;
  padding: 5rem 0;
}

.video-container {
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  margin-bottom: 3rem;
}

/* Final CTA Section */
.final-cta-section {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  padding: 5rem 0;
  color: white;
}

.cta-headline {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 800;
  margin-bottom: 1rem;
}

.cta-description {
  font-size: 1.3rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 3rem;
}

.cta-buttons {
  margin-bottom: 2rem;
}

.cta-button-secondary {
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.8);
  color: white;
  padding: 1rem 2rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1.1rem;
  text-decoration: none;
  display: inline-block;
  transition: all 0.3s ease;
}

.cta-button-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: white;
  color: white;
  text-decoration: none;
  transform: translateY(-2px);
}

.cta-secondary .btn-link {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 1.1rem;
}

.cta-secondary .btn-link:hover {
  color: white;
  text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .hero-v2 {
    padding: 4rem 0 3rem 0;
  }
  
  .features-overview,
  .benefits-section,
  .video-section,
  .final-cta-section {
    padding: 3rem 0;
  }
  
  .feature-highlight,
  .benefit-card {
    padding: 2rem 1.5rem;
  }
  
  .tagline-callout {
    padding: 2rem 1.5rem;
  }
  
  .cta-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
  }
  
  .cta-button-primary,
  .cta-button-secondary {
    width: 100%;
    max-width: 300px;
    text-align: center;
  }
}

.benefit-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.benefit-list li {
  font-size: 1.1rem;
  color: #495057;
  margin-bottom: 0.75rem;
  padding-left: 1.5rem;
  position: relative;
  line-height: 1.4;
}

.benefit-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #27ae60;
  font-weight: bold;
  font-size: 1.2rem;
}

.tagline-bottom {
  font-size: 1.3rem;
  color: #495057;
  font-style: italic;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #e9ecef;
}

.tagline-bottom strong {
  color: #2c3e50;
  font-style: normal;
}

.video-section {
  background: #f8f9fa !important;
  padding: 4rem 0;
}

.video-section h3 {
  font-size: 1.8rem;
  font-weight: 600;
  color: #2c3e50;
}

.cta-section {
  background: #ffffff;
  padding: 3rem 0;
}

/* Responsive adjustments for Home V2 */
@media (max-width: 768px) {
  .hero-headline {
    font-size: 2.5rem;
  }
  
  .hero-subheadline {
    font-size: 1.5rem;
  }
  
  .hero-explainer {
    font-size: 0.9rem;
    padding: 0 1rem;
  }
  
  .benefit-title {
    font-size: 1.3rem;
  }
  
  .benefit-list li {
    font-size: 1rem;
  }
  
  .tagline-bottom {
    font-size: 1.1rem;
    padding: 0 1rem;
  }
  
  .hero-v2 {
    padding: 2rem 0 1rem 0;
  }
  
  .benefits-section {
    padding: 2rem 0;
  }
}

@media (max-width: 576px) {
  .hero-headline {
    font-size: 2rem;
  }
  
  .hero-subheadline {
    font-size: 1.3rem;
  }
}