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

body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    background-color: #000;
    color: #fff;
    font-family: Arial, sans-serif;
    padding: 1rem;
    overflow-x: hidden;
}

.outerbox {
    width: min(1400px, 100%);
    margin: 0 auto;
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.95fr);
    grid-template-areas:
        "header header"
        "main side"
        "forecast side"
        "highlights highlights"
        "cities cities";
}

.card0,
.card1,
.card2,
.card3,
.card4 {
    background-color: #082C1D;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 1rem;
    overflow: hidden;
}

.card0 {
    grid-area: header;
    background-color: #000;
    border: none;
    min-height: 45px;
}

.card1 {
    grid-area: main;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1rem;
    padding: 1rem;
}

.card2 {
    grid-area: forecast;
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 1rem;
    padding: 1rem;
}

.card3 {
    grid-area: highlights;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.card4 {
    grid-area: cities;
    padding: 1rem;
}

.search {
    width: min(360px, 100%);
    height: 100%;
    display: flex;
    align-items: center;
    border: none;
    background-color: #082C1D;
    border-radius: 999px;
    padding: 0 1rem;
}

.card0 input {
    flex: 1;
    min-width: 0;
    height: 100%;
    color: white;
    background: transparent;
    border: none;
    outline: none;
    font-size: 1rem;
    text-indent: 0.5rem;
}

.card0 input::placeholder {
    color: rgba(255, 255, 255, 0.8);
}

.card0 i {
    padding-right: 0.75rem;
    flex-shrink: 0;
}

.location {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.location-box {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.text,
.convert {
    border-radius: 999px;
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #fff;
    color: #081a13;
}

.text p {
    color: #1e3050;
    font-weight: 600;
    padding-left: 0.4rem;
}

.convert {
    background: transparent;
    padding: 0;
    gap: 0.35rem;
}

.convert button {
    border: none;
    border-radius: 999px;
    padding: 0.55rem 0.95rem;
    cursor: pointer;
    font-weight: 600;
}

#c {
    background-color: yellowgreen;
    color: #052816;
    position:relative;
    
}

#f {
    background-color: #8ceae4;
    color: #052816;
}

#f.toggle-btn,
#c.toggle-btn {
    box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

.temperature {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.4rem;
    padding: 1rem 0.5rem;
}

#now {
    color: white;
    font-size: clamp(1.8rem, 3vw, 3rem);
    font-family: "Lucida Handwriting", cursive;
}

#weather {
    font-family: "Lucida Handwriting", cursive;
    color: white;
    font-size: clamp(1rem, 2vw, 1.25rem);
}

.curr-temp {
    color: white;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 600;
}

.weather-image {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 220px;
}

#curr-image {
    width: min(100%, 320px);
    aspect-ratio: 1 / 1;
    background-image: url("images/sunny.png");
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
}

.card21 {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.card211 {
    padding: 0.3rem 0 0 0.25rem;
}

.card211 p {
    color: white;
    font-size: clamp(1.2rem, 2vw, 1.7rem);
}

.card212 {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.7rem;
}

.card2121,
.card2122,
.card2123,
.card2124,
.card2125 {
    min-height: 140px;
    background-color: #052816;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 1rem;
    padding: 0.8rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.45rem;
    text-align: center;
}

.card2121 img,
.card2122 img,
.card2123 img,
.card2124 img,
.card2125 img {
    width: clamp(22px, 3vw, 34px);
    height: auto;
}

.card2121 p,
.card2122 p,
.card2123 p,
.card2124 p,
.card2125 p {
    font-size: clamp(0.95rem, 1.3vw, 1.1rem);
}

.card213 {
    display: flex;
    justify-content: center;
    align-items: stretch;
}

.card2131 {
    width: 100%;
    background-color: #082C1D;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 1rem;
    color: white;
    flex-wrap: wrap;
}

#tomorrow,
#tomorrow-temp {
    font-size: clamp(1rem, 1.5vw, 1.2rem);
}

#next-image {
    height: 62px;
    width: 62px;
    background-image: url("images/sunny.png");
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
}

.card22 {
    display: flex;
    justify-content: center;
    align-items: center;
}

.card221 {
    width: 100%;
    min-height: 100%;
    background-color: #00180D;
    border-radius: 1rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.75rem;
}

.sunrise,
.sunset,
.daylength {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border-radius: 0.8rem;
    background-color: rgba(255, 255, 255, 0.04);
}

