:root {
    --primary-bg: #0a0e14;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-primary: #ffffff;
    --text-secondary: #cbd5e0;
    --accent: #38bdf8;
    --accent-hover: #0ea5e9;
    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --font-outfit: 'Outfit', sans-serif;
}

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

body {
    font-family: var(--font-outfit);
    background: var(--primary-bg);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(10, 14, 20, 0.8) 0%, rgba(30, 41, 59, 0.6) 100%), 
                url('./weather_bg.png') no-repeat center center/cover;
    z-index: -1;
    filter: brightness(0.7);
}

.app-container {
    width: 90%;
    max-width: 1000px;
    padding: 2rem;
    display: grid;
    grid-template-rows: auto auto auto;
    gap: 2rem;
    animation: fadeIn 0.8s ease-out;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.logo {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    background: linear-gradient(90deg, #38bdf8, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.search-box {
    display: flex;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    padding: 0.5rem 1rem;
    min-width: 300px;
    transition: all 0.3s ease;
}

.search-box:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.3);
}

.search-box input {
    background: transparent;
    border: none;
    outline: none;
    color: white;
    padding: 0.5rem;
    flex: 1;
    font-size: 1rem;
}

.search-box button {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: color 0.3s;
}

.search-box button:hover {
    color: var(--accent);
}

.location-current {
    font-weight: 400;
    color: var(--text-secondary);
}

.glass-container {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: var(--card-shadow);
}

.current-weather {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.current-weather h1 {
    font-size: 6rem;
    font-weight: 800;
    margin-bottom: -0.5rem;
}

.current-weather p#condition {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

#weather-details {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.detail-item {
    display: flex;
    flex-direction: column;
}

.detail-item .label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.detail-item .value {
    font-size: 1.25rem;
    font-weight: 600;
}

.weather-icon {
    width: 200px;
    height: 200px;
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.4));
    animation: floating 3s ease-in-out infinite;
}

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

#forecast-section h3 {
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-secondary);
}

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

.forecast-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1.5rem 1rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease, background 0.3s ease;
}

.forecast-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.1);
}

.forecast-card .day {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.forecast-card .temp-f {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.forecast-card img {
    width: 50px;
    height: 50px;
}

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

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

.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 14, 20, 0.9);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(56, 189, 248, 0.1);
    border-top: 5px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .current-weather {
        flex-direction: column-reverse;
        text-align: center;
    }
    #weather-details {
        justify-content: center;
    }
    .current-weather h1 {
        font-size: 4rem;
    }
}
