/* ========================================================================
   GLOBAL DESIGN TOKENS
   ======================================================================== */
:root {
    /* Hero background - will be changed by JS */
    --hero-img: url('../images/eu.jpg');

    /* Colors */
    --text-main: #ffffff;
    --text-soft: #fff7e6;
    --text-warm: #f5f1e8;

    --day-color: #ffb347;
    --date-color: #ffd699;

    --gold-light: #ffedc9;
    --gold-mid: #e2b46f;
    --gold-deep: #e8810b;

    /* Dark glass effect (not white!) */
    --glass-bg: rgba(0, 0, 0, 0.5);
    --glass-border: rgba(255, 255, 255, 0.15);
    --card-bg: rgba(20, 20, 35, 0.7);

    /* Shadows */
    --shadow-strong: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-text: 0 2px 10px rgba(0, 0, 0, 0.9);

    /* Animation */
    --fade-duration: 0.6s;
    --slide-distance: 30px;

    /* Layout - smaller cards to fit 7 */
    --card-width: 135px;
}

/* ========================================================================
   GLOBAL RESET
   ======================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    color: var(--text-main);
    font-family: "Playfair Display", Georgia, serif;
    overflow-x: hidden;
    /* Fallback dark background */
    background: #0a0a15;
}

/* ========================================================================
   PERSISTENT BACKGROUND - THIS IS CRITICAL!
   ======================================================================== */
/* ========================================================================
   PERSISTENT BACKGROUND
   ======================================================================== */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: var(--hero-img);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -100;
    /* Add transition for smoother updates */
    transition: background-image 0.5s ease;
}

/* Dark overlay */
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.35);
    z-index: -99;
    pointer-events: none;
}

/* ========================================================================
   HERO SECTION
   ======================================================================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    padding: 2rem;
    /* Transparent so body background shows through */
    background: transparent;
}

.hero-inner-fade {
    transition: opacity 1s ease;
}

.hero-content {
    max-width: 900px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: center;
    z-index: 10;
}

.hero-title {
    font-size: clamp(2.5rem, 7vw, 5rem);
    font-weight: 700;
    color: var(--text-main);
    text-shadow: var(--shadow-text);
    line-height: 1.1;
}

.hero-sub {
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    color: var(--text-soft);
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.8);
    font-weight: 400;
}

/* ========================================================================
   CONTROLS (Select + Button)
   ======================================================================== */
.controls {
    display: flex;
    gap: 14px;
    padding: 16px 24px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--shadow-strong);
    flex-wrap: wrap;
    justify-content: center;
}

.controls select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    padding: 12px 16px;
    min-width: 220px;
    color: white;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.controls select:hover {
    background: rgba(255, 255, 255, 0.15);
}

.controls select:focus {
    outline: 2px solid var(--gold-mid);
    outline-offset: 2px;
}

.controls option {
    background: #1a1a2e;
    color: white;
    padding: 10px;
}

/* Gold Button */
.btn-gold {
    background: linear-gradient(135deg, #ffd993 0%, #e8a840 50%, #d4942a 100%);
    color: #2a1810;
    padding: 12px 28px;
    font-weight: 700;
    font-size: 1rem;
    font-family: inherit;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(232, 168, 64, 0.4);
}

.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(232, 168, 64, 0.5);
}

.btn-gold.small-btn {
    padding: 10px 20px;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

/* ========================================================================
   MAIN - Must be transparent!
   ======================================================================== */
main {
    background: transparent;
}

/* ========================================================================
   FORECAST SECTION - Transparent background!
   ======================================================================== */
#forecastSection {
    min-height: 100vh;
    padding: 50px 15px 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* CRITICAL: Transparent so city background shows! */
    background: transparent;
    position: relative;
    z-index: 10;
}

#forecastSection.hidden {
    display: none;
}

/* Forecast Heading */
.forecast-heading {
    text-align: center;
    margin-bottom: 25px;
}

