/* =========================================
   WEATHER AI - MAIN STYLESHEET
========================================= */

/* ---------- CSS VARIABLES ---------- */

:root {
    --primary: #6c63ff;
    --primary-dark: #574fd6;

    --background: #f5f7fb;
    --surface: #ffffff;
    --surface-soft: #f8f9fd;

    --text-dark: #171927;
    --text: #55596b;
    --text-light: #9296a8;

    --border: #e9ebf2;

    --success: #35b77a;
    --warning: #ffad42;

    --shadow: 0 15px 45px rgba(28, 32, 56, 0.08);

    --radius-lg: 28px;
    --radius-md: 18px;
    --radius-sm: 12px;

    --container: 1180px;
}


/* ---------- RESET ---------- */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Inter", sans-serif;
    background: var(--background);
    color: var(--text-dark);
    line-height: 1.6;
}

button,
input {
    font-family: inherit;
}

button {
    cursor: pointer;
    border: none;
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    width: min(100% - 40px, var(--container));
    margin-inline: auto;
}


/* =========================================
   HEADER
========================================= */

.site-header {
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(15px);
}

.navbar {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 800;
    color: var(--text-dark);
}

.logo i {
    font-size: 27px;
    color: var(--primary);
}

.logo-ai {
    color: var(--primary);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.location-btn,
.theme-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-dark);
    transition: 0.3s ease;
}

.location-btn {
    min-height: 42px;
    padding: 0 17px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
}

.location-btn i {
    color: var(--primary);
}

.location-btn:hover,
.theme-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.theme-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 17px;
}


/* =========================================
   HERO SECTION
========================================= */

.hero-section {
    padding: 85px 0 70px;
    background:
        radial-gradient(circle at 15% 20%, rgba(108, 99, 255, 0.12), transparent 30%),
        radial-gradient(circle at 85% 10%, rgba(92, 198, 255, 0.12), transparent 30%),
        var(--background);
}

.hero-content {
    max-width: 760px;
    margin: 0 auto;
    text-align: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    border: 1px solid rgba(108, 99, 255, 0.18);
    border-radius: 50px;
    background: rgba(108, 99, 255, 0.07);
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 20px;
}

.hero-content h1 {
    font-size: clamp(42px, 6vw, 72px);
    line-height: 1.05;
    letter-spacing: -3px;
    font-weight: 800;
    margin-bottom: 22px;
}

.hero-content h1 span {
    display: block;
    color: var(--primary);
}

.hero-description {
    max-width: 600px;
    margin: 0 auto 32px;
    color: var(--text);
    font-size: 17px;
}


/* =========================================
   SEARCH
========================================= */

.search-form {
    max-width: 650px;
    margin: 0 auto;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 7px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.search-box > i {
    margin-left: 15px;
    color: var(--text-light);
    font-size: 19px;
}

.search-box input {
    flex: 1;
    min-width: 0;
    height: 48px;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-dark);
    font-size: 14px;
}

.search-box input::placeholder {
    color: var(--text-light);
}

.search-btn {
    min-height: 48px;
    padding: 0 25px;
    border-radius: 13px;
    background: var(--primary);
    color: white;
    font-weight: 700;
    transition: 0.3s ease;
}

.search-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}


/* =========================================
   WEATHER DASHBOARD
========================================= */

.weather-dashboard {
    padding: 15px 0 80px;
}


/* ---------- LOCATION ---------- */

.weather-location {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 20px;
}

