:root {
    --primary-gradient: linear-gradient(167deg, #8de8ed 0%, #3296af 100%);
    --success-gradient: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --danger-gradient: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    --warning-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --bs-body-font-size: 1.2rem;
    --bs-body-color: #efefef;
    --bs-headings-color: #efefef;
    --bs-secondary-color: #abbac9bf !important;
    --fuel-biomass: #8f5a04;
    --fuel-coal:    #424242;
    --fuel-imports: #9C27B0;
    --fuel-gas:     #FF9800;
    --fuel-nuclear: #E91E63;
    --fuel-other:   #9E9E9E;
    --fuel-hydro:   #2196F3;
    --fuel-solar:   #FFEB3B;
    --fuel-wind:    #198754;
}

[col-fuel="biomass"] { background-color: var(--fuel-biomass); }
[col-fuel="coal"]    { background-color: var(--fuel-coal);    }
[col-fuel="imports"] { background-color: var(--fuel-imports); }
[col-fuel="gas"]     { background-color: var(--fuel-gas);     }
[col-fuel="nuclear"] { background-color: var(--fuel-nuclear); }
[col-fuel="other"]   { background-color: var(--fuel-other);   }
[col-fuel="hydro"]   { background-color: var(--fuel-hydro);   }
[col-fuel="solar"]   { background-color: var(--fuel-solar);   }
[col-fuel="wind"]    { background-color: var(--fuel-wind);    }



body {
    background-color: #0e0614;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.hero-brand-block a {
    color: #fff;
}

img.logo {
    width: 50px;
}

a.nav-link {
    font-size: 1.3rem;
    font-weight: 400;
    color: #fff;
    border-top: 3px solid #ffffff00;
    border-bottom: 1px solid #ffffff00;
        }
a.nav-link:hover {
    color: #d1e7ff;
    border-bottom: 2px solid #d1e7ff;
    transition: all 0.3s ease;
}
a.nav-link.active {
    font-weight: 600;
    border-top: 3px solid #fff;
}

.cacheInd {
    width: 10px;
    height: 10px;
    display: inline-flex;
    align-items: center;
    border-radius: 50%;
}

/* Navbar styling */
.navbar {
    background: #242547;
    border-radius: 5px;    
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1030; /* Ensure it stays above other content */
}

.navbar-brand h1 {
    font-size: 1.5rem;
    margin: 0;
    color: white;
}

.navbar-brand h1 a {
    color: white;
    text-decoration: none;
}

.navbar-brand h1 a:hover {
    color: rgba(255, 255, 255, 0.9);
}

/* Navbar links */
.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9);
    padding: 0.5rem 1rem;
    transition: color 0.2s;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: white;
}

/* Mobile navbar */
@media (max-width: 991px) {
    .navbar-brand h1 {
        font-size: 1.2rem;
    }
    
    .navbar-collapse {
        background: #242547;
        border-radius: 8px;
    }
    
    .navbar-nav {
        gap: 0.5rem;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
        border-radius: 4px;
    }
    
    .navbar-nav .nav-link:hover {
        background: rgba(255, 255, 255, 0.1);
    }
}

/* Desktop adjustments */
@media (min-width: 992px) {
    .navbar-brand h1 {
        font-size: 1.75rem;
    }
}




.stat-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #242547;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 24px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    
}

.stat-card:hover {
    /*transform: translateY(-4px);*/
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.chart-container {
    position: relative;
    min-height: 250px;
    flex-grow: 1;
}

/*health section styling */

#health-Section .card {
    background: #537699!important;
}

#health-Section .stat-card {
    background: #d0f5fb;
}

#health-Section .stat-card h3 {
    color: #255254;
}

#health-Section .text-primary, #health-Section .text-success {
    color: #a3ffa9 !important;
}

#health-Section .text-danger {
    color: #ff751a !important;
}

#health-Section .text-secondary {
    color: aliceblue !important;
}

#health-Section .text-muted {
    color: #ebf6ff !important;
}

/* Energy section styling */

.form-control, .form-control:focus {
    background: #242547;
    color: #fff;
    border: 1px solid #343a40;
}

#demand .card, #demand .list-group-item, .stat-card .card {
    background: #1c202a;
    color: #fff;
    
}

