
/* ==============================
   WEATHER APP - COMPLETE CSS
============================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    padding: 30px 16px;
    font-family: "Segoe UI", Arial, sans-serif;
    color: #ffffff;
    background:
        radial-gradient(circle at top left, #234e83, transparent 40%),
        linear-gradient(135deg, #071426, #102b4e, #10152f);
    display: flex;
    justify-content: center;
    align-items: center;
}

.weather-app {
    width: 100%;
    max-width: 780px;
    padding: 28px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(18px);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

.weather-app h1 {
    text-align: center;
    font-size: clamp(28px, 5vw, 40px);
    margin-bottom: 25px;
    letter-spacing: 1px;
}

.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
}

.search-box input {
    flex: 1;
    min-width: 0;
    padding: 15px 17px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 14px;
    outline: none;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.09);
    font-size: 16px;
}

.search-box input::placeholder {
    color: #b7c5d9;
}

.search-box input:focus {
    border-color: #55c8ff;
    box-shadow: 0 0 0 3px rgba(85, 200, 255, 0.15);
}

.search-box button,
.unit-toggle {
    border: none;
    border-radius: 14px;
    padding: 13px 20px;
    color: #071426;
    background: linear-gradient(135deg, #72e0ff, #8c9dff);
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
}

.search-box button:hover,
.unit-toggle:hover {
    transform: translateY(-2px);
}

.search-box button:disabled {
    cursor: wait;
    opacity: 0.6;
}

.weather-card,
.forecast-card {
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.07);
}

.weather-card {
    padding: 26px 20px;
    text-align: center;
}

.weather-card h2 {
    font-size: 28px;
    margin-bottom: 12px;
}

.weather-icon {
    font-size: 68px;
    margin: 10px 0;
    animation: float 3s ease-in-out infinite;
}

.temperature {
    font-size: clamp(42px, 8vw, 64px);
    font-weight: 800;
    letter-spacing: -2px;
}

#weatherDescription {
    margin: 8px 0 22px;
    color: #c6d8f3;
    font-size: 17px;
    text-transform: capitalize;
}

.unit-toggle {
    padding: 8px 14px;
    margin: 0 0 22px;
    font-size: 13px;
}

.weather-details {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.detail {
    padding: 17px 8px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.07);
    overflow-wrap: anywhere;
}

.detail span {
    display: block;
    font-size: 25px;
    margin-bottom: 8px;
}

.detail p {
    color: #b8c9df;
    font-size: 13px;
    margin-bottom: 7px;
}

.detail strong {
    font-size: 15px;
}

#weatherMessage {
    margin-top: 20px;
    padding: 12px;
    border-radius: 12px;
    color: #d9f4ff;
    background: rgba(85, 200, 255, 0.09);
    line-height: 1.6;
}

#weatherStatus {
    margin: 12px 0;
    text-align: center;
    color: #d9e8ff;
    line-height: 1.5;
}

.forecast-section {
    margin-top: 28px;
}

.forecast-section h2 {
    font-size: 23px;
    margin-bottom: 16px;
}

.forecast-container {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.forecast-card {
    padding: 17px 8px;
    text-align: center;
    transition: transform 0.2s, background 0.2s;
}

.forecast-card:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.13);
}

.forecast-card p {
    font-size: 13px;
    color: #c2d4ee;
    margin-bottom: 13px;
}

.forecast-card span {
    display: block;
    font-size: 27px;
    margin-bottom: 12px;
}

.forecast-card strong {
    font-size: 14px;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-7px);
    }
}

@media (max-width: 600px) {
    body {
        padding: 18px 10px;
        align-items: flex-start;
    }

    .weather-app {
        padding: 19px 13px;
        border-radius: 22px;
    }

    .search-box {
        gap: 7px;
    }

    .search-box input {
        padding: 13px 10px;
        font-size: 14px;
    }

    .search-box button {
        padding: 12px;
        font-size: 14px;
    }

    .weather-details {
        gap: 7px;
    }

    .detail {
        padding: 13px 5px;
    }

    .detail p {
        font-size: 11px;
    }

    .detail strong {
        font-size: 13px;
    }

    .forecast-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .forecast-card:last-child {
        grid-column: 1 / -1;
    }
}



/* ==========================================
   PREMIUM WEATHER APP - UI UPGRADE
========================================== */

