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

:root {
    --primary-color: #1e3c72;
    --secondary-color: #2a5298;
    --accent-color: #00d4ff;
    --success-color: #4ade80;
    --warning-color: #facc15;
    --danger-color: #ef4444;
    --text-light: #f1f5f9;
    --text-dark: #1e293b;
    --bg-light: #f8fafc;
    --bg-dark: #0f172a;
    --card-bg: rgba(255, 255, 255, 0.1);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--text-light);
    min-height: 100vh;
    padding: 20px;
}

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

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px;
}

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

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

/* Search Section */
.search-section {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 250px;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-dark);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-color);
}

.search-btn, .location-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.search-btn {
    background: var(--accent-color);
    color: var(--primary-color);
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.location-btn {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-light);
    font-size: 1.2rem;
    min-width: 48px;
    padding: 12px;
}

.location-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Loading Spinner */
.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 40px auto;
}

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

/* Error Message */
.error-message {
    background: var(--danger-color);
    color: white;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

/* Weather Container */
.weather-container {
    animation: fadeIn 0.5s ease;
}

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

/* Current Weather */
.current-weather {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

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

.location-info p {
    opacity: 0.8;
    font-size: 0.95rem;
}

.weather-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 30px 0;
    flex-wrap: wrap;
    gap: 20px;
}

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

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

.weather-description p {
    font-size: 1.1rem;
    margin: 5px 0;
}

.weather-icon {
    font-size: 5rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* Weather Details Grid */
.weather-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.detail {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.detail .label {
    display: block;
    font-size: 0.9rem;
    opacity: 0.7;
    margin-bottom: 8px;
}

.detail .value {
    display: block;
    font-size: 1.3rem;
    font-weight: 600;
}

/* Forecast Section */
.forecast-section, .hourly-section {
    margin-bottom: 30px;
}

.forecast-section h3, .hourly-section h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    margin-top: 30px;
}

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

.forecast-card, .hourly-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.forecast-card:hover, .hourly-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent-color);
}

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

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

.forecast-card .temp, .hourly-card .temp {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.forecast-card .desc, .hourly-card .desc {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0.7;
    font-size: 0.9rem;
}

footer a {
    color: var(--accent-color);
    text-decoration: none;
    transition: opacity 0.3s ease;
}

footer a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

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

    .current-weather {
        padding: 20px;
    }

    .temperature {
        font-size: 2.5rem;
    }

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

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

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

    .search-input {
        min-width: 100%;
    }

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

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

    header {
        margin-bottom: 20px;
        padding: 10px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .current-weather {
        padding: 15px;
    }

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

    .temperature {
        font-size: 2rem;
    }

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

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