:root {
    --primary-bg: #0f172a;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.15);
    --accent-color: #38bdf8;
    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--primary-bg);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    transition: var(--transition);
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.app-container {
    width: 90%;
    max-width: 900px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    animation: fadeIn 0.8s ease-out;
}

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

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.logo {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(to right, #0ea5e9, #6366f1);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}

.search-container {
    display: flex;
    align-items: center;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    padding: 0.5rem 0.5rem 0.5rem 1.5rem;
    width: 100%;
    max-width: 400px;
    backdrop-filter: blur(8px);
    box-shadow: var(--card-shadow);
    transition: var(--transition);
}

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

#city-input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    width: 100%;
    outline: none;
    font-family: inherit;
}

#search-btn {
    background: var(--accent-color);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: white;
    transition: var(--transition);
}

#search-btn:hover {
    transform: rotate(15deg) scale(1.1);
    background: #0ea5e9;
}

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

.weather-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.current-weather {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
}

.location-details h2 {
    font-size: 2.5rem;
    margin-bottom: 0.25rem;
}

.location-details #country-name {
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.location-details #current-date {
    font-weight: 300;
}

.temp-display {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    justify-content: flex-end;
}

#weather-icon {
    width: 100px;
    height: 100px;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
}

.temp-info #temperature {
    font-size: 5rem;
    font-weight: 700;
    line-height: 1;
}

.temp-info .unit {
    font-size: 2rem;
    vertical-align: top;
    margin-top: 1rem;
    display: inline-block;
}

#weather-desc {
    font-size: 1.5rem;
    color: var(--text-secondary);
    text-align: right;
    text-transform: capitalize;
}

.weather-stats {
    grid-column: span 2;
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--glass-border);
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.stat-icon {
    width: 24px;
    height: 24px;
    color: var(--accent-color);
    margin-bottom: 0.25rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 600;
}

.forecast-section {
    width: 100%;
}

.forecast-section h3 {
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    padding-left: 0.5rem;
}

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

.forecast-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    transition: var(--transition);
    cursor: default;
}

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

.forecast-day {
    font-size: 0.9rem;
    font-weight: 600;
}

.forecast-icon {
    width: 48px;
    height: 48px;
}

.forecast-temp {
    font-weight: 600;
}

.forecast-temp .low {
    color: var(--text-secondary);
    font-weight: 400;
    font-size: 0.85rem;
}

.loader-container, .error-container, .welcome-container {
    text-align: center;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.welcome-container h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.error-container {
    border-color: rgba(239, 68, 68, 0.3);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--glass-border);
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

@media (max-width: 768px) {
    .current-weather {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .temp-display {
        justify-content: center;
    }
    .weather-stats {
        grid-column: span 1;
        flex-wrap: wrap;
        gap: 1.5rem;
        justify-content: center;
    }
    #weather-desc {
        text-align: center;
    }
    .location-details h2 {
        font-size: 2rem;
    }
}
