*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    border: none;
    outline: none;
    font-family: sans-serif;
}

body{
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgb(21, 21, 21);
}


.container {
    width: 400px;
    height: min-content;
    background: linear-gradient(270deg, #89f7fe, #66a6ff, #fbc2eb);
    background-size: 600% 600%;
    border-radius: 12px;
    padding: 28px;
    animation: gradientShift 12s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.search-box{
    width: 100%;
    height: min-content;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}
.search-box input{
    width: 84%;
    font-size: 20px;
    text-transform: capitalize;
    color: black;
    background-color: rgb(173, 222, 222);
    padding: 12px 16px;
    border-radius: 15px;
}
.search-box input::placeholder{
    color: black;
}
.search-box button{
    width: 46px;
    height: 46px;
    font-size: 20px;
    color: white;
    background-color: rgb(173, 222, 222);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}
.search-box button:hover{
    background-color: rgb(74, 71, 71);
}



/* Suggestions  */
.suggestions-list {
    position: absolute;
    top: 100%;   /* appear just below input */
    left: 0;
    background: white;
    border: 1px solid #ddd;
    width: 84%;
    max-height: 200px;
    overflow-y: auto;
    overflow-x: hidden; /*prevent horizontal scroll */
    list-style: none;
    margin-top: 5px;
    padding: 0;
    z-index: 1000;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    animation: fadeIn 0.3s ease-in-out;
}

.suggestions-list li {
    padding: 10px;
    font-size: 16px;
    color: #333;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    border-bottom: 1px solid #f0f0f0;

    white-space: nowrap;      /* keep in one line */
    overflow: hidden;         /* hide overflow */
    text-overflow: ellipsis;  /* add "..." if too long */
}

.suggestions-list li:last-child {
    border-bottom: none;
}

.suggestions-list li:hover {
    background: #66a6ff;
    color: white;
}



.weather-body {
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    margin-block: 20px;
}
.weather-body img{
    width: 60%;
}

.weather-box {
    margin-block: 20px;
    text-align: center;
}
.weather-box .temperature{
    font-size: 40px;
    font-weight: 800;
    color: black;
    position: relative;
}
.weather-box .temperature sup{
    font-size: 20px;
    font-weight: 600;
    position: absolute;
}
.weather-box .description{
    font-size: 20px;
    font-weight: 700;
    color: black;
    text-transform: capitalize;
}

.weather-details{
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    width: 100%;
}
.humidity, .wind{
    display: flex;
    align-items: center;
}
.humidity{
    margin-left: 20px;
}
.wind{
    margin-right: 20px;
}
.weather-details i{
    font-size: 30px;
    color: black;
    margin-right: 10px;
}
.weather-details .text{
    font-size: 15px;
    font-weight: 500;
    color: black;
}
.text span{
    font-size: 20px;
    font-weight: 700;
    color: black;
    margin-left: 5px;
}

.location-not-found{
    margin-top: 20px;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
.location-not-found img{
    width: 80%;
}
.location-not-found h1{
    font-size: 20px;
    color: darkorchid;
    margin-block-end: 15px;
}



/* Small devices */
@media (max-width: 480px) {
    .container {
        width: 90%;
        padding: 20px;
    }

    .search-box {
        flex-direction: column;
        gap: 10px;
    }

    .search-box input {
        width: 100%;
        font-size: 16px;
        text-align: center;
    }

    .search-box button {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .weather-box .temperature {
        font-size: 32px;
    }

    .weather-box .description {
        font-size: 16px;
    }

    .weather-details {
        flex-direction: column;
        gap: 15px;
    }

    .humidity, .wind {
        justify-content: center;
        margin: 0;
        width: 100%;
    }
}

/* Medium devices */
@media (max-width: 768px) {
    .container {
        width: 80%;
    }

    .search-box input {
        font-size: 18px;
    }

    .weather-box .temperature {
        font-size: 36px;
    }

    .weather-box .description {
        font-size: 18px;
    }

    .weather-details {
        gap: 20px;
    }
}

/* Large screens */
@media (min-width: 1024px) {
    .container {
        width: 450px;
    }
}

.footer {
    position: fixed;
    bottom: 20px;
    text-align: center;
    width: 100%;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
}

.footer p {
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.footer p:hover {
    opacity: 1;
}
