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: 60px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  white-space: nowrap;
  line-height: 60px;
}

/* Custom Tankje.nl Styles */
.bg-gradient-primary {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
}

/* Navigation Active State */
.navbar-nav .nav-link.active {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 0.375rem;
  font-weight: 600;
}

.navbar-nav .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 0.375rem;
  transition: background-color 0.2s ease;
}

.card {
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.station-card {
  cursor: pointer;
  transition: all 0.3s ease;
}

.station-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Fuel Price Cards */
.fuel-price-card {
  border-left: 4px solid;
  transition: all 0.3s ease;
}

.fuel-price-card:hover {
  transform: scale(1.02);
}

.fuel-price-card.border-success {
  border-left-color: #198754;
}

.fuel-price-card.border-warning {
  border-left-color: #ffc107;
}

.fuel-price-card.border-danger {
  border-left-color: #dc3545;
}

/* Category Badges */
.badge.bg-success {
  background-color: #198754 !important;
}

.badge.bg-warning {
  background-color: #ffc107 !important;
  color: #000 !important;
}

.badge.bg-danger {
  background-color: #dc3545 !important;
}

/* Search Form */
.search-form {
  background: #f8f9fa;
  border-radius: 15px;
  padding: 2rem;
}

/* Results Grid */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

/* Loading Spinner */
.loading-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
}

/* Price Comparison */
.price-comparison {
  background: #e3f2fd;
  border-radius: 10px;
  padding: 1rem;
  margin: 1rem 0;
}

/* Station Stats */
.station-stats {
  background: #f3e5f5;
  border-radius: 10px;
  padding: 1rem;
}

/* Quick Actions */
.quick-actions .btn {
  margin-bottom: 0.5rem;
  transition: all 0.3s ease;
}