.forecast-subtitle {
    display: block;
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    font-weight: 400;
    color: var(--text-soft);
    text-shadow: var(--shadow-text);
    margin-bottom: 8px;
}

.forecast-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: clamp(1.8rem, 4.5vw, 2.8rem);
    font-weight: 700;
    background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold-mid) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}

#forecastCityIcon {
    font-size: 1em;
    -webkit-text-fill-color: initial;
}

/* ========================================================================
   WEATHER GRID - Force 7 columns!
   ======================================================================== */
#weatherGrid,
.forecast-grid {
    display: grid;
    /* Force exactly 7 equal columns */
    grid-template-columns: repeat(7, var(--card-width));
    gap: 12px;
    padding: 15px;
    max-width: 1100px;
    width: 100%;
    justify-content: center;
    background: transparent;
}

/* ========================================================================
   WEATHER CARDS - Dark glass effect!
   ======================================================================== */
.weather-card {
    width: var(--card-width);
    /* Dark background, not white! */
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 18px;
    padding: 18px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    box-shadow: var(--shadow-strong);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.weather-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}

/* Day Name */
.w-day {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--day-color);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Date */
.w-date {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--date-color);
}

/* Weather Icon */
.w-icon {
    font-size: 2.5rem;
    line-height: 1;
    margin: 6px 0;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Temperature */
.w-temp {
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--text-main);
    text-shadow: var(--shadow-text);
    line-height: 1;
}

.w-temp sup {
    font-size: 1rem;
    font-weight: 500;
    opacity: 0.8;
}

/* Weather Condition */
.w-cond {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-soft);
    text-align: center;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* High / Low */
.w-hilo {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--gold-light);
}

/* Extra Weather Details */
.w-extra {
    width: 100%;
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.7rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.8);
}

.w-extra div {
    display: flex;
    justify-content: space-between;
    padding: 1px 0;
}

.w-extra strong {
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
}

/* ========================================================================
   CARD ANIMATIONS
   ======================================================================== */
.weather-animate {
    opacity: 0;
    transform: translateY(var(--slide-distance));
    animation: cardFadeIn var(--fade-duration) ease forwards;
}

@keyframes cardFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================================================
   MAP CONTAINER
   ======================================================================== */
#map,
.map-container {
    width: 100%;
    max-width: 900px;
    height: 350px;
    margin: 40px auto 0;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-strong);
    background: rgba(0, 0, 0, 0.3);
}

.leaflet-container {
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* ========================================================================
   LOADING OVERLAY
   ======================================================================== */
#loadingOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#loadingOverlay.active {
    opacity: 1;
    pointer-events: auto;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    color: var(--text-main);
    font-size: 1.2rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--gold-mid);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ========================================================================
   ERROR BOX
   ======================================================================== */
.error-box {
    background: rgba(220, 53, 69, 0.3);
    border: 1px solid rgba(220, 53, 69, 0.5);
    color: #ff8a8a;
    padding: 20px 30px;
    border-radius: 12px;
    text-align: center;
    font-size: 1rem;
    max-width: 500px;
    margin: 20px auto;
    backdrop-filter: blur(10px);
    grid-column: 1 / -1;
}

/* ========================================================================
   FOOTER
   ======================================================================== */
.footer {
    text-align: center;
    padding: 40px 20px;
    position: relative;
    z-index: 10;
    background: transparent;
}

.footer-text {
    color: var(--text-soft);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.footer-links a {
    color: var(--gold-mid);
    font-size: 1.3rem;
    transition: all 0.3s ease;
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--gold-light);
    transform: translateY(-3px);
}

.acknowledgement {
    margin-top: 20px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
}

/* ========================================================================
   RESPONSIVE - Horizontal scroll on smaller screens
   ======================================================================== */