/* 1. Animated background */
body {
    background: linear-gradient(
        -45deg,
        #071426,
        #102b4e,
        #172554,
        #241447,
        #0b2940
    );
    background-size: 300% 300%;
    animation: premiumBackground 16s ease infinite;
}

/* 2. Premium glass app container */
.weather-app {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.075);
    box-shadow:
        0 25px 70px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    animation: appEntrance 0.8s ease both;
}

/* Soft decorative glow */
.weather-app::before {
    content: "";
    position: absolute;
    top: -130px;
    right: -100px;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: rgba(85, 200, 255, 0.12);
    filter: blur(65px);
    pointer-events: none;
    z-index: -1;
}

/* Keep app content above decorative glow */
.weather-app > * {
    position: relative;
}

/* 3. Gradient title */
.weather-app h1 {
    background: linear-gradient(
        90deg,
        #ffffff,
        #78ddff,
        #b8baff,
        #ffffff
    );
    background-size: 200% auto;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: titleGlow 6s linear infinite;
}

/* 4. Premium search field */
.search-box input {
    transition:
        border-color 0.3s ease,
        box-shadow 0.3s ease,
        background 0.3s ease;
}

.search-box input:focus {
    border-color: #72e0ff;
    background: rgba(255, 255, 255, 0.13);
    box-shadow:
        0 0 0 3px rgba(85, 200, 255, 0.12),
        0 0 22px rgba(85, 200, 255, 0.12);
}

.search-box button,
.unit-toggle {
    box-shadow: 0 5px 18px rgba(85, 200, 255, 0.13);
    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease,
        filter 0.25s ease;
}

.search-box button:hover,
.unit-toggle:hover {
    transform: translateY(-3px);
    box-shadow: 0 9px 25px rgba(85, 200, 255, 0.25);
    filter: brightness(1.08);
}

.search-box button:active,
.unit-toggle:active {
    transform: scale(0.97);
}

/* 5. Premium current-weather card */
.weather-card {
    position: relative;
    overflow: hidden;
    border-color: rgba(135, 200, 255, 0.2);
    background: linear-gradient(
        145deg,
        rgba(255, 255, 255, 0.105),
        rgba(255, 255, 255, 0.035)
    );
    box-shadow:
        0 12px 35px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.07);
    animation: cardEntrance 0.8s ease both;
    transition:
        border-color 0.3s ease,
        box-shadow 0.3s ease;
}

.weather-card:hover {
    border-color: rgba(114, 224, 255, 0.38);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
}

/* 6. Animated weather icon */
.weather-icon {
    display: inline-block;
    filter: drop-shadow(0 0 16px rgba(114, 224, 255, 0.2));
    transform-origin: center;
    animation: weatherFloat 3.5s ease-in-out infinite;
}

/* Temperature highlight */
.temperature {
    text-shadow: 0 0 28px rgba(114, 224, 255, 0.12);
}

/* 7. Premium weather detail cards */
.detail {
    border: 1px solid rgba(255, 255, 255, 0.055);
    background: rgba(255, 255, 255, 0.055);
    transition:
        transform 0.3s ease,
        background 0.3s ease,
        border-color 0.3s ease;
}

.detail:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.105);
    border-color: rgba(114, 224, 255, 0.2);
}

.detail span {
    filter: drop-shadow(0 0 7px rgba(114, 224, 255, 0.12));
}

/* 8. Hindi weather message */
#weatherMessage {
    border: 1px solid rgba(114, 224, 255, 0.12);
    background: linear-gradient(
        120deg,
        rgba(85, 200, 255, 0.09),
        rgba(140, 157, 255, 0.08)
    );
    animation: messageEntrance 0.5s ease both;
}

