/* === CSS Variables === */
:root {
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.8);
    --glass-bg: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.25);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    --hover-bg: rgba(255, 255, 255, 0.25);
    
    /* Default Winter Theme Gradient */
    --bg-gradient: linear-gradient(135deg, #4b6cb7 0%, #182848 100%);
}

/* Dynamic Themes (keeping for base reference but focusing on winter) */
body.weather-clear {
    --bg-gradient: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
}
body.weather-clouds {
    --bg-gradient: linear-gradient(135deg, #536976 0%, #292E49 100%);
}
body.weather-rain {
    --bg-gradient: linear-gradient(135deg, #141E30 0%, #243B55 100%);
}
body.weather-snow {
    --bg-gradient: linear-gradient(135deg, #83a4d4 0%, #b6fbff 100%);
    --text-primary: #1a1a1a;
    --text-secondary: rgba(0, 0, 0, 0.7);
    --glass-bg: rgba(255, 255, 255, 0.4);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
}

/* === Reset & Base === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: var(--bg-gradient);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem 0;
    transition: background 0.8s ease-in-out, color 0.5s ease;
    overflow-x: hidden;
}

/* === Typography === */
h1 { font-size: 2.5rem; font-weight: 700; margin-bottom: 0.25rem; text-align: center;}
h2 { font-size: 1.5rem; font-weight: 600; text-transform: capitalize; }
h3 { font-size: 1.2rem; font-weight: 500; text-align: center; margin-bottom: 1rem;}
h4 { font-size: 1rem; font-weight: 600; margin-bottom: 0.8rem; color: var(--text-secondary); text-align: center;}
p { font-size: 1.1rem; color: var(--text-secondary); text-align: center; }

/* === Layout === */
.app-container {
    width: 100%;
    max-width: 1200px;
    padding: 0 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.mountain-header {
    text-align: center;
    margin-bottom: 1rem;
    animation: fadeIn 0.5s ease-out;
}

/* === Grid Layout === */
.elevations-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    animation: fadeIn 0.8s ease-out;
}

/* === Glassmorphism Components === */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 1.5rem;
    box-shadow: var(--glass-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.25);
}

.elevation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1rem;
}

.elevation-badge {
    background: rgba(0,0,0,0.2);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

body.weather-snow .elevation-badge {
    background: rgba(255,255,255,0.4);
}

/* === Weather Temp === */
.weather-temp-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.weather-icon-main i {
    width: 60px;
    height: 60px;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.2));
}

.temp-display {
    display: flex;
    align-items: flex-start;
}

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

.unit {
    font-size: 1.5rem;
    font-weight: 500;
    margin-top: 0.3rem;
}

/* === Weather Details Compact === */
.weather-details-compact {
    display: flex;
    justify-content: space-around;
    padding: 1rem 0;
    margin-bottom: 1rem;
    background: rgba(0,0,0,0.1);
    border-radius: 16px;
}

body.weather-snow .weather-details-compact {
    background: rgba(255,255,255,0.2);
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 500;
}

.detail-item i {
    width: 18px;
    height: 18px;
}

/* === Forecast Section === */
.compact-forecast {
    margin-top: auto;
}

.forecast-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.forecast-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    transition: background 0.3s ease;
}

.forecast-item:hover {
    background: rgba(255, 255, 255, 0.15);
}

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

.forecast-snow-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
}

.forecast-snow-info i {
    width: 16px;
    height: 16px;
    color: #83a4d4; /* Light blue for snow */
}

body.weather-snow .forecast-snow-info i {
    color: #0056b3;
}

.forecast-temp {
    font-weight: 600;
    width: 40px;
    text-align: right;
}

/* === Utility Classes === */
.hidden {
    display: none !important;
}

/* === Loading Spinner === */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--glass-border);
    border-top: 4px solid var(--text-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.error-message {
    color: #ff6b6b;
    text-align: center;
    font-size: 1.1rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: 12px;
    margin-top: 2rem;
}

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

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

/* === Responsive Design === */
@media (max-width: 900px) {
    .elevations-grid {
        grid-template-columns: 1fr;
    }
    
    .temperature {
        font-size: 3.5rem;
    }
}
