* {
    margin: 0;
    padding: 0;
    font-family: 'Poppins', Arial, sans-serif; 
    box-sizing: border-box;
}

body {
    background: #222;
    overflow-x: hidden; 
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    min-height: 100vh;
}

.card {
    width: 90%;
    max-width: 450px;
    background: linear-gradient(135deg, #00feba, #5b548a);
    color: #fff;
    margin: 10vh auto 0;
    border-radius: 20px;
    padding: 20px;
    text-align: center;
}

.search {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap; 
}

.search input {
    border: 0;
    outline: 0;
    background: #ebfffc;
    color: #555;
    padding: 10px 25px;
    height: 60px;
    border-radius: 30px;
    flex: 1;
    margin-right: 16px;
    font-size: 18px;
    min-width: 0; 
}

.search input:focus {
    outline: 2px solid #00feba; 
    outline-offset: 2px;
}

.search button {
    border: 0;
    outline: 0;
    background: #ebfffc;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    cursor: pointer;
    overflow: hidden; 
    min-width: 0; 
}

.search button:focus {
    outline: 2px solid #00feba; 
    outline-offset: 2px;
}

.search button img {
    width: 20px;
    height: 20px;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    margin: auto;
}

.weather-icon {
    width: 170px;
    margin-top: 30px;
}

.weather h1 {
    font-size: 3.5rem;
    font-weight: 500;
    text-align: center;
}

.weather h2 {
    font-size: 2.5rem;
    font-weight: 400;
    margin-top: 10px;
    text-align: center;
}

/* ✅ Horizontal layout fix for bottom icons */
.details {
    display: flex;
    flex-direction: row; /* Force horizontal layout */
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;     /* Allow wrapping if needed */
    padding: 0 20px;
    margin-top: 50px;
    gap: 20px;
}

/* ✅ Ensure icons and text align properly */
.col {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 10px;
    flex: 1;
    min-width: 140px;
}

.col img {
    width: 40px;
    margin-right: 10px;
}

.humidity, .wind {
    font-size: 28px;
    margin-bottom: 5px; 
}

.col p:last-child {
    margin-top: 5px; 
}

.weather {
    display: none;
}                                        

.error {
    display: none;
}

.error p {
    font-size: 18px; 
    margin: 10px 0;
}

.loading {
    display: none; 
    font-size: 18px;
    color: #fff;
    margin: 10px 0;
}

/* Tablet responsiveness */
@media (max-width: 768px) {
    .card {
        margin: 50px auto 0;
        padding: 15px;
    }

    .weather-icon {
        width: 140px;
    }

    .weather h1 {
        font-size: 2.5rem;
    }

    .weather h2 {
        font-size: 2rem;
    }

    .humidity, .wind {
        font-size: 22px;
    }
}

/* Big screen phones (360px–600px) */
@media (max-width: 600px) {
    .card {
        margin: 60px auto 0;
        padding: 15px;
    }

    .weather-icon {
        width: 150px;
    }

    .weather h1 {
        font-size: 3rem;
    }

    .weather h2 {
        font-size: 2.2rem;
    }

    .humidity, .wind {
        font-size: 24px;
    }
}

/* Ultra-small phones */
@media (max-width: 360px) {
    .search {
        flex-direction: column;
        gap: 10px;
    }

    .search input {
        width: 100%;
        margin-right: 0;
    }

    .search button {
        width: 100%;
        height: 50px;
    }
}

/* Mobile responsiveness */
@media (max-width: 300px){
    .card {
        padding: 15px;
    }

    .weather h1 {
        font-size: 2.8rem;
    }

    .weather h2 {
        font-size: 2rem;
    }

    .weather-icon {
        width: 120px;
    }

    .humidity, .wind {
        font-size: 20px;
    }
}