.bg-interconnectors {
    background: #882eca;
}

.bg-generation {
    background: #61D29A;
}

.bg-solar {
    opacity: 1;
    background: #d4a20c;
}   

.bg-additional {
    background: #e28f22;
}

.bg-summary {
    background: #f19a20;
}

/* Animated flow indicators */
.flow-indicator {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    font-size: 0.875rem;
    margin-left: 8px;
    vertical-align: middle;
  }
  
  .flow-line {
    width: 20px;
    height: 6px;
    position: relative;
    overflow: hidden;
    display: inline-block;
  }
  
  .flow-line::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: repeating-linear-gradient(
      to right,
      currentColor 0,
      currentColor 5px,
      transparent 5px,
      transparent 10px
    );
    animation: flow 1s linear infinite;
  }
  
  /* Export flow (moves left) */
  .flow-export .flow-line::before {
    animation-direction: reverse;
  }
  
  @keyframes flow {
    0% {
      transform: translateX(0);
    }
    100% {
      transform: translateX(10px);
    }
  }
  
  .flow-arrow {
    display: inline-flex;
    align-items: center;
    font-size: 1.1em;
  }
  
  .flow-export {
    color: #198754; 
    
  }
  
  .flow-import {
    color: #dc3545;
  }
  
  .flow-none {
    color: #6c757d; /* Bootstrap muted/gray */
  }

/* Economy section styling */
.stat-card h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: #dedede;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 0.5rem;
}

.stat-card .h2 {
    font-size: 2.5rem;
    font-weight: 700;
}

.stat-card .bg-light {
    background-color: #f8f9fa !important;
    border: 1px solid #e9ecef;
}

#economySection .stat-card {
    background: #3c5152;
}

#economySection .card {
    background: #4a9195;
}

#economySection .text-muted {
    color: #d1e7ff !important;
}

#economySection .card div {
    color: #ecff42;
    font-size: 1.3rem;
}

#economySection .text-success {
    color: #00ff3a !important;
    text-shadow: 1px 1px 2px black;
}

#economySection .text-danger {
    color: #ff3600 !important;
    text-shadow: 1px 1px 2px black;
}

.stat-card small.text-muted {
    font-size: 0.875rem;
}

.last-updated {
    padding-top: 0.75rem;
    border-top: 1px solid #e9ecef;
    font-size: 0.85rem;
}

.stat-value {
    font-size: 36px;
    font-weight: bold;
    color: #212529;
}

.stat-label {
    font-size: 14px;
    color: #e3e3e3;
    margin-top: 4px;
}

.section-header {
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e3e3e3;
}

.section-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: #e3e3e3;
    margin: 0;
}

.section-header .badge {
    vertical-align: middle;
    margin-left: 12px;
}

.energy-source-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #e3e3e3;
    border-radius: 8px;
    margin-bottom: 8px;
}

.energy-source-name {
    font-weight: 600;
    text-transform: capitalize;
}

.energy-source-percentage {
    font-size: 20px;
    font-weight: bold;
}

.weather-card {
    background: var(--primary-gradient);
    color: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
}

.weather-temp {
    font-size: 48px;
    font-weight: bold;
}

.weather-city {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.weather-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 16px;
}

.weather-detail-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

#weather-hourly, .forecast-scroll-container {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-color: rgba(0, 0, 0, 0.3) transparent;
}

#weather-hourly::-webkit-scrollbar, .forecast-scroll-container::-webkit-scrollbar {
    height: 6px;
}

#weather-hourly::-webkit-scrollbar-track, .forecast-scroll-container::-webkit-scrollbar-track {
    background: transparent;
}

#weather-hourly::-webkit-scrollbar-thumb, .forecast-scroll-container::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

.forecast-card {
    min-width: 122px;
}

.hourly-container {
    display: flex;
    gap: 12px;
    padding: 16px 0;
    min-width: min-content;
}

