* {
    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;
}

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

header {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-bottom: 30px;
}

header h1 {
    color: #333;
    margin-bottom: 20px;
    font-size: 2.5rem;
    text-align: center;
}

.search-container {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

#locationInput {
    flex: 1;
    min-width: 250px;
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
}

#locationInput:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
}

#searchBtn {
    padding: 12px 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

#searchBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

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

/* Loading Spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

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

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f0f0f0;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

.loading-spinner p {
    color: #666;
    font-size: 18px;
}

/* Error Container */
.error-container {
    background: #ff6b6b;
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

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

.error-container::before {
    content: "⚠️";
    font-size: 24px;
}

/* Weather Container */
.weather-container {
    display: block;
}

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

/* Current Weather Section */
.current-weather {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-bottom: 30px;
}

.location-info {
    text-align: center;
    margin-bottom: 30px;
}

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

.location-info p {
    color: #999;
    font-size: 14px;
}

.weather-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.temperature-section {
    text-align: center;
}

.temperature {
    font-size: 4rem;
    color: #667eea;
    font-weight: bold;
    line-height: 1;
    margin-bottom: 10px;
}

.condition {
    font-size: 1.5rem;
    color: #666;
    margin-bottom: 5px;
}

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

.detail-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.detail-item .label {
    display: block;
    color: #999;
    font-size: 12px;
    text-transform: uppercase;
    margin-bottom: 5px;
    font-weight: bold;
}

.detail-item .value {
    display: block;
    color: #333;
    font-size: 1.2rem;
    font-weight: bold;
}

/* Forecast Section */
.forecast-section,
.hourly-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-bottom: 30px;
}

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

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

.forecast-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.forecast-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.forecast-card .date {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 10px;
}

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

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

.forecast-card .rain {
    font-size: 0.85rem;
    opacity: 0.85;
    margin-top: 10px;
}

/* Hourly Grid */
.hourly-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
    overflow-x: auto;
    padding: 10px 0;
}

.hourly-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border-top: 3px solid #667eea;
    transition: all 0.3s ease;
}

.hourly-item:hover {
    background: #efefef;
    transform: translateY(-3px);
}

.hourly-item .time {
    font-weight: bold;
    color: #667eea;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.hourly-item .icon {
    font-size: 1.8rem;
    margin: 5px 0;
}

.hourly-item .temp {
    color: #333;
    font-weight: bold;
    margin-bottom: 5px;
}

.hourly-item .condition {
    font-size: 0.8rem;
    color: #999;
}

/* Footer */
footer {
    text-align: center;
    color: white;
    padding: 20px;
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Responsive Design */
@media (max-width: 768px) {
    header {
        padding: 20px;
    }

    header h1 {
        font-size: 1.8rem;
    }

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

    #locationInput {
        min-width: 100%;
    }

    #searchBtn {
        width: 100%;
    }

    .weather-main {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .weather-details {
        grid-template-columns: 1fr;
    }

    .temperature {
        font-size: 3rem;
    }

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

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

    header {
        padding: 15px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .current-weather {
        padding: 20px;
    }

    .temperature {
        font-size: 2.5rem;
    }

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

    .hourly-grid {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    }
}