/* Poppins */
@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');
/* 42dot Sans */
@import url('https://fonts.googleapis.com/css2?family=42dot+Sans:wght@300..800&display=swap');
/* Montserrat */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap');
/* Rubik */
@import url('https://fonts.googleapis.com/css2?family=Rubik:ital,wght@0,300..900;1,300..900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', serif;
}

:root {
    --bg: #101224;
    --border: #41456C;
    --text: #FFFDFD;

    --mainbox: #292C51;
    --mainbox-line: #8EA9B2;
    --search: #191B32;
    --search-text-icn: #B1AAAA;
    --current-loc: #E8B926;
    --current-loc-text-icn: #292B40;

    --high: #42F032;
    --low: #FF4343;

    --footer: #0b0c18;
}

body {
    justify-items: center;
    height: fit-content;
    min-height: 100vh;
    width: 100%;
    background-color: var(--bg);
    color: var(--text);

    /* border: 1px solid yellow; */
}

.container {
    width: 100%;
    padding: 0 4%;
    max-width: 110rem;
}

/* .container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    
} */

/* ---------------- Header ----------------- */

header {
    /* position: sticky; */
    top: 0;
    width: 100%;
    /* height: ; */
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 0;
    background: var(--bg);
    z-index: 1000;
    /* border: 1px yellow solid; */
}

header h2 {
    font-size: clamp(1rem, 1.25rem, 1.5rem);
    font-weight: 400;
}

header h2 span {
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.searchBtn {
    width: 30rem;
    height: 2.5rem;
    /* border: 1px yellow solid; */
    display: grid;
    grid-template-columns: auto auto auto;
    align-items: center;
    background-color: var(--search);
    border-radius: 25px;
    padding: 0.48rem 1.2rem;
    /* gap: 0.8rem; */
    position: relative;
}

.searchBtn i {
    grid-column-start: 1;
    grid-column-end: 2;
    grid-row-start: 1;
    grid-row-end: 2;
    /* border: 1px solid yellow; */
}

.searchBtn input {
    grid-column-start: 3;
    grid-column-end: 25;
    grid-row-start: 1;
    grid-row-end: 2;
}

.searchBtn ul {
    grid-column-start: 3;
    grid-column-end: 25;
    grid-row-start: 3;
    grid-row-end: 4;
}

.searchBtn:focus+.searchIcon,
.searchBtn:focus-within {
    border: 1px solid var(--border);
    transition: 0.5s;
}

#searchInput {
    width: 100%;
    font-size: 1rem;
    background-color: var(--search);
    border: none;
    text-decoration: none;
    color: var(--search-text-icn);
    /* border: 1px solid yellow; */
}

input:focus {
    outline: none;
}

.searchIcon {
    color: var(--search-text-icn);
}

#suggestions {
    list-style: none;
    margin-top: 1rem;
    width: 100%;
    cursor: pointer;
    z-index: 1000;
    /* border: 1px solid yellow; */
}
#suggestions li {
    padding: 0.7rem 1.2rem;
    background: var(--current-loc-text-icn);
}
#suggestions li:not(:last-child) {
    border-bottom: 0.5px solid var(--mainbox-line);
}

#locationBtn {
    display: flex;
    align-items: center;
    /* justify-content: center; */
    width: 13rem;
    height: 2.5rem;
    gap: 0.8rem;
    padding: 1.2rem 1.2rem;
    background-color: var(--current-loc);
    color: var(--current-loc-text-icn);
    border-radius: 25px;
    font-size: 1rem;
    border: none;
    cursor: pointer;
}

.icon {
    font-size: 1.2rem;
    display: inline-block;
    vertical-align: middle;
}


.user {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    flex-shrink: 0;
    background: url('user.jpg');
    background-size: cover;
}

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

    50% {
        transform: translateY(2%);
    }

    100% {
        transform: translateY(0);
    }
}

/* ---------------- Weather Data ----------------- */

main {
    width: 100%;
    height: fit-content;
}

.weather-data {
    display: grid;
    grid-template-columns: auto auto auto;
    width: 100%;
    height: fit-content;
    gap: 1rem;
}

/* ----------------- WEATHER LEFT ----------------- */

.current-weather-card {
    grid-column-start: 1;
    grid-column-end: 3;
    grid-row-start: 1;
    grid-row-end: 4;
    background-color: var(--mainbox);
    min-width: 25rem;
    height: auto;
    min-height: fit-content;
    max-height: 50rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 25px;
    padding: 1.5rem;
    gap: 1.5rem;
}

