/* Base Styles */
body {
    font-family: 'Inter', sans-serif;
}

/* Glass Card Effect */
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

/* Carousel Styles */
.carousel-dot.active {
    background-color: white;
}

#carouselImage {
    transition: opacity 0.3s ease-in-out;
}

/* Custom Colors */
.text-custom-blue {
    color: #4285F4;
}

.bg-custom-blue {
    background-color: #4285F4;
}

.bg-custom-blue-light {
    background-color: rgba(66, 133, 244, 0.1);
}

.shadow-custom-blue {
    box-shadow: 0 10px 25px rgba(66, 133, 244, 0.3);
}

.hover-custom-blue:hover {
    color: #4285F4;
}

/* Lazy Loading Styles */
img.lazy {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

img.lazy.loaded {
    opacity: 1;
}

/* Critical CSS for above-the-fold content */
header {
    font-family: 'Inter', sans-serif;
}

/* Loading Animation */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: bounce 1.5s ease-in-out infinite;
}

.loader-icon img,
.loader-icon svg {
    width: 80px;
    height: 80px;
    border-radius: 20px;
}

.loader-text {
    margin-top: 24px;
    color: #4285F4;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 2px;
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
    animation-delay: 0.3s;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-15px);
    }
}

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

/* Weather hero (Yahoo-style top section) */
.weather-hero {
    position: relative;
    min-height: 420px;
    color: #fff;
    overflow: hidden;
}

.weather-hero__bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: background 0.6s ease;
}

.weather-hero__bg--default,
.weather-hero__bg--clear {
    background: linear-gradient(145deg, #1e6bb8 0%, #4a9fd4 40%, #87ceeb 100%);
}

.weather-hero__bg--cloudy {
    background: linear-gradient(145deg, #3d4f6b 0%, #5c6d8a 45%, #8b9cb5 100%);
}

.weather-hero__bg--fog {
    background: linear-gradient(145deg, #5a6578 0%, #7a8494 50%, #a8b0bc 100%);
}

.weather-hero__bg--rain {
    background: linear-gradient(145deg, #2c3e5a 0%, #3d5278 50%, #5a7a9e 100%);
}

.weather-hero__bg--snow {
    background: linear-gradient(145deg, #6b7f94 0%, #9eb4c8 50%, #d4e4f0 100%);
}

.weather-hero__bg--storm {
    background: linear-gradient(145deg, #1a2236 0%, #2d3a5c 50%, #4a5568 100%);
}

.weather-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0.35) 100%);
    pointer-events: none;
}

/* Weather animation container */
.weather-animation {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 1;
}

/* Sun animation for clear weather — pulsing halo */
.weather-animation--sun {
    display: block;
}

.weather-animation--sun .sun {
    position: absolute;
    top: 10%;
    right: 15%;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, #FFFDE4 0%, #FFE066 100%);
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(255, 224, 102, 0.6);
    z-index: 2;
}

.weather-animation--sun .sun::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background-color: rgba(255, 224, 102, 0.5);
    border-radius: 50%;
    z-index: -1;
    animation: sunHaloPulse 3s infinite linear;
}

.weather-animation--sun .sun::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background-color: rgba(255, 224, 102, 0.4);
    border-radius: 50%;
    z-index: -1;
    animation: sunHaloPulse 3s infinite linear;
    animation-delay: 1.5s;
}

@keyframes sunHaloPulse {
    0% {
        width: 100%;
        height: 100%;
        opacity: 1;
    }
    100% {
        width: 250%;
        height: 250%;
        opacity: 0;
    }
}

/* Clouds animation */
.weather-animation--clouds {
    display: block;
}

.cloud {
    position: absolute;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 100px;
    opacity: 0;
    animation: cloudFloat 20s linear infinite;
}

.cloud::before,
.cloud::after {
    content: '';
    position: absolute;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 100px;
}

.cloud-1 {
    width: 100px;
    height: 40px;
    top: 15%;
    animation-delay: 0s;
}

.cloud-1::before {
    width: 50px;
    height: 50px;
    top: -25px;
    left: 10px;
}

.cloud-1::after {
    width: 60px;
    height: 40px;
    top: -15px;
    right: 10px;
}

.cloud-2 {
    width: 120px;
    height: 50px;
    top: 35%;
    animation-delay: 7s;
}

.cloud-2::before {
    width: 60px;
    height: 60px;
    top: -30px;
    left: 15px;
}

.cloud-2::after {
    width: 70px;
    height: 50px;
    top: -20px;
    right: 15px;
}

.cloud-3 {
    width: 90px;
    height: 35px;
    top: 55%;
    animation-delay: 14s;
}

.cloud-3::before {
    width: 45px;
    height: 45px;
    top: -20px;
    left: 10px;
}

.cloud-3::after {
    width: 55px;
    height: 35px;
    top: -12px;
    right: 10px;
}

@keyframes cloudFloat {
    0% {
        left: -150px;
        opacity: 0;
    }
    10% {
        opacity: 0.7;
    }
    90% {
        opacity: 0.7;
    }
    100% {
        left: calc(100% + 150px);
        opacity: 0;
    }
}

/* Rain animation */
.weather-animation--rain {
    display: block;
}

.raindrop {
    position: absolute;
    width: 2px;
    height: 20px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.1), rgba(174, 194, 224, 0.5));
    animation: rainFall linear infinite;
    opacity: 0.6;
}