.quick-actions .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Alert Styles */
.alert {
  border-radius: 10px;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.alert-info {
  background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
  color: #0c5460;
}

.alert-warning {
  background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
  color: #856404;
}

.alert-success {
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  color: #155724;
}

/* Navigation */
.navbar-brand {
  font-weight: 700;
  font-size: 1.5rem;
}

.navbar-nav .nav-link {
  font-weight: 500;
  transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
  color: #fff !important;
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  opacity: 0.3;
}

/* Feature Cards */
.feature-card {
  background: white;
  border-radius: 15px;
  padding: 2rem;
  text-align: center;
  transition: all 0.3s ease;
  border: 1px solid #e9ecef;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.feature-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1rem;
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 2rem;
}

/* Statistics */
.stat-card {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  color: white;
  border-radius: 15px;
  padding: 2rem;
  text-align: center;
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.stat-number {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .hero-section h1 {
    font-size: 2.5rem;
  }
  
  .feature-card {
    margin-bottom: 1rem;
  }
  
  .stat-card {
    margin-bottom: 1rem;
  }
  
  .search-form {
    padding: 1rem;
  }
}

/* Animation Classes */
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

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

.slide-in-left {
  animation: slideInLeft 0.5s ease-out;
}

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

.slide-in-right {
  animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Utility Classes */
.text-gradient {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.shadow-custom {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.border-radius-custom {
  border-radius: 15px;
}

/* Fuel Type Icons */
.fuel-type-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.fuel-type-icon.euro95 { color: #28a745; }
.fuel-type-icon.euro98 { color: #ffc107; }
.fuel-type-icon.diesel { color: #dc3545; }
.fuel-type-icon.premium-diesel { color: #17a2b8; }
.fuel-type-icon.lpg { color: #6c757d; }
.fuel-type-icon.cng { color: #343a40; }

/* Fuel Type Selector Styling */
.fuel-type-selector {
  position: relative;
  margin-top: 0;
  padding-top: 1.9rem; /* Uitlijning met het zoekveld (label + input) */
}

.fuel-chip-main {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 25px;
  background-color: white;
  border: 2px solid #e9ecef;
  cursor: pointer;
  transition: all 0.3s ease;
  user-select: none;
  font-size: 0.9rem;
  font-weight: 500;
  width: 100%; /* Gebruik volledige beschikbare ruimte */
  justify-content: space-between; /* Verdeel ruimte tussen elementen */
}

.fuel-chip-main:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-color: #007bff;
}

.fuel-chip-main:active {
  transform: translateY(0);
}

.chip-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.chip-text {
  color: #495057;
  font-weight: 500;
  flex-grow: 1;
  text-align: center; /* Centreer de tekst in de beschikbare ruimte */
}

/* Dropdown styling */
.fuel-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  margin-top: 0.5rem;
  display: none;
  overflow: hidden;
  width: 100%; /* Gebruik volledige breedte van de kolom */
}

.fuel-dropdown.show {
  display: block;
  animation: fadeInDown 0.2s ease-out;
}

.fuel-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
  border-bottom: 1px solid #f8f9fa;
}

.fuel-option:last-child {
  border-bottom: none;
}

.fuel-option:hover {
  background-color: #f8f9fa;
}

.fuel-option:active {
  background-color: #e9ecef;
}

.option-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.option-text {
  color: #495057;
  font-weight: 500;
  font-size: 0.9rem;
}

/* Animation */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive design */
@media (max-width: 768px) {
  .fuel-chip-main {
    padding: 0.6rem 0.8rem;
    font-size: 0.85rem;
    min-width: 120px;
  }
  
  .fuel-dropdown {
    min-width: 180px;
  }
  
  .chip-color, .option-color {
    width: 10px;
    height: 10px;
  }
}

/* Extra kleine schermen */
@media (max-width: 576px) {
  .fuel-type-selector {
    padding-top: 1rem;
  }
  
  .fuel-chip-main {
    width: 100%;
    padding: 0.5rem 0.7rem;
    font-size: 0.8rem;
  }
}

/* Price Comparison Table */
.price-table {
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.price-table th {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  color: white;
  border: none;
  padding: 1rem;
}

.price-table td {
  padding: 1rem;
  border-bottom: 1px solid #e9ecef;
}

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

/* Loading States */
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

/* Error States */
.error-state {
  text-align: center;
  padding: 2rem;
  color: #6c757d;
}

.error-state i {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: #dc3545;
}

/* Success States */
.success-state {
  text-align: center;
  padding: 2rem;
  color: #155724;
}

.success-state i {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: #28a745;
}

/* Autocomplete Styling */
.autocomplete-suggestions {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    background: white !important;
    border: 1px solid #ddd !important;
    border-top: none !important;
    border-radius: 0 0 4px 4px !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15) !important;
    z-index: 100000 !important;
    max-height: 300px !important;
    overflow-y: auto !important;
    display: none;
    width: 100% !important;
    min-width: 200px !important;
}

/* Location button styling */
#locationBtn {
    transition: all 0.2s ease;
    min-width: 3rem;
}

/* Make search input larger */
#searchQuery {
    height: 3rem;
    font-size: 1rem;
}

/* Adjust location button height to match */
#locationBtn {
    height: 3rem;
    padding: 0.5rem 0.75rem;
}

/* Make search button match the height */
.btn[type="submit"] {
    height: 3rem;
    padding: 0.5rem 1rem;
}

#locationBtn:hover {
    background-color: #e3f2fd;
    border-color: #007bff;
    color: #007bff;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
}

#locationBtn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 123, 255, 0.2);
}

#locationBtn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Ensure input-group has relative positioning for autocomplete */
.input-group.position-relative {
    position: relative !important;
}

/* Loading spinner animation */
.spin {
    animation: spin 1s linear infinite;
}

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

/* Location error message styling */
.location-error-message {
    border-radius: 0.375rem;
    border-left: 4px solid #dc3545;
}

.suggestion-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s ease;
    font-size: 14px;
    line-height: 1.4;
}

.suggestion-item:hover {
    background-color: #007bff !important;
    color: white !important;
    transform: translateX(2px);
}

.suggestion-item:last-child {
    border-bottom: none;
    border-radius: 0 0 4px 4px;
}

.suggestion-item:first-child {
    border-radius: 0 0 0 0;
}

/* Ensure autocomplete is above all other elements */
#citySuggestions {
    z-index: 10000 !important;
    position: absolute !important;
}

/* Position the input containers relatively for proper autocomplete positioning */
.city-input-container,
.brand-input-container {
    position: relative !important;
}

#citySuggestions.autocomplete-suggestions {
    position: absolute !important;
    z-index: 10000 !important;
    background: white !important;
    border: 1px solid #ddd !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15) !important;
}

/* Map Layout Improvements */
#map {
    border-radius: 0 0 4px 4px;
}

.station-card {
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.station-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15) !important;
}

/* Responsive adjustments for map */
@media (max-width: 991.98px) {
    #map {
        height: 400px !important;
        margin-top: 20px;
    }
    
    .station-card {
        margin-bottom: 15px;
    }
    
    /* Mobile location button adjustments */
    #locationBtn {
        min-width: 40px;
        padding: 0.5rem 0.5rem;
        height: 3rem;
    }
    
    /* Mobile search input adjustments */
    #searchQuery {
        height: 3rem;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Mobile search button adjustments */
    .btn[type="submit"] {
        height: 3rem;
        padding: 0.5rem 0.75rem;
    }
    
    .input-group .btn {
        font-size: 0.875rem;
    }
}