@media (max-width: 1050px) {
    :root {
        --card-width: 130px;
    }

    #weatherGrid,
    .forecast-grid {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 15px;
        justify-content: flex-start;
        gap: 10px;
    }

    .weather-card {
        scroll-snap-align: start;
        flex-shrink: 0;
        min-width: 130px;
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 1.5rem;
    }

    .controls {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
    }

    .controls select {
        width: 100%;
        min-width: unset;
    }

    .btn-gold {
        width: 100%;
    }

    #forecastSection {
        padding: 40px 10px 60px;
    }

    .weather-card {
        min-width: 125px;
        padding: 14px 10px;
    }

    .w-icon {
        font-size: 2.2rem;
    }

    .w-temp {
        font-size: 2rem;
    }

    #map {
        height: 280px;
        margin-top: 30px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .forecast-title {
        font-size: 1.5rem;
    }

    .weather-card {
        min-width: 115px;
    }

    .w-extra {
        font-size: 0.65rem;
    }
}

/* ========================================================================
   SCROLLBAR STYLING
   ======================================================================== */
#weatherGrid::-webkit-scrollbar {
    height: 6px;
}

#weatherGrid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

#weatherGrid::-webkit-scrollbar-thumb {
    background: var(--gold-mid);
    border-radius: 3px;
}

/* ========================================================================
   iOS / SAFARI FIXES
   ======================================================================== */
@supports (-webkit-touch-callout: none) {
    body::before {
        background-attachment: scroll;
    }
}

/* ========================================================================
   UTILITY CLASSES
   ======================================================================== */
.hidden {
    display: none !important;
}

/* ========================================================================
   GLOBAL DESIGN TOKENS
   ======================================================================== */
:root {
    /* Hero background - will be changed by JS */
    --hero-img: url('../images/global.jpg');

    /* Colors */
    --text-main: #ffffff;
    --text-soft: #fff7e6;
    --text-warm: #f5f1e8;

    --day-color: #ffb347;
    --date-color: #ffd699;

    --gold-light: #ffedc9;
    --gold-mid: #e2b46f;
    --gold-deep: #e8810b;

    /* Dark glass effect (not white!) */
    --glass-bg: rgba(0, 0, 0, 0.5);
    --glass-border: rgba(255, 255, 255, 0.15);
    --card-bg: rgba(20, 20, 35, 0.7);

    /* Shadows */
    --shadow-strong: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-text: 0 2px 10px rgba(0, 0, 0, 0.9);

    /* Animation */
    --fade-duration: 0.6s;
    --slide-distance: 30px;

    /* Layout - smaller cards to fit 7 */
    --card-width: 135px;
}

/* ========================================================================
   GLOBAL RESET
   ======================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    color: var(--text-main);
    font-family: "Playfair Display", Georgia, serif;
    overflow-x: hidden;
    /* Fallback dark background */
    background: #0a0a15;
}

/* ========================================================================
   PERSISTENT BACKGROUND - THIS IS CRITICAL!
   ======================================================================== */
/* ========================================================================
   PERSISTENT BACKGROUND
   ======================================================================== */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: var(--hero-img);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -100;
    /* Add transition for smoother updates */
    transition: background-image 0.5s ease;
}

/* Dark overlay */
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.35);
    z-index: -99;
    pointer-events: none;
}

/* ========================================================================
   HERO SECTION
   ======================================================================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    padding: 2rem;
    /* Transparent so body background shows through */
    background: transparent;
}

.hero-inner-fade {
    transition: opacity 1s ease;
}

.hero-content {
    max-width: 900px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: center;
    z-index: 10;
}

.hero-title {
    font-size: clamp(2.5rem, 7vw, 5rem);
    font-weight: 700;
    color: var(--text-main);
    text-shadow: var(--shadow-text);
    line-height: 1.1;
}

.hero-sub {
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    color: var(--text-soft);
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.8);
    font-weight: 400;
}

/* ========================================================================
   CONTROLS (Select + Button)
   ======================================================================== */
.controls {
    display: flex;
    gap: 14px;
    padding: 16px 24px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--shadow-strong);
    flex-wrap: wrap;
    justify-content: center;
}

