/* --- GLOBAL RESET --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background: #08080a;
    color: white;
    min-height: 100vh;
    display: flex;
    justify-content: center; 
    align-items: center;    
    background-image: radial-gradient(circle at center, #1a1a2e 0%, #08080a 100%);
    overflow-x: hidden; /* Prevents accidental side-scrolling on mobile */
}

/* --- MAIN CONTAINER --- */
.main-container {
    width: 90%;
    max-width: 600px; /* Reduced from 800px for a tighter, app-like feel */
    display: flex;
    flex-direction: column;
    align-items: center; 
    text-align: center;
    padding: 20px;
}

/* --- SEARCH SECTION --- */
.search {
    width: 100%;
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 8px 8px 25px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 30px;
    transition: 0.3s;
    align-items: center;
}

.search:focus-within {
    border-color: #00d4ff;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.2);
}

.search input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 18px;
    letter-spacing: 1px;
    width: 100%;
}

.search button {
    border: none;
    padding: 12px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    background-color: #000000;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.search button:hover {
    transform: scale(1.07);
    box-shadow: 0 0 8px #00d4ff;
}

.search button img {
    height: 30px;
    width: 30px;
    filter: brightness(0) invert(1);
}

.search button:active, .search button.pressed {
    transform: scale(0.96);
}

/* --- WEATHER INFO SECTION --- */
.weather {
    display: none; /* Controlled by JS */
    width: 100%;
    animation: fadeIn 0.6s ease-out;
}

.hero-section {
    margin-bottom: 30px;
}

.weather-icon {
    width: 160px;
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.2));
}

.temp {
    font-family: 'Orbitron', sans-serif;
    font-size: 64px;
    color: #00d4ff;
    margin: 10px 0;
}

.city {
    font-size: 32px;
    font-weight: 300;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.9);
}

/* --- DETAILS GRID --- */
.details-grid {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    margin-top: 30px;
    width: 100%;
}

.col {
    display: flex;
    align-items: center;
    text-align: left;
    background: rgba(255, 255, 255, 0.03);
    padding: 15px 20px;
    border-radius: 20px;
    flex: 1;
}

.col img {
    width: 40px;
    margin-right: 15px;
    filter: brightness(0.9);
}

.humidity, .wind {
    font-size: 22px;
    font-weight: 600;
    display: block;
}

.data-box span {
    font-size: 12px;
    color: #00d4ff; 
    letter-spacing: 1px;
    font-weight: 600;
    text-transform: uppercase;
}

.footer-line {
    width: 60px;
    height: 3px;
    background: #e62429;
    margin: 40px auto 20px;
    border-radius: 2px;
}

/* --- ERROR MESSAGE --- */
.error {
    display: none;
    color: #ff4d4d;
    font-weight: 600;
    margin-bottom: 20px;
    background: rgba(255, 77, 77, 0.1);
    padding: 10px 20px;
    border-radius: 10px;
}

/* --- ANIMATIONS --- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- MOBILE RESPONSIVENESS (Screens under 600px) --- */
@media (max-width: 600px) {
    .main-container {
        width: 95%;
    }

    .search input {
        font-size: 16px; /* Prevents iOS zoom-on-focus */
    }

    .temp {
        font-size: 50px;
    }

    .city {
        font-size: 24px;
        letter-spacing: 2px;
    }

    .weather-icon {
        width: 130px;
    }

    .details-grid {
        flex-direction: column; /* Stacks the boxes vertically on small phones */
        gap: 15px;
    }

    .col {
        width: 100%;
        justify-content: center; /* Centers the content within the stacked boxes */
    }
}
