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

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --text-dark: #2d3748;
    --text-light: #ffffff;
    --bg-light: rgba(255, 255, 255, 0.95);
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 15px 50px rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    transition: background 0.5s ease;
}

body.clear-sky {
    background: linear-gradient(135deg, #56CCF2 0%, #2F80ED 100%);
}

body.clouds {
    background: linear-gradient(135deg, #757F9A 0%, #D7DDE8 100%);
}

body.rain, body.drizzle {
    background: linear-gradient(135deg, #4B79A1 0%, #283E51 100%);
}

body.thunderstorm {
    background: linear-gradient(135deg, #2C3E50 0%, #000000 100%);
}

body.snow {
    background: linear-gradient(135deg, #E6DADA 0%, #274046 100%);
}

body.mist, body.fog, body.haze {
    background: linear-gradient(135deg, #606c88 0%, #3f4c6b 100%);
}

.container {
    width: 100%;
    max-width: 900px;
}

.weather-app {
    background: var(--bg-light);
    border-radius: 30px;
    padding: 40px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.search-section h1 {
    color: var(--text-dark);
    font-size: 2.5rem;
    margin-bottom: 30px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.search-section h1 i {
    color: var(--primary-color);
}

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

#cityInput {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 15px;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

#cityInput:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

button {
    padding: 15px 25px;
    border: none;
    border-radius: 15px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-light);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

button:active {
    transform: translateY(0);
}

#locationBtn {
    padding: 15px 20px;
}

.recent-searches {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.recent-city {
    padding: 8px 15px;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.3s ease;
}

.recent-city:hover {
    background: var(--primary-color);
    color: var(--text-light);
    transform: translateY(-2px);
}

.loading, .error {
    text-align: center;
    padding: 40px;
    color: var(--text-dark);
}

.loading i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.error i {
    font-size: 3rem;
    color: #e53e3e;
    margin-bottom: 15px;
}

.hidden {
    display: none !important;
}

.weather-data {
    margin-top: 30px;
    animation: fadeIn 0.5s ease;
}

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

.current-weather {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
}

.location-info h2 {
    font-size: 2rem;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.location-info p {
    color: #718096;
    font-size: 1rem;
}

.weather-main {
    margin-top: 20px;
}

.temperature-section {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

#weatherIcon {
    width: 120px;
    height: 120px;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.2));
}

.temp-info h1 {
    font-size: 4rem;
    color: var(--text-dark);
    font-weight: 700;
}

.temp-info p {
    font-size: 1.3rem;
    color: #718096;
    text-transform: capitalize;
}

.weather-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.detail-item i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.detail-label {
    font-size: 0.85rem;
    color: #718096;
    margin-bottom: 3px;
}

.detail-value {
    font-size: 1.1rem;
    color: var(--text-dark);
    font-weight: 600;
}

.forecast-section h3 {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.forecast-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
}

.forecast-item {
    background: white;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.forecast-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.forecast-item .day {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.forecast-item img {
    width: 60px;
    height: 60px;
    margin: 10px 0;
}

.forecast-item .temp {
    font-size: 1.3rem;
    color: var(--text-dark);
    font-weight: 700;
    margin: 10px 0;
}

.forecast-item .description {
    font-size: 0.85rem;
    color: #718096;
    text-transform: capitalize;
}

@media (max-width: 768px) {
    .weather-app {
        padding: 25px;
    }

    .search-section h1 {
        font-size: 2rem;
    }

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

    button {
        width: 100%;
    }

    .temperature-section {
        flex-direction: column;
        text-align: center;
    }

    .temp-info h1 {
        font-size: 3rem;
    }

    .weather-details {
        grid-template-columns: repeat(2, 1fr);
    }

    .forecast-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .weather-details {
        grid-template-columns: 1fr;
    }
}
