* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

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%);
}

.main-container {
    width: 90%;
    max-width: 800px; 
    display: flex;
    flex-direction: column;
    align-items: center; 
    text-align: center;
    overflow: hidden;
    /* Remove justify-content: center if it was here */
    padding-top: 10vh; /* This keeps the search bar at a fixed height from the top */
}


.search {
    width: 100%;
    max-width: 500px;
    display: flex;
    align-items: center; /* Vertical center the items */
    background: rgba(255, 255, 255, 0.05);
    padding: 5px 5px 5px 20px; /* Reduced padding for mobile */
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 30px;
    transition: all 0.3s ease;
    box-sizing: border-box; /* Ensures padding doesn't increase width */
}

.search:focus-within {
    border-color: #00d4ff;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.2);
}

.search input {
    flex: 1;
    width: 100%; /* Ensure it fills the space */
    min-width: 0; /* Prevents input from pushing button out */
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 16px; /* Slightly smaller for better mobile fit */
}

.search button {
   box-sizing: border-box;
    border: none;
    padding: 15px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    background-color: #000000;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    box-sizing: border-box;

    flex-shrink: 0; /* CRITICAL: Prevents the button from being squashed or pushed out */
    width: 50px;
    height: 50px;
    border-radius: 50%;
    /* rest of your button code... */
}


.search button:hover {
    transform: scale(1.07);
 
  box-shadow: 0 0 2px 2px #00d4ff;
}


.search button img{
    position: relative;
    height: 37px;
    width: 37px;
    object-fit: cover;
    filter: brightness(0) invert(1);
}



.search button:active{
    transform: scale(0.96);
}


.weather {
    display: none;
    opacity: 0;
    
    width: 100%;
    overflow: hidden; /* Prevents any children from causing a horizontal scroll */
    /* keep your existing transition and transform code */

    max-height: 0; /* New: starts with no height */
    overflow: hidden; /* New: hides content while height is 0 */
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out, max-height 0.8s ease-out;
}

.weather.show {
    display: block;
    opacity: 1;
    max-height: 1000px; /* New: allows it to grow to its full height */
    transform: translateY(0);
}

.error {
    display: none;
    color: #ff4d4d;
    font-weight: 600;
    margin-bottom: 20px;
    /* Optional: add a quick fade for error too */
    animation: fadeIn 0.3s ease-in;
}

.hero-section {
    margin-bottom: 40px;
}

.weather-icon {
    width: 180px;
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.2));
}

.temp {
    font-family: 'Orbitron', sans-serif;
    font-size: 55px;
    color: #00d4ff;
    margin: 10px 0;
}

.city {
    font-size: 40px;
    font-weight: 300;
    letter-spacing: 5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.8);
}

/* DETAILS BOXES */
.details-grid {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin-top: 20px;
}

.col {
    display: flex;
    align-items: center;
    text-align: left;
}

.col img {
    width: 45px;
    margin-right: 15px;
    filter: brightness(0.8);
}

.humidity, .wind {
    font-size: 28px;
    font-weight: 600;
}

.data-box span {
    font-size: 17px;
    color: #00d4ff; 
    letter-spacing: 2px;
    font-weight: 600;
}

.footer-line {
    width: 100px;
    height: 3px;
    background: #e62429;
    margin: 40px auto 0;
}

.error {
    display: none;
    color: #ff4d4d;
    font-weight: 600;
    margin-bottom: 20px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* MOBILE FIX */
@media (max-width: 600px) {
    .details-grid { flex-direction: column; gap: 30px; align-items: center; }
    .temp { font-size: 60px; }
    .city { font-size: 30px; }
}


.search button.pressed {
    transform: scale(0.96);
    box-shadow: 0 0 2px 2px #00d4ff;
}


.search button:focus {
    outline: none;
}

/* The state when the search is active/focused */
.search.active-style {
    border: 1px solid #fff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.search input:focus {
    outline: none; /* Prevents the browser's default blue ring from interfering */
}