@keyframes rainFall {
    0% {
        top: -20px;
        opacity: 0.6;
    }
    100% {
        top: 100%;
        opacity: 0;
    }
}

/* Snow animation */
.weather-animation--snow {
    display: block;
}

.snowflake {
    position: absolute;
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    opacity: 0.8;
    animation: snowFall linear infinite;
}

@keyframes snowFall {
    0% {
        top: -10px;
        opacity: 0.8;
    }
    100% {
        top: 100%;
        opacity: 0.3;
    }
}

/* Storm/Lightning animation */
.weather-animation--storm {
    display: block;
}

.lightning {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0);
    animation: lightningFlash 5s ease-in-out infinite;
}

@keyframes lightningFlash {
    0%, 100% {
        background: rgba(255, 255, 255, 0);
    }
    49% {
        background: rgba(255, 255, 255, 0);
    }
    50% {
        background: rgba(255, 255, 255, 0.3);
    }
    51% {
        background: rgba(255, 255, 255, 0);
    }
    52% {
        background: rgba(255, 255, 255, 0.4);
    }
    53% {
        background: rgba(255, 255, 255, 0);
    }
}

/* Fog animation */
.weather-animation--fog {
    display: block;
}

.fog-layer {
    position: absolute;
    width: 200%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.1) 25%, 
        rgba(255, 255, 255, 0.15) 50%, 
        rgba(255, 255, 255, 0.1) 75%, 
        transparent 100%);
    animation: fogMove 20s linear infinite;
}

.fog-layer:nth-child(2) {
    animation-duration: 25s;
    animation-delay: -10s;
    opacity: 0.7;
}

@keyframes fogMove {
    0% {
        transform: translateX(-50%);
    }
    100% {
        transform: translateX(0%);
    }
}

/* Forecast section background should visually continue from banner */
#live-weather {
    position: relative;
    overflow: hidden;
    z-index: 0;
    /* Remove the dark background tint under "Forecast details" */
    background: transparent;
}

#live-weather::before {
    content: '';
    position: absolute;
    inset: 0;
    background: transparent;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
}

#live-weather .max-w-7xl {
    position: relative;
    z-index: 1;
}

.weather-hero__state {
    text-align: center;
    padding: 4rem 0 3rem;
}

.hero-search__inner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.35rem 0.35rem 1rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(12px);
}

.hero-search__icon {
    color: rgba(255, 255, 255, 0.7);
    flex-shrink: 0;
}

.hero-search__input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 0.9375rem;
    padding: 0.5rem 0;
    outline: none;
}

.hero-search__input::placeholder {
    color: rgba(255, 255, 255, 0.55);
}

.hero-search__btn {
    flex-shrink: 0;
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e3a5f;
    background: #fff;
    transition: opacity 0.2s, transform 0.15s;
}

.hero-search__btn:hover:not(:disabled) {
    transform: scale(1.02);
}

.hero-search__btn:disabled {
    opacity: 0.65;
    cursor: wait;
}

.hero-temp {
    font-size: clamp(4.5rem, 14vw, 7rem);
    font-weight: 200;
    line-height: 1;
    letter-spacing: -0.04em;
}

.hero-temp__unit {
    font-size: 0.55em;
    font-weight: 300;
    vertical-align: super;
    margin-left: 0.05em;
}

.hero-daily-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.25rem 2rem;
    padding-top: 0.25rem;
}

.hero-daily-stat {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    color: rgba(255, 255, 255, 0.95);
}

.hero-daily-stat--wide {
    align-items: center;
    gap: 0.5rem;
}

.hero-daily-stat__label {
    font-size: 0.875rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.65);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Match "Feels like" line: text-lg / sm:text-xl */
.hero-daily-stat__value {
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.75rem;
}

.hero-daily-stat__unit {
    font-size: 1.125rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.75rem;
}

@media (min-width: 640px) {
    .hero-daily-stat__value,
    .hero-daily-stat__unit {
        font-size: 1.25rem;
        line-height: 1.75rem;
    }
}

.hero-play-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 1rem 1.25rem;
    margin-top: 0.75rem;
    background: #0F172A;
    border-radius: 1rem;
    transition: background-color 0.2s ease;
}

.hero-play-btn:hover {
    background: #1e293b;
}

.hero-play-btn__logo {
    display: block;
    height: 28px;
    width: auto;
    max-width: 100%;
}

.hero-conditions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.hero-condition {
    padding: 1rem 1.125rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(8px);
}

.hero-condition__label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: 0.35rem;
}

.hero-condition__value {
    font-size: 1.125rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.2;
}

.hero-condition__sub {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 0.2rem;
}

#weatherHeroMain {
    animation: fadeInUp 0.45s ease forwards;
}

.weather-hero .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;
}

/* Live weather section — matches #details dark theme */
#live-weather .weather-card {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(15, 23, 42, 0.08);
}

#live-weather .weather-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1.5rem;
}

@media (min-width: 640px) {
    #live-weather .weather-metrics {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 1.5rem;
    }

    #live-weather .weather-metric {
        flex: 1 1 0;
        min-width: 0;
    }
}

#live-weather .weather-metric {
    text-align: left;
}

#live-weather .weather-metric--end {
    text-align: right;
}

#live-weather .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;
}

#weatherResults {
    animation: fadeInUp 0.4s ease forwards;
}