.controls select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    padding: 12px 16px;
    min-width: 220px;
    color: white;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.controls select:hover {
    background: rgba(255, 255, 255, 0.15);
}

.controls select:focus {
    outline: 2px solid var(--gold-mid);
    outline-offset: 2px;
}

.controls option {
    background: #1a1a2e;
    color: white;
    padding: 10px;
}

/* Gold Button */
.btn-gold {
    background: linear-gradient(135deg, #ffd993 0%, #e8a840 50%, #d4942a 100%);
    color: #2a1810;
    padding: 12px 28px;
    font-weight: 700;
    font-size: 1rem;
    font-family: inherit;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(232, 168, 64, 0.4);
}

.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(232, 168, 64, 0.5);
}

.btn-gold.small-btn {
    padding: 10px 20px;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

/* ========================================================================
   MAIN - Must be transparent!
   ======================================================================== */
main {
    background: transparent;
}

/* ========================================================================
   FORECAST SECTION - Transparent background!
   ======================================================================== */
#forecastSection {
    min-height: 100vh;
    padding: 50px 15px 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* CRITICAL: Transparent so city background shows! */
    background: transparent;
    position: relative;
    z-index: 10;
}

#forecastSection.hidden {
    display: none;
}

/* Forecast Heading */
.forecast-heading {
    text-align: center;
    margin-bottom: 25px;
}

.forecast-subtitle {
    display: block;
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    font-weight: 400;
    color: var(--text-soft);
    text-shadow: var(--shadow-text);
    margin-bottom: 8px;
}

.forecast-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: clamp(1.8rem, 4.5vw, 2.8rem);
    font-weight: 700;
    background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold-mid) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}

#forecastCityIcon {
    font-size: 1em;
    -webkit-text-fill-color: initial;
}

/* ========================================================================
   WEATHER GRID - Force 7 columns!
   ======================================================================== */
#weatherGrid,
.forecast-grid {
    display: grid;
    /* Force exactly 7 equal columns */
    grid-template-columns: repeat(7, var(--card-width));
    gap: 12px;
    padding: 15px;
    max-width: 1100px;
    width: 100%;
    justify-content: center;
    background: transparent;
}

/* ========================================================================
   WEATHER CARDS - Dark glass effect!
   ======================================================================== */
.weather-card {
    width: var(--card-width);
    /* Dark background, not white! */
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 18px;
    padding: 18px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    box-shadow: var(--shadow-strong);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.weather-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}

/* Day Name */
.w-day {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--day-color);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Date */
.w-date {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--date-color);
}

/* Weather Icon */
.w-icon {
    font-size: 2.5rem;
    line-height: 1;
    margin: 6px 0;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Temperature */
.w-temp {
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--text-main);
    text-shadow: var(--shadow-text);
    line-height: 1;
}

.w-temp sup {
    font-size: 1rem;
    font-weight: 500;
    opacity: 0.8;
}

/* Weather Condition */
.w-cond {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-soft);
    text-align: center;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* High / Low */
.w-hilo {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--gold-light);
}

/* Extra Weather Details */
.w-extra {
    width: 100%;
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.7rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.8);
}

.w-extra div {
    display: flex;
    justify-content: space-between;
    padding: 1px 0;
}

.w-extra strong {
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
}

/* ========================================================================
   CARD ANIMATIONS
   ======================================================================== */
.weather-animate {
    opacity: 0;
    transform: translateY(var(--slide-distance));
    animation: cardFadeIn var(--fade-duration) ease forwards;
}

@keyframes cardFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================================================
   MAP CONTAINER
   ======================================================================== */
#map,
.map-container {
    width: 100%;
    max-width: 900px;
    height: 350px;
    margin: 40px auto 0;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-strong);
    background: rgba(0, 0, 0, 0.3);
}

.leaflet-container {
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* ========================================================================
   LOADING OVERLAY
   ======================================================================== */
#loadingOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#loadingOverlay.active {
    opacity: 1;
    pointer-events: auto;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    color: var(--text-main);
    font-size: 1.2rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--gold-mid);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ========================================================================
   ERROR BOX
   ======================================================================== */