.hourly-item {
    flex: 0 0 auto;
    width: 80px;
    text-align: center;
    padding: 12px 8px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.hourly-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.hourly-item.now {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: white;
    font-weight: 600;
}

.hourly-time {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #495057;
}

.hourly-item.now .hourly-time,
.hourly-item.now .hourly-temp,
.hourly-item.now .hourly-wind,
.hourly-item.now .hourly-rain {
    color: white;
}

.hourly-icon {
    font-size: 32px;
    margin: 8px 0;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.hourly-temp {
    font-size: 16px;
    font-weight: 700;
    color: #212529;
    margin: 8px 0 4px 0;
}

.hourly-wind {
    font-size: 11px;
    color: #6c757d;
    margin: 4px 0;
}

.hourly-rain {
    font-size: 11px;
    color: #0d6efd;
    margin: 4px 0;
}

.forecast-day {
    margin: 0;
}

.forecast-shortDate {
    font-size: 0.8rem;
    color: #666;
    margin: 0;
}

.forecast-card {
    transition: all 0.3s ease;
}

.forecast-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.forecast-card.active {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: white;
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.4);
}

.forecast-card.active .forecast-day,
.forecast-card.active .forecast-temps,
.forecast-card.active .forecast-wind {
    color: white;
}

/* Horizontal scroll container for mobile */
.forecast-scroll-container {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 12px;
    padding: 10px 0;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    
}

/* Hide scrollbar but keep functionality */
.forecast-scroll-container::-webkit-scrollbar {
    height: 6px;
}

.forecast-scroll-container::-webkit-scrollbar-track {
    background: transparent;
}

.forecast-scroll-container::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.forecast-scroll-container::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Forecast card wrapper */
.forecast-card-wrapper {
    flex: 0 0 auto; /* Don't shrink, don't grow */
    width: 140px;
}


/* Current weather display with large icon */
.current-weather-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin: 1rem 0;
}

.current-weather-icon {
    font-size: 4rem;
}

.weather-condition {
    font-size: 1.25rem;
    color: #ffffff;
    margin-bottom: 1rem;
    font-weight: 500;
}

/* Small icons for UK capitals grid */
.weather-icon-small {
    font-size: 2.5rem;
    margin: 0.5rem 0;
}

.weather-condition-small {
    font-size: 0.875rem;
    color: #ffffff;
    margin-bottom: 0.5rem;
}


.forecast-card {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
}

.forecast-day {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.forecast-icon {
    font-size: 2rem;
    margin: 0.5rem 0;
}

.forecast-temps {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.temp-max {
    font-weight: 600;
    color: #d9534f;
}

.temp-min {
    color: #5bc0de;
}

.forecast-wind {
    font-size: 0.875rem;
    color: #666;
}

/*search box */
/* Weather Location Search Suggestions Dropdown */
#weatherLocationSuggestions {
    margin-top: 2px;
    border-radius: 0.375rem;
    background-color: white;
    border: 1px solid rgba(0, 0, 0, 0.175);
}

#weatherLocationSuggestions .list-group-item {
    border: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.075);
    transition: background-color 0.15s ease-in-out;
}

#weatherLocationSuggestions .list-group-item:last-child {
    border-bottom: none;
    border-bottom-left-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
}

#weatherLocationSuggestions .list-group-item:first-child {
    border-top-left-radius: 0.375rem;
    border-top-right-radius: 0.375rem;
}

#weatherLocationSuggestions .list-group-item-action:hover {
    background-color: #f8f9fa;
}

#weatherLocationSuggestions .list-group-item-action:active {
    background-color: #e9ecef;
}

#weatherLocationSuggestions strong {
    color: #212529;
    font-size: 0.95rem;
}

#weatherLocationSuggestions .text-muted {
    color: #6c757d !important;
    font-size: 0.875rem;
}

#weatherLocationSuggestions .bi-geo-alt {
    font-size: 0.875rem;
}

/* Scrollbar styling for the suggestions */
#weatherLocationSuggestions::-webkit-scrollbar {
    width: 8px;
}

#weatherLocationSuggestions::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 0 0.375rem 0.375rem 0;
}

#weatherLocationSuggestions::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

#weatherLocationSuggestions::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Empty state styling */
#weatherLocationSuggestions .list-group-item.text-muted {
    color: #6c757d !important;
    text-align: center;
    padding: 1rem;
}

#weatherLocationSuggestions .list-group-item-action.active {
    background-color: #0d6efd !important;
    color: white !important;
}