.location-label {
    display: block;
    color: var(--text-light);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.weather-location h2 {
    font-size: 30px;
    line-height: 1.2;
    margin-bottom: 5px;
}

.weather-location p {
    color: var(--text-light);
    font-size: 14px;
}

.weather-status {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
}

.weather-status i {
    color: var(--primary);
    font-size: 25px;
}


/* =========================================
   CURRENT WEATHER CARD
========================================= */

.current-weather-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 35px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.temperature-area {
    display: flex;
    align-items: center;
    gap: 25px;
}

.weather-icon-large {
    width: 105px;
    height: 105px;
    display: grid;
    place-items: center;
    border-radius: 25px;
    background: linear-gradient(
        145deg,
        rgba(108, 99, 255, 0.13),
        rgba(108, 99, 255, 0.04)
    );
}

.weather-icon-large i {
    font-size: 55px;
    color: var(--primary);
}

.temperature {
    font-size: 70px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -4px;
}

.temperature sup {
    font-size: 28px;
    vertical-align: top;
    position: relative;
    top: 8px;
    letter-spacing: 0;
}

.temperature-content p {
    margin-top: 10px;
    color: var(--text-light);
    font-size: 13px;
}

.temperature-content p span {
    color: var(--text);
    font-weight: 700;
}


/* ---------- WEATHER DETAILS ---------- */

.weather-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.weather-detail {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.weather-detail > i {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: rgba(108, 99, 255, 0.09);
    color: var(--primary);
}

.weather-detail span {
    display: block;
    color: var(--text-light);
    font-size: 11px;
    margin-bottom: 2px;
}

.weather-detail strong {
    font-size: 14px;
}


/* =========================================
   AI INSIGHT
========================================= */

.ai-insight-card {
    margin-top: 22px;
    padding: 28px;
    border-radius: var(--radius-lg);
    background: linear-gradient(
        135deg,
        #25213f,
        #34305c
    );
    color: white;
    position: relative;
    overflow: hidden;
}

.ai-insight-card::after {
    content: "";
    position: absolute;
    width: 230px;
    height: 230px;
    border-radius: 50%;
    background: rgba(108, 99, 255, 0.2);
    right: -100px;
    top: -100px;
    filter: blur(5px);
}

.ai-header {
    display: flex;
    align-items: center;
    gap: 13px;
    position: relative;
    z-index: 1;
}

.ai-icon {
    width: 45px;
    height: 45px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.12);
    color: #bcb8ff;
    font-size: 21px;
}

.ai-header span {
    display: block;
    color: #bcb8ff;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.ai-header h3 {
    margin-top: 2px;
    font-size: 19px;
}

.ai-content {
    position: relative;
    z-index: 1;
    margin-top: 20px;
    padding-left: 58px;
}

.ai-content p {
    max-width: 850px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 14px;
    line-height: 1.8;
}


/* =========================================
   FORECAST SECTIONS
========================================= */

.forecast-section {
    margin-top: 55px;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 20px;
}

.section-heading span {
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.section-heading h2 {
    font-size: 24px;
    margin-top: 3px;
}

.view-more-btn {
    background: transparent;
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
}

.view-more-btn i {
    margin-left: 5px;
}


/* =========================================
   HOURLY FORECAST
========================================= */

.hourly-forecast {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}

.hour-card {
    min-height: 145px;
    padding: 18px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: 0.3s ease;
}

.hour-card span {
    color: var(--text-light);
    font-size: 11px;
    font-weight: 600;
}

.hour-card i {
    color: var(--primary);
    font-size: 29px;
}

.hour-card strong {
    font-size: 18px;
}

.hour-card:hover,
.hour-card.active {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px rgba(108, 99, 255, 0.13);
}

.hour-card.active {
    background: var(--primary);
    color: white;
}

.hour-card.active span,
.hour-card.active i {
    color: white;
}


/* =========================================
   WEEKLY FORECAST
========================================= */

.weekly-forecast {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 12px;
}

.day-card {
    min-height: 165px;
    padding: 20px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: 0.3s ease;
}

.day-card > span {
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
}

.day-card i {
    color: var(--primary);
    font-size: 28px;
}

.day-card strong {
    font-size: 19px;
}

.day-card small {
    color: var(--text-light);
    font-size: 13px;
}

.day-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}


/* =========================================
   FOOTER
========================================= */

.site-footer {
    padding: 35px 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.footer-content p,
.copyright {
    color: var(--text-light);
    font-size: 12px;
}


/* =========================================
   RESPONSIVE DESIGN
========================================= */

@media (max-width: 900px) {

    .current-weather-card {
        grid-template-columns: 1fr;
    }

    .hourly-forecast {
        grid-template-columns: repeat(3, 1fr);
    }

    .weekly-forecast {
        grid-template-columns: repeat(4, 1fr);
    }

}


@media (max-width: 650px) {

    .container {
        width: min(100% - 28px, var(--container));
    }

    .navbar {
        min-height: 68px;
    }

    .location-btn span {
        display: none;
    }

    .location-btn {
        width: 42px;
        padding: 0;
        justify-content: center;
    }


    /* HERO */

    .hero-section {
        padding: 55px 0 50px;
    }

    .hero-content h1 {
        font-size: 43px;
        letter-spacing: -2px;
    }

    .hero-description {
        font-size: 14px;
    }

    .search-box {
        padding: 6px;
    }

    .search-box input {
        width: 100%;
    }

    .search-btn {
        padding: 0 16px;
    }


    /* LOCATION */

    .weather-location {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .weather-location h2 {
        font-size: 25px;
    }


    /* CURRENT WEATHER */

    .current-weather-card {
        padding: 22px;
        gap: 25px;
    }

    .temperature-area {
        justify-content: center;
    }

    .weather-icon-large {
        width: 80px;
        height: 80px;
    }

    .weather-icon-large i {
        font-size: 42px;
    }

    .temperature {
        font-size: 55px;
    }

    .weather-details {
        grid-template-columns: 1fr 1fr;
    }


    /* AI */

    .ai-insight-card {
        padding: 22px;
    }

    .ai-content {
        padding-left: 0;
    }


    /* FORECAST */

    .hourly-forecast {
        display: flex;
        overflow-x: auto;
        padding-bottom: 8px;
        scrollbar-width: none;
    }

    .hourly-forecast::-webkit-scrollbar {
        display: none;
    }

    .hour-card {
        min-width: 105px;
        flex-shrink: 0;
    }

    .weekly-forecast {
        grid-template-columns: repeat(2, 1fr);
    }

    .section-heading h2 {
        font-size: 21px;
    }


    /* FOOTER */

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

}


@media (max-width: 400px) {

    .hero-content h1 {
        font-size: 37px;
    }

    .search-btn {
        font-size: 12px;
        padding: 0 12px;
    }

    .current-weather-card {
        padding: 17px;
    }

    .temperature-area {
        gap: 15px;
    }

    .weather-icon-large {
        width: 65px;
        height: 65px;
    }

    .weather-icon-large i {
        font-size: 34px;
    }

    .temperature {
        font-size: 48px;
    }

}

/* =========================================
   WEATHER MESSAGES
========================================= */

.weather-message {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;

    padding: 14px 20px;
    margin: 15px 0;

    border-radius: 12px;

    font-size: 14px;
}


/* Loading */

#loadingMessage {
    background: rgba(52, 76, 54, 0.08);
}


/* Loading icon animation */

#loadingMessage i {
    animation: weatherSpin 1s linear infinite;
}


@keyframes weatherSpin {

    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }

}


/* Error */

#errorMessage {
    background: rgba(220, 53, 69, 0.08);
}