.sunrise p,
.sunset p,
.daylength p {
    font-size: clamp(1rem, 1.3vw, 1.2rem);
    color: white;
}

#time1,
#time2,
#time3 {
    font-size: clamp(1rem, 1.4vw, 1.15rem);
    color: #dffcf0;
    margin-top: 0.35rem;
}

.card31 {
    grid-column: 1 / -1;
    padding: 0.2rem 0 0.5rem;
}

.card31 p {
    font-size: clamp(1.3rem, 2vw, 2rem);
    color: white;
}

.card32,
.card33,
.card34,
.card35 {
    min-height: 220px;
    background: #0f1f17;
    border-radius: 1rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

.card32 p,
.card33 p,
.card34 p,
.card35 p {
    font-size: clamp(1rem, 1.3vw, 1.2rem);
    color: white;
    margin-bottom: 0.75rem;
}

.graph {
    display: flex;
    align-items: flex-end;
    justify-content: space-evenly;
    gap: 0.4rem;
    flex: 1;
}

.bar {
    width: 100%;
    max-width: 20px;
    min-height: 10px;
    background: limegreen;
    border-top-left-radius: 0.4rem;
    border-top-right-radius: 0.4rem;
}

.rain-time {
    width: 100%;
    font-size: 0.75rem;
    color: aliceblue;
    display: flex;
    justify-content: space-evenly;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.rain-time .tooltip {
    flex: 1;
    text-align: center;
    word-break: break-word;
}

.card33 {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.uv {
    width: 100%;
    max-width: 220px;
    height: 140px;
    display: block;
    margin: 0 auto;
}

#uv-index {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -10%);
    color: white;
    font-size: clamp(1.05rem, 1.6vw, 1.4rem);
    text-align: center;
    line-height: 1.3;
    pointer-events: none;
}

#humidity-image {
    flex: 1;
    width: 100%;
    background-image: url("images/humidity.png");
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
}

#humidity {
    color: white;
    font-size: clamp(1rem, 1.3vw, 1.1rem);
    margin-top: 0.5rem;
}

.wind-bars {
    flex: 1;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 0.45rem;
}

.wind {
    width: clamp(6px, 1.8vw, 10px);
    min-height: 20px;
    border-radius: 999px;
    background: #67ff00;
    animation: flow 5s linear infinite;
}

#windSpeed {
    font-size: clamp(1rem, 1.2vw, 1.1rem);
    margin-top: 0.75rem;
}

#card41 {
    font-size: clamp(1.25rem, 2vw, 1.8rem);
    color: white;
    padding-bottom: 0.75rem;
}

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

.card42,
.card43 {
    background-color: #0F1F17;
    border-radius: 0.8rem;
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.card42 p,
.card43 p {
    color: white;
    text-align: center;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
}

#other1,
#other2 {
    font-size: clamp(1.4rem, 2vw, 2.2rem);
    padding: 0;
}

@keyframes flow {
    0% {
        transform: translate(-8px, -4px);
        opacity: 0.7;
    }
    50% {
        transform: translate(0, 0);
        opacity: 1;
    }
    75% {
        transform: translate(6px, -2px);
        opacity: 0.8;
    }
    100% {
        transform: translate(8px, 0px);
        opacity: 0.8;
    }
}

@media (min-width: 1101px) {
    .card1,
    .card2 {
        grid-column: 1 / -1;
    }
}

@media (max-width: 1100px) {
    .outerbox {
        grid-template-columns: 1fr;
        grid-template-areas:
            "header"
            "main"
            "forecast"
            "highlights"
            "cities";
    }

    .card1,
    .card2 {
        grid-column: auto;
    }

    .card2 {
        grid-template-columns: 1fr;
    }

    .card22 {
        min-height: 220px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 0.75rem;
    }

    .card1 {
        grid-template-columns: 1fr;
    }

    .card3 {
        grid-template-columns: 1fr;
    }

    .card411 {
        grid-template-columns: 1fr;
    }

    .location-box {
        flex-direction: column;
        align-items: flex-start;
    }

    .convert {
        width: 100%;
        justify-content: flex-start;
    }

    .search {
        width: 100%;
        border-radius: 999px;
    }

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

    .card2131 {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .card212 {
        grid-template-columns: 1fr;
    }

    .card0 {
        min-height: 60px;
    }

    .card0 input {
        font-size: 0.95rem;
    }

    .weather-image {
        min-height: 180px;
    }

    .card32,
    .card33,
    .card34,
    .card35 {
        min-height: 200px;
    }
}
