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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Search Container */
.search-container {
    display: flex;
    gap: 10px;
    max-width: 600px;
    margin: 0 auto 30px;
    background: white;
    padding: 10px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#cityInput {
    flex: 1;
    border: none;
    padding: 15px 20px;
    font-size: 1rem;
    outline: none;
    border-radius: 50px;
}

#searchBtn {
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

#searchBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

#searchBtn:active {
    transform: translateY(0);
}

#locationBtn {
    padding: 15px 20px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

#locationBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

/* Error Message */
.error-message {
    max-width: 600px;
    margin: 0 auto 20px;
    padding: 15px;
    background: #ff5252;
    color: white;
    border-radius: 10px;
    text-align: center;
    display: none;
}

.error-message.show {
    display: block;
    animation: slideDown 0.3s ease;
}

/* Welcome Message */
.welcome-message {
    max-width: 600px;
    margin: 0 auto;
    padding: 60px 30px;
    background: white;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.5s ease;
}

.welcome-message.hidden {
    display: none;
}

.welcome-content h2 {
    font-size: 2rem;
    color: #333;
    margin-bottom: 15px;
}

.welcome-content p {
    font-size: 1.1rem;
    color: #666;
    line-height: 1.6;
}

/* Weather Container */
.weather-container {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.weather-container.hidden {
    display: none;
}

/* Current Weather */
.current-weather {
    background: white;
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.5s ease;
}

.location-info h2 {
    font-size: 2rem;
    color: #333;
    margin-bottom: 5px;
}

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

.weather-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0 10px 0;
    padding: 20px 0;
    border-bottom: 2px solid #f0f0f0;
}

.temperature {
    font-size: 4rem;
    font-weight: bold;
    color: #667eea;
}

.unit {
    font-size: 2rem;
    color: #999;
}

.weather-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0px;
}

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

.weather-description {
    text-align: center;
}

.weather-description p {
    font-size: 1.2rem;
    color: #555;
    font-weight: 500;
    margin: 0;
}

/* Forecast Section */
.forecast-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.5s ease 0.2s both;
}

.forecast-section h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #333;
}

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

.forecast-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.forecast-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.forecast-card .day {
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 1rem;
}

.forecast-card .icon {
    font-size: 2.5rem;
    margin: 10px 0;
}

.forecast-card .forecast-desc {
    font-size: 0.75rem;
    opacity: 0.95;
    margin: 5px 0;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.forecast-card .temp {
    font-size: 1.3rem;
    font-weight: bold;
    margin: 10px 0;
}

.forecast-card .temp-range {
    font-size: 0.85rem;
    opacity: 0.9;
}

/* Loading Spinner */
.loading-spinner {
    text-align: center;
    padding: 50px;
}

.loading-spinner.hidden {
    display: none;
}

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

.loading-spinner p {
    color: white;
    font-size: 1.1rem;
}

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

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .search-container {
        flex-direction: column;
        border-radius: 15px;
        padding: 15px;
    }

    #cityInput, #searchBtn, #locationBtn {
        border-radius: 10px;
    }

    .temperature {
        font-size: 3rem;
    }

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

    .weather-description p {
        font-size: 1.1rem;
    }

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

    .forecast-card {
        padding: 15px;
    }

    .forecast-card .icon {
        font-size: 2rem;
    }

    .forecast-card .forecast-desc {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .current-weather, .forecast-section {
        padding: 20px;
    }

    .temperature {
        font-size: 2.5rem;
    }

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

    .weather-description p {
        font-size: 1rem;
    }

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