* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    min-height: 100vh;
    background: linear-gradient(135deg, #74b9ff, #0984e3);
    transition: background 0.8s ease; 
    padding: 20px;
}

body.sunny-bg {
    background: linear-gradient(135deg, #fdcb6e, #e17055, #f39c12);
}

body.rainy-bg {
    background: linear-gradient(135deg, #636e72, #2d3436, #74b9ff);
}

body.night-bg {
    background: linear-gradient(135deg, #2c3e50, #3d5a80, #1a1a2e);
}

body.snowy-bg {
    background: linear-gradient(135deg, #dfe6e9, #b2bec3, #74b9ff);
}

.container {
    max-width: 650px;          
    margin: 0 auto;            
    padding: 20px;
}

.app-title {
    text-align: center;
    color: white;
    font-size: 2rem;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.app-subtitle {
    text-align: center;
    color: rgba(255, 255, 255, 0.85);
    font-size: 1rem;
    margin-bottom: 25px;
}

.search-box {
    display: flex;
    gap: 10px;                 
    margin-bottom: 25px;
}

.search-input {
    flex: 1;                   
    padding: 14px 18px;
    border: none;
    border-radius: 50px;       
    font-size: 1rem;
    outline: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    background: rgba(255, 255, 255, 0.95);
    color: #333;
}

.search-input::placeholder {
    color: #aaa;
}

.search-btn {
    padding: 14px 22px;
    border: none;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.25);
    color: white;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;          
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: background 0.3s;
    backdrop-filter: blur(5px);
    white-space: nowrap;
}

.search-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

.spinner {
    text-align: center;
    color: white;
    margin: 20px 0;
}

.spinner-circle {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255,255,255,0.3);
    border-top: 5px solid white;  
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-box {
    background: rgba(214, 48, 49, 0.85);
    color: white;
    padding: 15px 20px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 20px;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.weather-card {
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px);       
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 20px;
    padding: 30px;
    color: white;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    margin-bottom: 20px;
    text-align: center;
}

.city-info h2 {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.city-info p {
    font-size: 1rem;
    opacity: 0.85;
    margin-bottom: 20px;
}

.main-weather {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
}

.weather-icon {
    font-size: 5rem;
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.3));
}

.temperature-box {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.temperature {
    font-size: 3.5rem;
    font-weight: bold;
    line-height: 1;
}

.weather-desc {
    font-size: 1.2rem;
    opacity: 0.9;
    text-transform: capitalize; 
    margin-top: 5px;
}

.details-grid {
    display: flex;
    flex-wrap: wrap;            
    gap: 12px;
    justify-content: center;
}

.detail-item {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 120px;
    flex: 1;                   
    max-width: 140px;
}

.detail-icon {
    font-size: 1.5rem;
}

.detail-label {
    font-size: 0.75rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 1.1rem;
    font-weight: bold;
}

.forecast-section {
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 20px;
    padding: 25px;
    color: white;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.forecast-title {
    font-size: 1.2rem;
    margin-bottom: 15px;
    text-align: center;
    font-weight: bold;
}

.forecast-cards {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    flex-wrap: wrap;            
}

.forecast-card {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 14px 10px;
    text-align: center;
    flex: 1;
    min-width: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.forecast-day {
    font-size: 0.8rem;
    font-weight: bold;
    opacity: 0.85;
    text-transform: uppercase;
}

.forecast-icon {
    font-size: 1.8rem;
}

.forecast-temp-high {
    font-size: 1rem;
    font-weight: bold;
}

.forecast-temp-low {
    font-size: 0.8rem;
    opacity: 0.75;
}

.hidden {
    display: none !important;
}

@media (max-width: 480px) {
    .app-title {
        font-size: 1.5rem;
    }

    .search-box {
        flex-direction: column;  
    }

    .search-btn {
        border-radius: 50px;
    }

    .main-weather {
        flex-direction: column;  
    }

    .temperature {
        font-size: 2.8rem;
    }

    .weather-icon {
        font-size: 4rem;
    }

    .details-grid {
        gap: 8px;
    }

    .forecast-cards {
        gap: 6px;
    }

    .forecast-card {
        padding: 10px 6px;
        min-width: 55px;
    }
}