/* 9. Forecast heading */
.forecast-section h2 {
    color: #f2f7ff;
    letter-spacing: 0.3px;
}

/* 10. Animated forecast cards */
.forecast-card {
    position: relative;
    overflow: hidden;
    border-color: rgba(255, 255, 255, 0.1);
    background: linear-gradient(
        155deg,
        rgba(255, 255, 255, 0.09),
        rgba(255, 255, 255, 0.035)
    );
    transition:
        transform 0.3s ease,
        background 0.3s ease,
        border-color 0.3s ease,
        box-shadow 0.3s ease;
    animation: cardEntrance 0.6s ease both;
}

/* Stagger card entrance */
.forecast-card:nth-child(1) {
    animation-delay: 0.08s;
}

.forecast-card:nth-child(2) {
    animation-delay: 0.16s;
}

.forecast-card:nth-child(3) {
    animation-delay: 0.24s;
}

.forecast-card:nth-child(4) {
    animation-delay: 0.32s;
}

.forecast-card:nth-child(5) {
    animation-delay: 0.40s;
}

.forecast-card:hover {
    transform: translateY(-6px);
    background: rgba(85, 200, 255, 0.11);
    border-color: rgba(114, 224, 255, 0.32);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.forecast-card span {
    filter: drop-shadow(0 0 8px rgba(114, 224, 255, 0.15));
}

/* 11. Loading and status message */
#weatherStatus {
    min-height: 22px;
    font-size: 14px;
    animation: messageEntrance 0.3s ease both;
}

/* 12. Keyframes */
@keyframes premiumBackground {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes titleGlow {
    from {
        background-position: 0% center;
    }

    to {
        background-position: 200% center;
    }
}

@keyframes weatherFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-9px) rotate(3deg);
    }
}

@keyframes appEntrance {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

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

@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

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

@keyframes messageEntrance {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* 13. Mobile polish */
@media (max-width: 600px) {
    .weather-app {
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
    }

    .weather-card {
        padding: 23px 13px;
    }

    .forecast-card:hover {
        transform: translateY(-3px);
    }
}

/* 14. Respect reduced-motion settings */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}


/* =================================
   HOURLY WEATHER FORECAST
================================= */

.hourly-section {
    width: 100%;
    margin-top: 28px;
    padding: 22px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(15px);
    animation: fadeInUp 0.7s ease both;
}

.hourly-section h2 {
    color: #ffffff;
    font-size: 22px;
    margin-bottom: 6px;
}

.hourly-subtitle {
    color: #c2d5f5;
    font-size: 13px;
    margin-bottom: 20px;
}

.hourly-container {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding: 5px 2px 14px;
    scroll-behavior: smooth;
}

.hourly-container::-webkit-scrollbar {
    height: 6px;
}

.hourly-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}

.hourly-container::-webkit-scrollbar-thumb {
    background: #69a8ff;
    border-radius: 10px;
}

.hourly-card {
    flex: 0 0 100px;
    min-height: 145px;
    padding: 17px 10px;
    text-align: center;
    border-radius: 18px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: transform 0.3s ease,
                background 0.3s ease,
                box-shadow 0.3s ease;
    animation: fadeInUp 0.5s ease both;
}

.hourly-card:hover {
    transform: translateY(-7px);
    background: rgba(86, 157, 255, 0.2);
    box-shadow: 0 8px 25px rgba(61, 140, 255, 0.2);
}

.hourly-card p {
    color: #cbdcff;
    font-size: 13px;
    margin-bottom: 13px;
}

.hourly-card span {
    display: block;
    font-size: 30px;
    margin-bottom: 12px;
}

.hourly-card strong {
    display: block;
    font-size: 19px;
    color: #ffffff;
}

@media (max-width: 600px) {
    .hourly-section {
        padding: 16px;
    }

    .hourly-section h2 {
        font-size: 19px;
    }

    .hourly-card {
        flex-basis: 85px;
        min-height: 130px;
    }
}


