/* Import Inter font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap');

:root {
    --primary-bg: #0f172a;
    --secondary-bg: #1e293b;
    --accent-color: #38bdf8;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.container {
    width: 100%;
    max-width: 1200px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    animation: fadeIn 0.8s ease-out;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(to right, #38bdf8, #818cf8);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    margin-bottom: 0.5rem;
}

.header-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 300;
}

/* Main Content Layout */
.main-content {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
}

/* Sidebar / City List */
.city-list-container {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--glass-border);
}

.city-list-container h2 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

#city-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

#city-list li {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    border: 1px solid transparent;
}

#city-list li:hover {
    background: rgba(56, 189, 248, 0.1);
    border-color: var(--accent-color);
    transform: translateX(5px);
    color: var(--accent-color);
}

/* Weather Display */
.weather-display {
    padding: 1rem;
    opacity: 0;
    animation: slideUp 0.6s ease-out forwards 0.2s;
}

.weather-display.hidden {
    display: none;
}

.weather-display:not(.hidden) {
    display: block;
}

#selected-city {
    font-size: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

#temperature {
    font-size: 4rem;
    font-weight: 700;
    margin: 1rem 0;
    background: linear-gradient(to bottom, #fff, #94a3b8);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

#description {
    font-size: 1.5rem;
    color: var(--accent-color);
    margin-bottom: 2rem;
    text-transform: capitalize;
}

/* Weather Details Grid */
.weather-display p:not(#temperature):not(#description):not(#selected-city) {
    display: inline-block;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    margin-right: 1rem;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    border: 1px solid var(--glass-border);
    transition: var(--transition);
}

.weather-display p:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* Forecast Section */
.forecast {
    margin-top: 3rem;
}

.forecast h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    padding-left: 0.5rem;
    border-left: 4px solid var(--accent-color);
}

.forecast-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
}

.forecast-card {
    background: rgba(255, 255, 255, 0.03);
    padding: 1.5rem;
    border-radius: 16px;
    text-align: center;
    border: 1px solid var(--glass-border);
    transition: var(--transition);
}

.forecast-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.forecast-card strong {
    display: block;
    margin-bottom: 1rem;
    color: var(--accent-color);
    font-size: 1.1rem;
}

.forecast-card img {
    width: 64px;
    height: 64px;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.3));
}

.forecast-card p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 1rem;
        align-items: flex-start;
    }

    .container {
        padding: 1.5rem;
    }

    .main-content {
        grid-template-columns: 1fr;
    }

    .header h1 {
        font-size: 1.8rem;
    }

    #temperature {
        font-size: 3rem;
    }

    .city-list-container {
        order: 2;
        /* Move city list below weather on mobile if desired, or keep as is */
    }
}