#weatherLocationSuggestions .list-group-item-action.active strong,
#weatherLocationSuggestions .list-group-item-action.active .text-muted,
#weatherLocationSuggestions .list-group-item-action.active .location-details,
#weatherLocationSuggestions .list-group-item-action.active .location-details span {
    color: white !important;
}

/* Location details in suggestions */
#weatherLocationSuggestions .location-details {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

#weatherLocationSuggestions .location-details span {
    display: inline-block;
}

#weatherLocationSuggestions .location-details span:not(:last-child)::after {
    content: "•";
    margin-left: 0.25rem;
    color: #adb5bd;
}

#weatherLocationSuggestions .location-admin2 {
    color: #495057;
}

#weatherLocationSuggestions .location-admin1 {
    color: #6c757d;
}

#weatherLocationSuggestions .location-country {
    color: #868e96;
    font-weight: 500;
}

#weatherLocationSuggestions strong {
    color: #212529;
    font-size: 1rem;
    display: block;
}

/* Custom column for 5 items per row on large screens */
@media (min-width: 992px) {
    .col-lg-2-4 {
        flex: 0 0 20%;
        max-width: 20%;
    }
}

.custom-location {
    border: 2px solid #d4eff5;
    box-shadow: 0 0 10px rgba(13, 110, 253, 0.3);
}

.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.error-message {
    background: #f8d7da;
    color: #842029;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #f5c2c7;
}

.renewable-meter {
    position: relative;
    height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.renewable-percentage {
    font-size: 64px;
    font-weight: bold;
    background: var(--success-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.renewable-label {
    font-size: 18px;
    color: #e3e3e3;
    font-weight: 600;
}

.exchange-rate-item {
    display: flex;
    justify-content: space-between;
    padding: 16px;
    background: white;
    border-radius: 8px;
    margin-bottom: 12px;
    border: 1px solid #e9ecef;
}

.currency-flag {
    font-size: 32px;
    margin-right: 12px;
}

.air-quality-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
}

.aqi-good { background: #89a607; color: #fff; }
.aqi-moderate { background: #b3da49; color: #db1e1e; }
.aqi-poor { background: #f8d7da; color: #ffffff; }
.aqi-good h3 { color: #fff; padding: 0; margin: 0; border: none; }
.aqi-moderate h3 { color: #db1e1e; padding: 0; margin: 0; border: none; }
.aqi-poor h3 { color: #000; padding: 0; margin: 0; border: none; }

.stat-card.air-quality {
    background: #d0f5fb !important;
}

.air-quality.stat-card .card {
    background: #259dcb !important;
}

.air-quality.stat-card .text-muted {
    color: #8DE2DB !important;
}

.text-aq {
    color: #132629;
    font-weight: 700;
}


.chart-container {
    position: relative;
    height: 300px;
    margin: 20px 0;
}

.cached-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(108, 117, 125, 0.1);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    color: #6c757d;
}

.refresh-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-gradient);
    border: none;
    color: white;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    cursor: pointer;
    transition: transform 0.3s ease;
    z-index: 1000;
}

.refresh-btn:hover {
    transform: scale(1.1);
}

.refresh-btn.spinning {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.last-updated {
    font-size: 12px;
    color: #6c757d;
    text-align: center;
    margin-top: 8px;
}

@media (max-width: 767px) {
    .forecast-card-wrapper {
        width: 120px; /* Even more compact on small phones */
        margin-right: 8px;
    }
    
    .forecast-card {
        padding: 12px 8px; /* Reduce padding */
        font-size: 0.9rem; /* Slightly smaller text */
    }
    
    .forecast-icon {
        font-size: 2rem; /* Smaller icon */
    }

    .section-header h2 {
        text-align: center;
    }
}

/* Tablet and up - switch to grid layout */
@media (min-width: 768px) {
    .forecast-scroll-container {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        overflow-x: visible;
        gap: 15px;
    }
    
    .forecast-card-wrapper {
        width: auto;
    }
}

/* Desktop - fixed 5 columns */
@media (min-width: 992px) {
    .forecast-scroll-container {
        grid-template-columns: repeat(14, 1fr);
    }
}

@media (max-width: 576px) {
    .hourly-item {
        width: 70px;
        padding: 10px 6px;
    }
    
    .hourly-icon {
        font-size: 28px;
    }
    
    .hourly-temp {
        font-size: 15px;
    }
}