@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');


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


:root {

    --bg: #eef2ff;

    --card: rgba(255, 255, 255, 0.82);

    --white: #ffffff;

    --text: #171a2b;

    --muted: #858ba3;

    --border: rgba(255, 255, 255, 0.8);

    --primary: #635bff;

    --primary-dark: #5047df;

    --blue: #4f8cff;

    --cyan: #38bdf8;

    --shadow:
        0 25px 70px rgba(40, 45, 90, 0.12);

    --radius: 24px;
}


body {

    min-height: 100vh;

    font-family: "Inter", sans-serif;

    color: var(--text);

    background:
        radial-gradient(
            circle at 10% 10%,
            rgba(99, 91, 255, 0.22),
            transparent 30%
        ),
        radial-gradient(
            circle at 90% 20%,
            rgba(56, 189, 248, 0.20),
            transparent 30%
        ),
        linear-gradient(
            135deg,
            #eef2ff,
            #f8f9ff
        );

    padding: 50px 20px;
}


button,
input {
    font-family: inherit;
}


button {
    border: none;
    cursor: pointer;
}


/* =========================
   APP
========================= */

.app {

    width: 100%;

    max-width: 900px;

    margin: auto;
}


/* =========================
   HEADER
========================= */

.header {

    display: flex;

    justify-content: space-between;

    align-items: center;

    margin-bottom: 35px;
}


.eyebrow {

    color: var(--primary);

    font-size: 11px;

    font-weight: 800;

    letter-spacing: 2px;

    margin-bottom: 8px;
}


.header h1 {

    font-size: 44px;

    line-height: 1.1;

    letter-spacing: -2px;

    font-weight: 800;
}


.subtitle {

    color: var(--muted);

    font-size: 14px;

    margin-top: 10px;
}


.header-icon {

    width: 70px;

    height: 70px;

    display: flex;

    justify-content: center;

    align-items: center;

    border-radius: 22px;

    background: rgba(255,255,255,.7);

    border: 1px solid var(--border);

    box-shadow: var(--shadow);

    color: var(--primary);

    font-size: 30px;
}


/* =========================
   SEARCH
========================= */

.search-section {

    margin-bottom: 22px;
}


.search-box {

    display: flex;

    align-items: center;

    gap: 12px;

    padding: 7px;

    background: var(--card);

    backdrop-filter: blur(15px);

    border: 1px solid var(--border);

    border-radius: 18px;

    box-shadow: var(--shadow);
}


.location-icon {

    margin-left: 14px;

    color: var(--muted);
}


#city-input {

    flex: 1;

    min-width: 0;

    border: none;

    outline: none;

    background: transparent;

    color: var(--text);

    padding: 15px 5px;

    font-size: 14px;
}


#city-input::placeholder {

    color: #a4a9b8;
}


#search-btn {

    display: flex;

    align-items: center;

    gap: 8px;

    padding: 14px 20px;

    border-radius: 13px;

    background: var(--primary);

    color: white;

    font-size: 13px;

    font-weight: 600;

    transition: .2s;
}


#search-btn:hover {

    background: var(--primary-dark);

    transform: translateY(-2px);
}


.error-message {

    display: none;

    color: #ef4444;

    font-size: 12px;

    margin: 10px 5px;
}


#loading {
    display: none;
    text-align: center;
    color: var(--primary);
    font-size: 13px;
    margin-top: 12px;
}

#search-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}


/* =========================
   WEATHER CARD
========================= */

.weather-card {

    position: relative;

    overflow: hidden;

    padding: 30px;

    border-radius: var(--radius);

    background:
        linear-gradient(
            135deg,
            #6d66ff,
            #4d8df7
        );

    color: white;

    box-shadow:
        0 30px 70px rgba(82, 91, 220, 0.28);

    margin-bottom: 25px;
}


.weather-card::before {

    content: "";

    position: absolute;

    width: 250px;

    height: 250px;

    border-radius: 50%;

    background: rgba(255,255,255,.08);

    top: -120px;

    right: -70px;
}


.weather-card::after {

    content: "";

    position: absolute;

    width: 180px;

    height: 180px;

    border-radius: 50%;

    background: rgba(255,255,255,.06);

    bottom: -100px;

    left: -60px;
}


.weather-top {

    position: relative;

    z-index: 1;

    display: flex;

    justify-content: space-between;

    align-items: flex-start;
}