.error-box {
    background: rgba(220, 53, 69, 0.3);
    border: 1px solid rgba(220, 53, 69, 0.5);
    color: #ff8a8a;
    padding: 20px 30px;
    border-radius: 12px;
    text-align: center;
    font-size: 1rem;
    max-width: 500px;
    margin: 20px auto;
    backdrop-filter: blur(10px);
    grid-column: 1 / -1;
}

/* ========================================================================
   FOOTER
   ======================================================================== */
.footer {
    text-align: center;
    padding: 40px 20px;
    position: relative;
    z-index: 10;
    background: transparent;
}

.footer-text {
    color: var(--text-soft);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.footer-links a {
    color: var(--gold-mid);
    font-size: 1.3rem;
    transition: all 0.3s ease;
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--gold-light);
    transform: translateY(-3px);
}

.acknowledgement {
    margin-top: 20px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
}

/* ========================================================================
   RESPONSIVE - Horizontal scroll on smaller screens
   ======================================================================== */
@media (max-width: 1050px) {
    :root {
        --card-width: 130px;
    }

    #weatherGrid,
    .forecast-grid {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 15px;
        justify-content: flex-start;
        gap: 10px;
    }

    .weather-card {
        scroll-snap-align: start;
        flex-shrink: 0;
        min-width: 130px;
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 1.5rem;
    }

    .controls {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
    }

    .controls select {
        width: 100%;
        min-width: unset;
    }

    .btn-gold {
        width: 100%;
    }

    #forecastSection {
        padding: 40px 10px 60px;
    }

    .weather-card {
        min-width: 125px;
        padding: 14px 10px;
    }

    .w-icon {
        font-size: 2.2rem;
    }

    .w-temp {
        font-size: 2rem;
    }

    #map {
        height: 280px;
        margin-top: 30px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .forecast-title {
        font-size: 1.5rem;
    }

    .weather-card {
        min-width: 115px;
    }

    .w-extra {
        font-size: 0.65rem;
    }
}

/* ========================================================================
   SCROLLBAR STYLING
   ======================================================================== */
#weatherGrid::-webkit-scrollbar {
    height: 6px;
}

#weatherGrid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

#weatherGrid::-webkit-scrollbar-thumb {
    background: var(--gold-mid);
    border-radius: 3px;
}

/* ========================================================================
   iOS / SAFARI FIXES
   ======================================================================== */
@supports (-webkit-touch-callout: none) {
    body::before {
        background-attachment: scroll;
    }
}

/* ========================================================================
   UTILITY CLASSES
   ======================================================================== */
.hidden {
    display: none !important;
}

.form-status {
    margin-top: 15px;
    font-size: 0.95rem;
    min-height: 24px;
}

.form-status.success {
    color: #4ade80;
}

.form-status.error {
    color: #f87171;
}

.city-request-form button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* =============================================== */
/* 📬 Contact Form Styles */
/* =============================================== */
/* =============================================== */
/* 📬 Contact Form Styles */
/* =============================================== */
.contact-section {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    padding: 40px 20px;
    margin: 50px auto;
    border-radius: 15px;
    text-align: center;
    max-width: 500px;
}

.contact-section h3 {
    color: #fff;
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.contact-section p {
    color: #ccc;
    margin-bottom: 20px;
}

.city-request-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.city-request-form input,
.city-request-form textarea {
    padding: 12px 15px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
}

.city-request-form input:focus,
.city-request-form textarea:focus {
    outline: 2px solid #4a90d9;
}

.city-request-form button {
    padding: 12px;
    background: linear-gradient(135deg, #4a90d9, #63b3ed);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.city-request-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(74, 144, 217, 0.4);
}

.city-request-form button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.form-status {
    margin-top: 15px;
    font-size: 0.95rem;
    min-height: 24px;
}

.form-status.success {
    color: #4ade80;
}

.form-status.error {
    color: #f87171;
}