/* styles.css */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    color: #fff;
    background: linear-gradient(135deg, #0d47a1, #1976d2); /* Default blue for clear */
    line-height: 1.6;
    overflow-x: hidden;
    transition: background 0.5s ease;
}

/* Weather-based backgrounds */
body.clear {
    background: linear-gradient(135deg, #ffeb3b, #ffc107); /* Sunny yellow */
}

body.clouds {
    background: linear-gradient(135deg, #9e9e9e, #757575); /* Cloudy gray */
}

body.rain {
    background: linear-gradient(135deg, #2196f3, #0d47a1); /* Rainy blue */
}

body.snow {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb); /* Snowy light blue */
}

body.thunderstorm {
    background: linear-gradient(135deg, #424242, #212121); /* Stormy dark */
}

/* Header with Glassmorphism */
header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    padding: 15px 40px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.search-container {
    display: flex;
    gap: 10px;
}

#city-input {
    padding: 10px 20px;
    border: none;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 16px;
    transition: transform 0.3s ease;
}

#city-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

#city-input:focus {
    transform: scale(1.05);
    outline: none;
}

.btn {
    background: linear-gradient(45deg, #ffeb3b, #ffc107);
    color: #0d47a1;
    padding: 10px 20px;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Weather Card with Glassmorphism and Animations */
.weather-card {
    max-width: 600px;
    margin: 100px auto 40px;
    padding: 40px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    animation: fadeIn 1s ease-in-out;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

@keyframes fadeIn {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

.weather-card h2 {
    font-size: 32px;
    margin-bottom: 20px;
}

#current-info p {
    font-size: 24px;
    margin: 10px 0;
}

#weather-icon {
    width: 100px;
    height: 100px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Forecast Section */
.forecast-container {
    max-width: 1200px;
    margin: 0 auto 60px;
    padding: 0 20px;
}

.forecast-container h2 {
    text-align: center;
    font-size: 32px;
    margin-bottom: 30px;
}

#forecast-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.forecast-item {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    transition: transform 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.forecast-item:hover {
    transform: translateY(-5px);
}

.forecast-item img {
    width: 60px;
    height: 60px;
}

.forecast-item p {
    margin: 5px 0;
    font-size: 18px;
}

/* Footer */
footer {
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    text-align: center;
    padding: 20px;
    position: relative;
}

footer p {
    font-size: 16px;
    margin: 5px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    header {
        padding: 10px 20px;
    }

    .search-container {
        flex-direction: column;
        gap: 10px;
    }

    .weather-card {
        margin: 80px 20px 40px;
        padding: 20px;
    }

    .forecast-container {
        padding: 0 10px;
    }
}