.location-label {

    font-size: 10px;

    letter-spacing: 2px;

    opacity: .7;

    font-weight: 700;

    margin-bottom: 8px;
}


#city-name {

    font-size: 30px;

    font-weight: 700;

    letter-spacing: -1px;
}


#weather-description {

    margin-top: 5px;

    opacity: .8;

    font-size: 13px;
}


.weather-icon {

    width: 65px;

    height: 65px;

    display: flex;

    justify-content: center;

    align-items: center;

    border-radius: 20px;

    background: rgba(255,255,255,.13);

    backdrop-filter: blur(10px);

    font-size: 30px;
}


.temperature {

    position: relative;

    z-index: 1;

    display: flex;

    align-items: flex-start;

    margin: 35px 0;

}


#temperature {

    font-size: 82px;

    line-height: .9;

    font-weight: 700;

    letter-spacing: -5px;
}


.degree {

    font-size: 24px;

    margin-top: 5px;

    opacity: .8;
}


/* =========================
   WEATHER INFO
========================= */

.weather-info {

    position: relative;

    z-index: 1;

    display: grid;

    grid-template-columns: repeat(3, 1fr);

    gap: 12px;
}


.info-item {

    display: flex;

    align-items: center;

    gap: 12px;

    padding: 14px;

    border-radius: 16px;

    background: rgba(255,255,255,.12);

    backdrop-filter: blur(10px);
}


.info-icon {

    width: 38px;

    height: 38px;

    display: flex;

    align-items: center;

    justify-content: center;

    border-radius: 12px;

    background: rgba(255,255,255,.12);

}


.info-item span {

    display: block;

    font-size: 10px;

    opacity: .7;

    margin-bottom: 4px;
}


.info-item strong {

    font-size: 13px;
}


/* =========================
   FORECAST
========================= */

.forecast-section {

    padding: 25px;

    background: var(--card);

    backdrop-filter: blur(15px);

    border: 1px solid var(--border);

    border-radius: var(--radius);

    box-shadow: var(--shadow);
}


.section-title {

    display: flex;

    align-items: center;

    justify-content: space-between;

    margin-bottom: 20px;
}


.section-title h3 {

    font-size: 20px;

    letter-spacing: -.5px;
}


#unit-btn {

    padding: 8px 12px;

    border-radius: 9px;

    background: #f0efff;

    color: var(--primary);

    font-size: 11px;

    font-weight: 600;
}


/* =========================
   FORECAST CARDS
========================= */

.forecast {

    display: grid;

    grid-template-columns:
        repeat(5, 1fr);

    gap: 10px;
}


.forecast-card {

    display: flex;

    flex-direction: column;

    align-items: center;

    gap: 9px;

    padding: 16px 8px;

    border-radius: 15px;

    background: rgba(245,247,255,.8);

    border: 1px solid #eef0f7;

    transition: .2s;
}


.forecast-card:hover {

    transform: translateY(-4px);

    background: white;

    box-shadow:
        0 12px 30px rgba(40,45,90,.08);
}


.forecast-card span {

    color: var(--muted);

    font-size: 11px;

    font-weight: 600;
}


.forecast-card i {

    color: var(--primary);

    font-size: 20px;

    margin: 5px 0;
}


.forecast-card strong {

    font-size: 20px;
}


.forecast-card small {

    color: var(--muted);

    font-size: 10px;
}


/* =========================
   FOOTER
========================= */

.footer {

    display: flex;

    justify-content: space-between;

    margin-top: 20px;

    color: var(--muted);

    font-size: 10px;
}


/* =========================
   RESPONSIVE
========================= */

@media (max-width: 700px) {

    body {
        padding: 30px 15px;
    }


    .header h1 {
        font-size: 34px;
    }


    .header-icon {
        width: 55px;
        height: 55px;
        font-size: 23px;
    }


    .weather-info {
        grid-template-columns: 1fr;
    }


    .forecast {
        grid-template-columns:
            repeat(3, 1fr);
    }

}


@media (max-width: 500px) {

    .header {
        align-items: flex-start;
    }


    .header-icon {
        display: none;
    }


    .search-box {
        padding: 6px;
    }


    #search-btn {
        font-size: 0;

        width: 45px;
        height: 45px;

        padding: 0;

        justify-content: center;
    }


    #search-btn i {
        font-size: 14px;
    }


    .weather-card {
        padding: 22px;
    }


    #temperature {
        font-size: 65px;
    }


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


    .footer {
        flex-direction: column;
        gap: 7px;
    }

}