:root {
    --color-primary: #fafafa;
    --color-secondary: #3a3a3ac5;
    --color-warning: #191a1a;
    --color-error: #e9e9e9;
}

* {
    padding: 0; 
    margin: 0; 
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif;
}

body {
    max-width: 1200px;
    margin: auto;
    width: 100%;
    height: 100%;
    --color: rgba(114, 114, 114, 0.3);
    background-color: #191a1a;
    background-image: linear-gradient(0deg, transparent 24%, var(--color) 25%, var(--color) 26%, transparent 27%,transparent 74%, var(--color) 75%, var(--color) 76%, transparent 77%,transparent),
        linear-gradient(90deg, transparent 24%, var(--color) 25%, var(--color) 26%, transparent 27%,transparent 74%, var(--color) 75%, var(--color) 76%, transparent 77%,transparent);
    background-size: 55px 55px;
    color: #fff;
}

#search {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 100px 10px 200px;
    border-radius: 0 0 40px 40px;
    background: #7a7a7a;
}

#location {
    width: 45px;
    margin-right: 10px;
    cursor: pointer;
    transition: all 0.1s ease-in;
}

#location:hover {
    transform: scale(1.3);
}

#search input {
    width: 300px;
    height: 35px;
    border: none;
    padding: 10px;
    color: black;
    font-size: 0.9rem;
    border-radius: 10px 0 0 10px;
}

#search input:focus {
    outline: none;
}

#search button {
    border: none;
    background-color: var(--color-warning);
    height: 35px;
    padding: 10px;
    border-radius: 0 10px 10px 0;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.1s ease-in;
    color: #fff;
}

#search button:hover {
    color: var(--color-primary);
}

#weather {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #191a1a;
    width: 500px;
    min-height: 200px;
    margin: auto;
    margin-bottom: 50px;
    position: relative;
    bottom: 80px;
    padding: 30px;
    border-radius: 30px;
    box-shadow: var(--color-secondary) 0px 25px 50px -25px;
}

#weather h1 {
    color: var(--color-primary);
    font-size: 2rem;
    margin-bottom: 20px;
}

#weather #main {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;

}

#weather #main span {
    margin: 0 30px 0 10px;
    color: gray;
}

#weather #info {
    width: 100%;
    display: flex;
    justify-content: space-evenly;
    align-items: center;
}

#weather #info span {
    color: #8a8a8ac5;
    margin-left: 5px;
}

#forecast {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
}



#forecast div {
    width: 150px;
    padding: 20px 10px 30px;
    text-align: center;
    border-radius: 20px;
    box-shadow: var(--color-secondary) 0px 25px 50px -25px;
    margin-bottom: 40px;
    background-color: #191a1a;
}

#forecast h3 {
    color: var(--color-primary);
    margin-bottom: 30px;
}

#forecast p {
    margin-bottom: 10px;
}

#forecast span {
    color: #8a8a8ac5;
}

#modal {
    background-color: rgba(128, 128, 128, 0.7);
    position:absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
}

#modal > div {
    background: rgb(41, 41, 41);
    width: 500px;
    border-radius: 20px;
    padding: 30px;
}

#modal span {
    background-color: #191a1a;
    color: #fff;
    font-weight: 900;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.1s ease-in;
    padding: 5px 10px;
    border-radius: 10px;
}

#modal p {
    margin-top: 40px;
    color: var(--color-error);
}

#loader {
    width: 100px;
    height: 100px;
    border: 7px solid var(--color-error);
    border-bottom-color:transparent ; 
    border-top-color:transparent ; 
    border-radius: 50%;
    display: inline-block;
    animation: rotation 0.8s linear infinite;
}

@keyframes rotation {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@media (max-width:500px) {
    #weather {
        width: 95%;
    }
    #forecast {
        width: 95%;
        margin: auto;
    }
}