/* Small mobile devices */
@media (max-width: 575.98px) {
    #locationBtn {
        min-width: 38px;
        padding: 0.5rem 0.375rem;
        height: 3rem;
    }
    
    #searchQuery {
        height: 3rem;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .btn[type="submit"] {
        height: 3rem;
        padding: 0.5rem 0.5rem;
    }
    
    .input-group .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Enhanced card styling */
.card-header {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.card-title {
    color: #495057;
    font-weight: 600;
}

/* Badge improvements - Fixed category colors */
.badge {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
}

/* Category Badges - Fixed colors including Cat 0 */
.badge.bg-success {
    background-color: #198754 !important;
    color: white !important;
}

.badge.bg-warning {
    background-color: #ffc107 !important;
    color: #000 !important;
}

.badge.bg-danger {
    background-color: #dc3545 !important;
    color: white !important;
}

.badge.bg-secondary {
    background-color: #6c757d !important;
    color: white !important;
}

/* Leaflet popup button styling - Fixed blue button with blue text issue */
.leaflet-popup-content .btn-primary {
    background-color: #007bff !important;
    border-color: #007bff !important;
    color: white !important;
}

.leaflet-popup-content .btn-primary:hover {
    background-color: #0056b3 !important;
    border-color: #0056b3 !important;
    color: white !important;
}

/* Details page header styling - Fixed gray background with white text */
.card-header.bg-primary,
.card-header.bg-success,
.card-header.bg-info,
.card-header.bg-warning,
.card-header.bg-danger,
.card-header.bg-secondary {
    color: white !important;
}

.card-header.bg-primary h2,
.card-header.bg-primary h3,
.card-header.bg-primary h4,
.card-header.bg-primary h5,
.card-header.bg-primary h6,
.card-header.bg-success h2,
.card-header.bg-success h3,
.card-header.bg-success h4,
.card-header.bg-success h5,
.card-header.bg-success h6,
.card-header.bg-info h2,
.card-header.bg-info h3,
.card-header.bg-info h4,
.card-header.bg-info h5,
.card-header.bg-info h6,
.card-header.bg-warning h2,
.card-header.bg-warning h3,
.card-header.bg-warning h4,
.card-header.bg-warning h5,
.card-header.bg-warning h6,
.card-header.bg-danger h2,
.card-header.bg-danger h3,
.card-header.bg-danger h4,
.card-header.bg-danger h5,
.card-header.bg-danger h6,
.card-header.bg-secondary h2,
.card-header.bg-secondary h3,
.card-header.bg-secondary h4,
.card-header.bg-secondary h5,
.card-header.bg-secondary h6 {
    color: white !important;
}

/* Search form improvements */
.search-form {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid #e9ecef;
    border-radius: 8px;
}

.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Button improvements */
.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s;
}

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

/* Alert improvements */
.alert {
    border-radius: 8px;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Map popup styling */
.leaflet-popup-content {
    margin: 8px;
    min-width: 200px;
}

.leaflet-popup-content h6 {
    margin-bottom: 8px;
    color: #495057;
}

.leaflet-popup-content p {
    margin-bottom: 8px;
    color: #6c757d;
}

.leaflet-popup-content .btn {
    margin-top: 8px;
}

/* Station card data attributes for map integration */
.station-card[data-lat][data-lng] {
    position: relative;
}

.station-card[data-lat][data-lng]::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #28a745 0%, #ffc107 50%, #dc3545 100%);
    border-radius: 4px 4px 0 0;
}

/* Enhanced sorting buttons */
.btn-group .btn[data-sort] {
    border-radius: 0;
}

.btn-group .btn[data-sort]:first-child {
    border-radius: 4px 0 0 4px;
}

.btn-group .btn[data-sort]:last-child {
    border-radius: 0 4px 4px 0;
}

.btn-group .btn[data-sort].active {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
    z-index: 2;
}

/* Map container improvements */
.card-body.p-0 {
    overflow: hidden;
}

/* Responsive grid improvements */
@media (max-width: 767.98px) {
    .col-lg-6 {
        margin-bottom: 20px;
    }
    
    #map {
        height: 300px !important;
    }
}

/* Enhanced typography */
.display-4 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

.lead {
    font-weight: 400;
    opacity: 0.9;
}

/* Improved spacing */
.py-5 {
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
}

.mb-4 {
    margin-bottom: 1.5rem !important;
}

/* Card shadow improvements */
.shadow {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

.shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

/* Form improvements */
.form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
}

.form-control, .form-select {
    border-radius: 6px;
    border: 1px solid #ced4da;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus, .form-select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Enhanced button states */
.btn:active {
    transform: translateY(0);
}

.btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Improved accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Enhanced focus indicators */
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Improved mobile experience */
@media (max-width: 575.98px) {
    .container-fluid {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .display-4 {
        font-size: 2.5rem;
    }
    
    .lead {
        font-size: 1.1rem;
    }
}