/* =====================================
   PREMIUM AIR QUALITY CARD
===================================== */

.aqi-section {
    margin-top: 25px;

}

.aqi-section h2 {
    color: #fff;
    margin-bottom: 15px;
}

.aqi-card {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 22px;
    border-radius: 20px;
    color: #fff;
    background: linear-gradient(
        135deg,
        rgba(50, 205, 150, 0.20),
        rgba(80, 140, 255, 0.12)
    );
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.aqi-icon {
    font-size: 38px;
}

.aqi-info p {
    color: #dce8ff;
    font-size: 14px;
    margin-bottom: 5px;
}

.aqi-info h3 {
    font-size: 30px;
    margin-bottom: 5px;
}

#aqiStatus {
    color: #b8f5d5;
    font-size: 14px;
}

/* ==========================================
   DYNAMIC WEATHER BACKGROUNDS
========================================== */

/* Default background */
body {
    background: linear-gradient(135deg, #0f172a, #1e3a5f);
    background-attachment: fixed;
    transition: background 0.8s ease;
}

/* Sunny weather */
body.weather-sunny {
    background: linear-gradient(135deg, #56ccf2, #2f80ed);
    background-attachment: fixed;
}

/* Cloudy weather */
body.weather-cloudy {
    background: linear-gradient(135deg, #485563, #29323c);
    background-attachment: fixed;
}

/* Rainy weather */
body.weather-rainy {
    background: linear-gradient(135deg, #141e30, #34495e);
    background-attachment: fixed;
}

/* Snowy weather */
body.weather-snowy {
    background: linear-gradient(135deg, #83a4d4, #b6fbff);
    background-attachment: fixed;
}

/* Foggy weather */
body.weather-foggy {
    background: linear-gradient(135deg, #606c88, #3f4c6b);
    background-attachment: fixed;
}

/* Night weather */
body.weather-night {
    background: linear-gradient(135deg, #020111, #191970);
    background-attachment: fixed;
}

/* ==========================================
   PREMIUM WEATHER ICON ANIMATIONS
========================================== */

#weatherIcon {
    display: inline-block;
    transform-origin: center;
    animation: weatherFloat 3s ease-in-out infinite;
}

@keyframes weatherFloat {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-7px);
    }
}

/* Smooth weather card appearance */
.weather-card {
    animation: weatherFadeIn 0.7s ease both;

}

@keyframes weatherFadeIn {
    from {
        opacity: 0.7;
        transform: translateY(8px);
    }

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

/* Respect reduced-motion accessibility settings */
@media (prefers-reduced-motion: reduce) {
    #weatherIcon,
    .weather-card {
        animation: none;
    }
}

/* ==========================================
   RAIN & SNOW WEATHER EFFECTS
========================================== */

#weatherEffects {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
    display: none;
}

/* App content effects ke upar rahe */
.weather-app {
    position: relative;
    z-index: 1;
}

/* rain mode */
body.weather-rainy #weatherEffects,
body.weather-snowy #weatherEffects {
    display: block;
}

.weather-drop {
    position: absolute;
    top: -20px;
    left: var(--left);
    width: 2px;
    height: 18px;
    background: rgba(180, 220, 255, 0.65);
    border-radius: 50%;
    animation: rainFall var(--duration) linear infinite;
    animation-delay: var(--delay);
}

@keyframes rainFall {
    to {
        transform: translateY(100vh);
    }
}

.weather-snowflake {
    position: absolute;
    top: -20px;
    left: var(--left);
    color: white;
    font-size: var(--size);
    opacity: 0.8;
    animation: snowFall var(--duration) linear infinite;
    animation-delay: var(--delay);
}

@keyframes snowFall {
    to {
        transform: translate(var(--drift), 100vh);
    }
}

@media (prefers-reduced-motion: reduce) {
    .weather-drop,
    .weather-snowflake {
        animation: none;
        display: none;
    }
}