@charset "utf-8";

@import url(./reset.css);

.container {
    width: min(100% - 50px, 1080px);
    margin-inline: auto;
    height: 100%;
}

main {
    height: 100%;
}

.content {
    display: flex;
}

/* ----------------Section one style------------- */
/* ---------------------------------------------- */

.section-one {
    padding-top: 30px;
    width: 35%;
    height: 100%;
    text-align: center;
}

.search {
    position: absolute;
    font-size: 20px;
    line-height: 50px;
    left: 27%;
    right: 72%;
    color: #3f61e8;
    cursor: pointer;
}

.input-container {
    display: flex;
    justify-content: center;
}

input {
    border: 2px solid transparent;
    width: 370px;
    height: 50px;
    border-radius: 30px;
    padding: 0 15px;
    transition: all 0.3s ease-in-out;
    background-color: #f1f3fe;
}

input:focus {
    border-color: #3f61e8;
}


.feedback {
    margin-top: 5px;
    color: #eb3257;
    height: 20px;
}

.weather-img {
    display: grid;
    place-items: center;
}

.current-temp {
    font-size: 60px;
    line-height: 1;
}

.temp-info {
    font-size: 20px;
    padding-bottom: 40px
}

.line-break {
    height: 1px;
    border: 1px solid #dadadd;
    width: 60%;
    margin: auto;
}

.date {
    padding: 40px 0;
}

.date-text,
.time-text {
    font-size: 24px;
    height: 36px;
}

.day-or-night {
    font-size: 24px;
    height: 24px;
}

.city {
    font-size: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 160px;
}

/* ----------------Section two style------------- */
/* ---------------------------------------------- */

.section-two {
    padding-top: 30px;
    padding-bottom: 70px;
    width: 65%;
    background-color: #f1f3fe;
    height: 100%;
}

.options {
    display: flex;
    height: 50px;
    line-height: 50px;
    gap: 20px;
}

.today,
.tomorrow {
    cursor: pointer;
    transition: 0.25s;
}

.current-day {
    color: #748CF1;
    font-size: 24px;
    font-weight: 600;
}

.other {
    color: #68717d;
    font-size: 18px;
}

.grid-container {
    padding: 20px 0;
    margin-bottom: 10px;
    display: grid;
    grid-template-columns: repeat(3, 250px);
    grid-template-rows: repeat(3, 140px);
    gap: 30px;
}

.grid-container>div {
    background-color: #748CF1;
    border-radius: 20px;
    color: #fff;
    padding: 20px;
}

.grid-container div p {
    color: #ededef;
    font-size: 20px;
    padding-bottom: 5px;
}

.grid-container div h2,
.grid-container span {
    font-weight: 500;
    font-size: 24px;
}

.sun>div,
.moon>div {
    display: flex;
    align-items: end;
    gap: 15px;
}

.fa-down-long {
    color: #FEADA6;
}

.fa-up-long {
    color: #B3FFD2;
}

a {
    color: #3f61e8;
}

/* ----------------Loading overlay style------------- */
/* -------------------------------------------------- */

.loading-bg {
    position: fixed;
    height: 100vh;
    width: 100vw;
    background-color: #0f172a;
    display: grid;
    place-items: center;
    z-index: 1;
}

.loading {
    border: 10px solid #f3f3f3;
    border-radius: 50%;
    border-top: 10px solid #3498db;
    width: 90px;
    height: 90px;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ----------------Modal style---------------- */
/* ------------------------------------------- */

.modal {
    display: none;
    position: fixed;
    z-index: 1;
    padding-top: 20px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgb(0, 0, 0);
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
    position: relative;
    background-color: #ed6d86;
    margin: auto;
    padding: 20px;
    width: 35%;
    animation-name: animatetop;
    animation-duration: 0.6s;
    border-radius: 6px;
    color: #fff;
    font-size: 22px;
    text-align: center;
    font-weight: 500;
}

@-webkit-keyframes animatetop {
    from {
        top: -300px;
        opacity: 0
    }

    to {
        top: 0;
        opacity: 1
    }
}

@keyframes animatetop {
    from {
        top: -300px;
        opacity: 0
    }

    to {
        top: 0;
        opacity: 1
    }
}

/* ------------------Media queries--------------- */
/* ---------------------------------------------- */

@media screen and (max-width: 1310px) {
    .grid-container {
        grid-template-columns: repeat(3, 230px);
        grid-template-rows: repeat(3, 140px);
    }
}

@media screen and (max-width: 1215px) {
    .grid-container {
        grid-template-columns: repeat(2, 250px);
        grid-template-rows: repeat(4, 140px);
        gap: 10px;
    }

    .grid-container div:last-child {
        grid-column: span 2;
        margin: auto;
        width: 250px;
    }
}

@media screen and (max-width: 920px) {
    .city {
        align-items: start;
    }
}

@media screen and (max-width: 908px) {
    .modal-content {
        width: 90%;
    }
}

@media screen and (max-width: 880px) {
    .grid-container {
        grid-template-columns: repeat(2, 230px);
        grid-template-rows: repeat(4, 140px);
    }
}

@media screen and (max-width: 820px) {
    .section-one,
    .section-two {
        width: 50%;
    }

    .search {
        left: 40%;
    }

    .grid-container {
        grid-template-columns: repeat(1, 250px);
        grid-template-rows: repeat(9, 140px);
    }

    .grid-container div:last-child {
        grid-column: span 1;
    }
}

@media screen and (max-width: 586px) {
    .content {
        display: block;
    }

    .search {
        left: 80%;
    }

    .section-one,
    .section-two {
        width: 100%;
    }

    .section-one {
        margin-bottom: 40px;
    }

    .section-two > div{
        display: grid;
        place-items: center;
    }

    .grid-container {
        grid-template-columns: repeat(1, 320px);
        grid-template-rows: repeat(9, 140px);
    }

    .grid-container > div:not(.moon):not(.sun) {
        text-align: center;
    }

    .grid-container div:last-child {
        width: 320px;
    }

    .moon,
    .sun {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .moon > div,
    .sun > div {
        padding-left: 65px;
    }
}