.current-weather img {
    width: 250px;
}

.location {
    display: flex;
    align-items: center;
    font-size: clamp(1rem, 1.2rem, 1.4rem);
    gap: 15px;

}

/* 
.location bx {
    display: inline-block;
} */

.current-weather {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: sticky;
    width: 80%;
    padding-bottom: 1.6rem;
    border-bottom: 1px var(--mainbox-line) solid;
}

.current-weather h1 {
    font-size: clamp(3.5rem, 5.25rem, 5.75rem);
    font-weight: 400;
    display: inline-block;
    position: relative;
    font-family: 'Rubik', serif;
}

.current-weather h1 span {
    font-size: clamp(1rem, 2rem, 2.5rem);
    position: relative;
    top: -38px;
    left: 2px;
}

.current-weather img {
    /* margin-top: -30px; */
    animation: float 1.5s infinite ease-in-out;
}

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

    50% {
        transform: translateY(2%);
    }

    100% {
        transform: translateY(0%);
    }
}

.current-weather h4 {
    font-size: clamp(1rem, 1.25rem, 1.5rem);
    font-weight: 600;
    margin-top: 1.5rem;
    /* line-height: 30px; */
    text-transform: capitalize;
    background: var(--current-loc);
    padding: 5px 45px;
    border-radius: 20px;
    color: var(--bg);
    margin-bottom: 0.5rem;
    position: relative;
}

.current-weather h4::before {
    content: '';
    position: relative;
    width: 10rem;
    height: 10rem;
    background-color: var(--text);
    /* display: absolute; */
    top: 0;
    left: 0;
    z-index: 4;
}

.current-weather p {
    font-size: 18px;
    font-weight: 200;
}

.current-weather p span {
    font-size: clamp(1rem, 1.15rem, 1.3rem);
    font-weight: 200;
}

