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

body {
    background-color: #0f172a;
    color: white;
    min-height: 100vh;
    display: flex; justify-content: center; align-items: center;
    transition: background 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow-y: auto;
    padding: 20px;
}

/* ------------------------------------- */
/* Dynamic Atmospheric Backgrounds */
/* ------------------------------------- */
body.day-sunny { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
body.day-cloudy { background: linear-gradient(135deg, #cfd9df 0%, #e2ebf0 100%); color: #1e293b; }
body.day-rainy { background: linear-gradient(135deg, #96b5d8 0%, #cbdcf5 100%); color: #1e293b; }
body.night-clear { background: linear-gradient(135deg, #30cfd0 0%, #330867 100%); }
body.night-cloudy { background: linear-gradient(135deg, #2b3240 0%, #10141b 100%); }

/* ------------------------------------- */
/* Glassmorphism Weather Card */
/* ------------------------------------- */
.weather-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    padding: 25px;
    width: 100%; max-width: 450px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.5), inset 0 2px 5px rgba(255,255,255,0.1);
    text-align: center;
    transition: all 0.5s ease;
    animation: fadeInSlide 0.8s ease-out;
}

@keyframes fadeInSlide { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }

/* Light Theme overrides for daytime cards */
body.day-cloudy .weather-card, body.day-rainy .weather-card {
    background: rgba(255, 255, 255, 0.5); border-color: rgba(255,255,255,0.6);
    box-shadow: 0 30px 60px rgba(0,0,0,0.2), inset 0 2px 5px rgba(255,255,255,0.8);
}

/* ------------------------------------- */
/* Search Input Area */
/* ------------------------------------- */
.search-box {
    display: flex; gap: 10px; margin-bottom: 20px;
}
.search-box input {
    flex: 1; padding: 14px 18px; border-radius: 14px;
    border: none; outline: none; background: rgba(0,0,0,0.25);
    color: white; font-size: 1rem; font-weight: 500;
    transition: 0.3s;
}
.search-box input:focus { box-shadow: inset 0 0 0 2px rgba(255,255,255,0.4); }
.search-box input::placeholder { color: rgba(255,255,255,0.7); }

body.day-cloudy .search-box input, body.day-rainy .search-box input {
    background: rgba(255,255,255,0.7); color: #1e293b;
}
body.day-cloudy .search-box input:focus, body.day-rainy .search-box input:focus { box-shadow: inset 0 0 0 2px #475569; }
body.day-cloudy .search-box input::placeholder, body.day-rainy .search-box input::placeholder { color: #64748b; }

.search-box button {
    padding: 0 18px; border-radius: 14px; border: none; cursor: pointer;
    background: #0ea5e9; color: white; transition: 0.3s;
    box-shadow: 0 5px 15px rgba(14, 165, 233, 0.4);
}
.search-box button:hover { background: #0284c7; transform: translateY(-2px); box-shadow: 0 10px 20px rgba(14, 165, 233, 0.6); }

/* ------------------------------------- */
/* Feedback / Loading UX */
/* ------------------------------------- */
.hidden { display: none !important; }

.state-msg { font-size: 1.1rem; font-weight: 600; padding: 40px 0; opacity: 0.9;}
.spinner { 
    width: 40px; height: 40px; border: 4px solid rgba(255,255,255,0.3); 
    border-top: 4px solid white; border-radius: 50%; animation: spin 1s linear infinite; 
    margin: 0 auto 15px; 
}
body.day-cloudy .spinner, body.day-rainy .spinner { border-color: rgba(0,0,0,0.1); border-top-color: #333; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.error-text { color: #ef4444; font-weight: 700; font-size: 1.2rem; padding: 20px 0; }
body.day-cloudy .error-text, body.day-rainy .error-text { color: #dc2626; }

/* ------------------------------------- */
/* Main Weather Dashboard */
/* ------------------------------------- */
.weather-info { animation: cardPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes cardPop { from {opacity:0; transform: scale(0.95)} to {opacity:1; transform:scale(1)} }

.location-name { font-size: 1.8rem; font-weight: 800; margin-bottom: 2px; line-height: 1.2; letter-spacing: -0.5px;}
.location-region { font-size: 1rem; opacity: 0.8; margin-bottom: 15px; font-weight: 600; }

.temp-main { 
    font-size: 4rem; font-weight: 900; 
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 0px;
    letter-spacing: -2px;
}
.temp-icon { 
    width: 80px; height: 80px; 
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.4));
    margin-right: -5px;
}

.condition { font-size: 1.2rem; font-weight: 700; margin-bottom: 20px; }

/* ------------------------------------- */
/* Statistics Matrix */
/* ------------------------------------- */
.stats-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.stat-box {
    background: rgba(0,0,0,0.25); padding: 15px 10px; border-radius: 16px;
    display: flex; flex-direction: column; align-items: center;
    transition: 0.3s;
    border: 1px solid rgba(255,255,255,0.05);
}
.stat-box:hover { transform: translateY(-3px); background: rgba(0,0,0,0.35); }
body.day-cloudy .stat-box, body.day-rainy .stat-box { background: rgba(255,255,255,0.6); box-shadow: 0 5px 15px rgba(0,0,0,0.05); border-color: rgba(255,255,255,0.6); }

.stat-box .label { font-size: 0.8rem; opacity: 0.7; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px;}
body.day-cloudy .stat-box .label, body.day-rainy .stat-box .label { opacity: 0.6; color:#111; }

.stat-box .val { font-size: 1.25rem; font-weight: 800; }