.card-footer {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.date-today {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.weather-range {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.high .up {
    color: var(--high);
}

.low .down {
    color: var(--low);
}

/* ================= HIGHLIGHTS -------------- */

.highlights {
    grid-column-start: 3;
    grid-column-end: 5;
    display: flex;
    /* flex-wrap: wrap; */
    flex-direction: column;
    justify-content: center;
    /* align-items: center; */
    width: 100%;
    height: fit-content;
    gap: 1rem;
    margin-bottom: 0.5rem;
    /* padding: 1rem 1.2rem; */
    /* border: 1px solid orange; */
}

.highlights h1 {
    text-align: left;
}

.highlight-content {
    display: flex;
    /* flex-wrap: wrap; */
    justify-content: center;
    align-items: center;
    width: 100%;
    /* border: 1px solid yellow; */
    gap: 1rem;
}

.highlight-left {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 50%;
    gap: 1rem;
    /* background: black; */
}

.highlights-left .highlight-card {
    /* width: 50%; */
}

.highlight-left-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;

}

.highlight-right {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 50%;
    gap: 1rem;
    /* border: 1px solid yellow; */

}



.highlight-left-card {
    width: 100%;
}

.highlight-card {
    padding: 1rem 1.5rem;
    border: 1px solid var(--border);
    border-radius: 15px;
    width: 100%;
    min-width: 10rem;
}

.highlight-card img {
    width: 50px;
}

.highlight-card h4 {
    font-weight: 600;
}

.highlight-card p {
    font-size: clamp(1.5rem, 2.2rem, 2.5rem);
    font-weight: 600;
}

.highlight-card p span {
    font-size: clamp(1rem, 1rem, 1.2rem);
}


.sunrise-detail h4 {
    font-size: clamp(1.2rem, 1.7rem, 2rem);
    font-weight: 600;
}

.sunrise-detail p {
    font-size: clamp(1rem, 1.4rem, 1.75rem);
    font-weight: 400;
    text-align: right;
}


.sunrise,
.sunset {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-width: 16.5rem;
    /* gap: 3rem; */
}

/* ----------- TODAY AT ------------ */

.today-at {
    grid-column-start: 3;
    grid-column-end: 5;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: clamp(50%, 100%, 70rem);
    overflow-x: hidden;
    /* align-items: center; */
}

.today-at h3 {
    text-align: left;
}

.three-hour-forecast {
    display: flex;
    flex-direction: row;
    justify-content: space-evenly;
    align-items: center;
    width: 100%;
    padding: 0.8rem 0.8rem;
    max-width: inherit;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
    /* border: 1px solid yellow; */
}

.hour-forecast-item {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.8rem;
    min-width: 7rem;
    /* border-right: 1px solid var(--border); */
    /* border: 1px solid yellow; */
    /* border: 1px solid yellow; */

}

.hour-forecast-item:last-child {
    border-right: none;
}

.hour-forecast-item img {
    width: 45px;
}

.separate-line {
    height: 125px;
    border-right: 0.15px solid var(--border);
    opacity: 0.7;
}

/* ---------------- FIVE DAY FORECAST --------------- */

.five-day-forecast {
    grid-column-start: 3;
    grid-column-end: 5;
    margin-top: 0.5rem;
    width: 100%;
}
.table-container {
    padding: 0.5rem 1rem;
}
table {
    border-collapse: collapse;
    width: 100%;
    height: fit-content;
}

td {
    text-align: left;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 0.2px solid var(--border);
}

#day-five {
    border-bottom: none;
}

.day{
    width: 100%;
    padding: 0.5rem 1rem;
}

.day-weather {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 1rem;
}

.day-weather img {
    width: 30px;
}


/* --------------- FOOTER ------------------ */

footer {
    /* background: var(--footer); */
    border-top: 0.2px solid var(--border);
    width: 100%;
    height: fit-content;
    padding: 1.5rem;
    margin-top: 5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    color: var(--mainbox-line);
    font-weight: 500;
}

footer p span a {
    /* color: var(--mainbox-line); */
}

footer a {
    text-decoration: none;
    color: var(--mainbox-line);
}

footer p {
    order: 2;
}
footer p a:hover {
    opacity: 0.6;
}

.socials {
    order: 1;
}

.socials ul {
    display: flex;
    list-style: none;
    gap: 1rem;
}

.socials ul li a {
    color: var(--mainbox-line);
    font-size: 1.5rem;
}

.socials ul li a:hover {
    opacity: 0.7;
    transition: 0.5s;
}


/* ---------- BREAKPOINTS ------------ */

@media (max-width: 1536px) {
    /* .container {
        height: 100vh;
        overflow-y: auto;
        -ms-overflow-style: none; 
        scrollbar-width: none;
    } */

}

@media (max-width: 1280px) {
    .searchBtn {
        width: 20rem;
    }

    .highlight-content {
        flex-direction: column;
        width: 100%;
    }

    .highlight-left {
        width: 100%;
    }

    .highlight-right {
        width: 100%;
    }

    .sunrise,
    .sunset {
        width: 100% !important;
        min-width: unset;
        flex-grow: 1;
    }

    .current-weather-card {
        grid-row-start: 1;
        grid-row-end: 4;
    }

    .five-day-forecast {
        grid-column-start: 1;
        grid-column-end: 5;
    }
}

@media (max-width: 1024px) {

    /* body {
        height: 100vh;
        overflow-y: scroll;
    } */
    header h2 {
        width: 100%;
        text-align: center;
    }

    .header-right {
        width: 100%;
        justify-content: center;
    }

    .searchBtn {
        width: 65%;
    }
    #locationBtn p {
        font-size: 0.95rem;
    }

    .weather-data {
        display: flex;
        flex-direction: column;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
    }

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

    .current-weather-card {
        width: 85vw;
    }

    .weather-right {
        width: 100%;
    }

    .highlights {
        width: 100%;
    }

    .highlight-content {
        width: 100%;
        /* border: 1px solid yellow; */
    }

    .highlight-left {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        order: 1;
    }

    .highlight-left-card {
        width: 48.5%;
    }

    .highlight-right {
        order: 2;
    }

    .highlight-card {
        width: auto;
    }

    .highlight-right {
        width: 100%;
        flex-direction: row;
    }
}

@media (max-width: 768px) {
    .searchBtn {
        width: 50%;
    }



}

@media (max-width: 640px) {
    .header-right {
        display: flex;
        justify-content: center;
        align-items: center;
        /* gap: rem; */
    }

    .searchBtn {
        width: 80vw;
    }

    #locationBtn {
        width: 1.5rem;
        height: 1.5rem;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    #locationBtn p {
        display: none;
    }

    .header-right .user {
        width: 2.5rem;
        height: 2.5rem;
    }

    .highlight-left-card {
        width: 47.5%;
    }

    .highlight-right {
        flex-direction: column;
    }
}

@media (max-width: 475px) {
    body {
        zoom: 0.7;
    }
}