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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: 
        linear-gradient(to bottom, rgba(74, 95, 127, 0.3) 0%, rgba(107, 140, 174, 0.2) 40%, rgba(201, 214, 232, 0.1) 100%),
        url('4k.jpg');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
    padding: 20px;
    color: #1e293b;
    -webkit-tap-highlight-color: rgba(59, 130, 246, 0.2);
}

/* Improve tap feedback on mobile */
button, .trip-selector-btn, .day-selector-btn, .mobile-select {
    -webkit-tap-highlight-color: rgba(59, 130, 246, 0.3);
    touch-action: manipulation;
}

/* Smooth transitions for better mobile UX */
.section-content {
    transition: all 0.3s ease;
}

/* Loading state improvements */
.loading {
    text-align: center;
    padding: 30px;
    color: #64748b;
    font-style: italic;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading {
    animation: pulse 2s ease-in-out infinite;
}

/* Scroll to top button - Mobile only */
.scroll-top-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.9);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    font-size: 24px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: none; /* Hidden on desktop */
    align-items: center;
    justify-content: center;
}

/* Show scroll button on mobile only */
@media (max-width: 768px) {
    .scroll-top-btn {
        display: flex;
    }
}

.scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-top-btn:hover {
    background: rgba(59, 130, 246, 1);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.scroll-top-btn:active {
    transform: translateY(-1px);
}

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

header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
    padding: 25px 20px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 8px;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
    letter-spacing: 1px;
}

.tagline {
    font-size: 1.1em;
    opacity: 0.95;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
}

/* Trip Selector */
.trip-selector {
    display: grid;
    gap: 15px;
    margin-bottom: 30px;
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
}

/* 1 trip: centered */
.trip-selector:has(.trip-selector-btn:only-child) {
    grid-template-columns: 1fr;
    max-width: 500px;
}

/* 2 trips: split in half */
.trip-selector:has(.trip-selector-btn:nth-child(2):last-child) {
    grid-template-columns: repeat(2, 1fr);
    max-width: 1000px;
}

/* 3+ trips: grid of 3 */
.trip-selector:has(.trip-selector-btn:nth-child(3)) {
    grid-template-columns: repeat(3, 1fr);
}

.trip-selector-btn {
    background: rgba(255, 255, 255, 0.85);
    border: 2px solid rgba(147, 197, 253, 0.3);
    border-radius: 12px;
    padding: 20px 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
}

.trip-selector-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(59, 130, 246, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(147, 197, 253, 0.6);
}

.trip-selector-btn.active {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(224, 242, 254, 0.95));
    border-color: #60a5fa;
    box-shadow: 0 6px 25px rgba(96, 165, 250, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
}

.resort-name {
    font-size: 1.2em;
    font-weight: bold;
    color: #3b82f6;
}

.resort-date {
    font-size: 0.85em;
    color: #64748b;
}

.countdown-mini {
    font-size: 1em;
    font-weight: bold;
    color: #38bdf8;
}

.trip-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    border: 2px solid rgba(147, 197, 253, 0.3);
    max-width: 1600px;
    margin: 0 auto;
    animation: fadeIn 0.3s ease;
    contain: layout;
}

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

.trip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 3px solid #60a5fa;
}

.trip-header h2 {
    color: #3b82f6;
    font-size: 2em;
}

.countdown {
    text-align: right;
    font-weight: bold;
}

.countdown .days {
    display: block;
    font-size: 2em;
    color: #38bdf8;
    line-height: 1;
}

.countdown .label {
    display: block;
    font-size: 0.8em;
    color: #999;
    text-transform: uppercase;
}

.trip-date {
    font-size: 1.1em;
    color: #666;
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 10px;
    text-align: center;
}

.countdown-progress {
    margin-bottom: 25px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: linear-gradient(90deg, rgba(229, 231, 235, 0.5), rgba(229, 231, 235, 0.8));
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: var(--progress, 0%);
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    border-radius: 15px;
    transition: width 1s ease;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.progress-text {
    text-align: center;
    margin-top: 10px;
    font-weight: bold;
    color: #3b82f6;
    font-size: 1.1em;
}

.weather-section,
.snow-section,
.forecast-section,
.webcam-section {
    margin-bottom: 25px;
}

h3 {
    color: #3b82f6;
    margin-bottom: 15px;
    font-size: 1.3em;
    border-left: 4px solid #60a5fa;
    padding-left: 10px;
}

.weather-data,
.snow-data {
    background: rgba(240, 249, 255, 0.65);
    backdrop-filter: blur(15px) saturate(150%);
    -webkit-backdrop-filter: blur(15px) saturate(150%);
    padding: 20px;
    border-radius: 12px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.weather-item,
.snow-item {
    text-align: center;
}

.weather-item .value,
.snow-item .value {
    font-size: 1.8em;
    font-weight: bold;
    color: #38bdf8;
    display: block;
}

.weather-item .label,
.snow-item .label {
    font-size: 0.9em;
    color: #666;
    margin-top: 5px;
}

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

.forecast-day {
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 15px 10px;
    border-radius: 10px;
    text-align: center;
    transition: all 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.forecast-day:hover {
    background: rgba(224, 242, 254, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.forecast-day .day-name {
    font-weight: bold;
    color: #3b82f6;
    margin-bottom: 8px;
    font-size: 0.9em;
}

.forecast-day .icon {
    font-size: 2em;
    margin: 8px 0;
}

.forecast-day .temp {
    font-size: 1.1em;
    font-weight: bold;
    color: #333;
}

.forecast-day .temp-min {
    font-size: 0.9em;
    color: #999;
}

.forecast-day .snow {
    font-size: 0.85em;
    color: #38bdf8;
    margin-top: 5px;
    font-weight: 600;
}

/* Detailed Forecast Section - Updated v2 */
.detailed-forecast-section {
    margin-bottom: 25px;
}

.forecast-day-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.day-selector-btn {
    background: rgba(255, 255, 255, 0.7);
    border: 2px solid rgba(147, 197, 253, 0.3);
    border-radius: 10px;
    padding: 12px 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    backdrop-filter: blur(10px);
}

.day-selector-btn:hover {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(96, 165, 250, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.day-selector-btn.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(96, 165, 250, 0.15));
    border-color: #60a5fa;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
    transform: translateY(-2px);
}

.day-selector-name {
    font-weight: 600;
    color: #3b82f6;
    font-size: 0.95em;
}

.day-selector-date {
    font-size: 0.8em;
    color: #64748b;
}

.detailed-forecast-widget {
    background: rgba(240, 249, 255, 0.65);
    backdrop-filter: blur(15px) saturate(150%);
    -webkit-backdrop-filter: blur(15px) saturate(150%);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    padding: 10px;
}

.detailed-periods {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: rgba(147, 197, 253, 0.15);
}

.period-forecast {
    background: rgba(255, 255, 255, 0.75);
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: background 0.2s;
}

.period-forecast:hover {
    background: rgba(255, 255, 255, 0.95);
}

.period-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(147, 197, 253, 0.3);
}

.period-icon {
    font-size: 1.5em;
}

.period-name {
    font-weight: 700;
    color: #1e293b;
    font-size: 1.05em;
    flex: 1;
}

.weather-icon-small {
    font-size: 1.8em;
}

.snow-line-indicator {
    background: linear-gradient(135deg, rgba(186, 230, 253, 0.3), rgba(147, 197, 253, 0.2));
    padding: 8px 12px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid rgba(147, 197, 253, 0.4);
}

.snow-line-label {
    font-size: 0.85em;
    font-weight: 600;
    color: #0369a1;
}

.elevation-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.elevation-card {
    background: rgba(240, 249, 255, 0.5);
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid rgba(186, 230, 253, 0.4);
    transition: all 0.3s;
}

.elevation-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.peak-card {
    border-color: rgba(96, 165, 250, 0.5);
}

.village-card {
    border-color: rgba(147, 197, 253, 0.5);
}

.elevation-header {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(96, 165, 250, 0.08));
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1px solid rgba(147, 197, 253, 0.3);
}

.elevation-icon {
    font-size: 1.2em;
}

.elevation-name {
    font-weight: 700;
    color: #3b82f6;
    font-size: 0.9em;
    flex: 1;
}

.elevation-height {
    font-size: 0.75em;
    color: #64748b;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.6);
    padding: 2px 6px;
    border-radius: 4px;
}

.elevation-stats {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 6px;
    font-size: 0.9em;
}

.stat-row.snow-active {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(96, 165, 250, 0.2));
    border: 1px solid rgba(56, 189, 248, 0.4);
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(56, 189, 248, 0.15);
}

.stat-icon {
    font-size: 1.1em;
}

.stat-label {
    font-size: 0.85em;
    color: #64748b;
    flex: 1;
}

.stat-value {
    font-weight: 700;
    color: #1e293b;
    font-size: 0.95em;
}

.stat-row.snow-active .stat-value {
    color: #0369a1;
}

.webcam-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
}

.webcam-item {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    border: 2px solid rgba(186, 230, 253, 0.5);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Use hover only on non-touch devices */
@media (hover: hover) {
    .webcam-item:hover {
        transform: translateY(-4px) translateZ(0);
        box-shadow: 0 8px 20px rgba(59, 130, 246, 0.2);
        border-color: rgba(96, 165, 250, 0.8);
    }
}

.webcam-frame {
    width: 100%;
    height: 350px;
    background: rgba(240, 249, 255, 0.5);
    position: relative;
    overflow: hidden;
    contain: layout style;
    transform: translateZ(0);
}

.webcam-frame iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.webcam-info {
    padding: 15px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.webcam-name {
    font-size: 0.95em;
    font-weight: 600;
    color: #1e293b;
    flex: 1;
}

.webcam-link {
    font-size: 0.85em;
    color: #3b82f6;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s;
}

.webcam-link:hover {
    color: #60a5fa;
    text-decoration: underline;
}

.snow-history-section,
.altitude-section {
    margin-bottom: 25px;
}

.chart-container {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 20px;
    border-radius: 12px;
    height: 350px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.chart-container canvas {
    max-height: 300px;
    width: 100% !important;
    height: 300px !important;
}

.altitude-data {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.altitude-item {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.altitude-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #60a5fa 0%, #38bdf8 100%);
}

.altitude-item .location {
    font-size: 1.1em;
    font-weight: bold;
    color: #3b82f6;
    margin-bottom: 10px;
}

.altitude-item .elevation {
    font-size: 0.9em;
    color: #999;
    margin-bottom: 15px;
}

.altitude-item .depth {
    font-size: 2.5em;
    font-weight: bold;
    color: #38bdf8;
    margin-bottom: 5px;
}

.altitude-item .depth-label {
    font-size: 0.85em;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
}

footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    padding: 10px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    margin-top: 20px;
    font-size: 0.8em;
    border: 1px solid rgba(255, 255, 255, 0.15);
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
    transform: translateZ(0);
    will-change: transform;
    position: relative;
    isolation: isolate;
}

footer p {
    margin: 3px 0;
}

footer a {
    color: rgba(255, 255, 255, 0.95);
    text-decoration: underline;
    transition: opacity 0.2s;
}

footer a:hover {
    opacity: 0.8;
}

.add-resort-hint {
    opacity: 0.75;
    font-size: 0.9em;
}

.add-resort-hint code {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 0.95em;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #999;
}

.error {
    background: rgba(254, 226, 226, 0.8);
    color: #dc2626;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid rgba(248, 113, 113, 0.3);
}

/* Mobile Resort Selector */
.mobile-resort-selector {
    display: none;
    margin-bottom: 20px;
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
}

.mobile-select {
    width: 100%;
    padding: 16px 20px;
    font-size: 1.1em;
    border: 2px solid rgba(147, 197, 253, 0.5);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    color: #1e293b;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=UTF-8,%3csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"%3e%3cpolyline points="6 9 12 15 18 9"%3e%3c/polyline%3e%3c/svg%3e');
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 20px;
    padding-right: 50px;
}

.mobile-select:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 4px 20px rgba(96, 165, 250, 0.3);
}

.mobile-resort-selector label {
    display: block;
    font-weight: bold;
    color: white;
    margin-bottom: 10px;
    font-size: 1.1em;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

/* Mobile Day Selector */
.mobile-day-select {
    display: none;
    margin-bottom: 15px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .mobile-day-select {
        display: block;
    }

    body {
        padding: 12px;
    }

    header h1 {
        font-size: 1.8em;
    }

    .tagline {
        font-size: 1em;
    }

    /* Show mobile selector, hide desktop */
    .mobile-resort-selector {
        display: block;
    }

    .desktop-only {
        display: none !important;
    }

    .trip-selector {
        grid-template-columns: 1fr;
    }

    .trip-header {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }

    .trip-header h2 {
        font-size: 1.6em;
        word-wrap: break-word;
        max-width: 100%;
    }

    .countdown {
        text-align: center;
        margin-top: 5px;
    }

    .countdown .days {
        font-size: 1.8em;
    }

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

    .forecast-data {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .forecast-day {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px;
        text-align: left;
    }

    .forecast-day .day-name {
        font-size: 1.1em;
        margin-bottom: 4px;
        min-width: 80px;
    }

    .forecast-day .icon {
        font-size: 2.5em;
        margin: 0 15px;
        flex-shrink: 0;
    }

    .forecast-day .temp {
        font-size: 1.3em;
        margin-right: 8px;
    }

    .forecast-day .temp-min {
        font-size: 1em;
        margin-right: 15px;
    }

    .forecast-day .snow {
        font-size: 1em;
        margin-top: 0;
        white-space: nowrap;
    }

    .forecast-day-info {
        display: flex;
        flex-direction: column;
        flex: 1;
    }

    .forecast-day-temps {
        display: flex;
        align-items: baseline;
        gap: 8px;
    }

    .detailed-periods {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .period-forecast {
        padding: 16px;
    }
    
    .period-header {
        flex-wrap: wrap;
        padding-bottom: 10px;
    }
    
    .period-icon {
        font-size: 1.8em;
    }
    
    .period-name {
        font-size: 1.1em;
    }
    
    .weather-icon-small {
        font-size: 2.2em;
    }
    
    .snow-line-indicator {
        width: 100%;
        margin-top: 10px;
        padding: 10px 12px;
    }
    
    .elevation-comparison {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .elevation-info {
        display: flex;
        flex-direction: column;
        gap: 4px;
        flex: 1;
        margin-bottom: 0;
    }
    
    .elevation-location {
        display: flex;
        align-items: center;
        gap: 6px;
    }
    
    .elevation-icon {
        font-size: 1.5em;
    }
    
    .elevation-name {
        font-size: 1em;
        font-weight: bold;
        color: #3b82f6;
    }
    
    .elevation-height {
        font-size: 0.85em;
        color: #64748b;
        font-weight: 600;
        margin-left: 26px;
        padding: 0;
        background: none;
    }
    
    .elevation-stats {
        display: flex;
        gap: 12px;
        flex-shrink: 0;
    }
    
    .stat-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 2px;
        padding: 0;
        background: none;
        border: none;
        border-radius: 0;
    }
    
    .stat-item .stat-value {
        font-size: 1.1em;
        font-weight: bold;
        color: #1e293b;
    }
    
    .stat-item .stat-label {
        font-size: 0.75em;
        color: #64748b;
    }
    
    .stat-item.snow-active .stat-value {
        color: #0369a1;
        font-size: 1.25em;
    }
    
    .stat-item.snow-active .stat-label {
        color: #0369a1;
    }
    
    /* Snow Depth by Altitude - horizontal layout */
    .altitude-data {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .altitude-item {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 16px;
        text-align: left;
    }
    
    .altitude-item::before {
        display: none;
    }
    
    .altitude-info {
        display: flex;
        flex-direction: column;
        gap: 4px;
        flex: 1;
    }
    
    .altitude-item .location {
        font-size: 1.1em;
        margin-bottom: 0;
    }
    
    .altitude-item .elevation {
        font-size: 0.85em;
        margin-bottom: 0;
    }
    
    .altitude-depth {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .altitude-item .depth {
        font-size: 2em;
        margin-bottom: 2px;
    }
    
    .altitude-item .depth-label {
        font-size: 0.75em;
    }

    .forecast-day-selector {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 480px) {
    body {
        padding: 8px;
        font-size: 14px;
    }

    header {
        padding: 18px 15px;
        margin-bottom: 15px;
    }

    header h1 {
        font-size: 1.5em;
    }

    .tagline {
        font-size: 0.9em;
    }

    .trip-card {
        padding: 14px;
        margin-bottom: 12px;
    }

    .trip-selector-btn {
        padding: 16px 18px;
        min-height: 60px;
    }

    .resort-name {
        font-size: 1em;
    }

    .mobile-select {
        font-size: 1em;
        padding: 14px 18px;
    }

    /* Larger touch targets for mobile */
    .forecast-day-btn {
        min-height: 48px;
        padding: 10px 6px;
        font-size: 0.85em;
    }

    /* Stack data items vertically on mobile */
    .weather-item,
    .snow-item {
        padding: 12px;
        font-size: 0.95em;
    }

    /* Section headers */
    .section-header {
        font-size: 1.1em;
        padding: 10px 0;
    }

    /* Better spacing for period cards */
    .period-forecast {
        margin-bottom: 10px;
        padding: 12px;
    }

    .forecast-data {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .forecast-day {
        padding: 14px;
    }

    .forecast-day .day-name {
        font-size: 1em;
    }

    .forecast-day .icon {
        font-size: 2.2em;
        margin: 0 12px;
    }

    .forecast-day .temp {
        font-size: 1.2em;
    }

    .forecast-day-selector {
        display: flex;
        overflow-x: auto;
        gap: 8px;
        padding-bottom: 10px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }

    .forecast-day-selector::-webkit-scrollbar {
        height: 8px;
    }

    .forecast-day-selector::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.3);
        border-radius: 4px;
    }

    .forecast-day-selector::-webkit-scrollbar-thumb {
        background: rgba(59, 130, 246, 0.5);
        border-radius: 4px;
    }

    .day-selector-btn {
        flex: 0 0 auto;
        min-width: 100px;
        scroll-snap-align: start;
    }

    .elevation-card {
        padding: 0 !important;
    }
    
    .elevation-info {
        min-width: 80px !important;
    }
    
    .elevation-icon {
        font-size: 1.3em !important;
    }
    
    .elevation-name {
        font-size: 0.85em !important;
        flex: 1;
        min-width: 0;
    }
    
    .elevation-height {
        display: none !important;
    }
    
    .elevation-header {
        gap: 4px !important;
        padding: 8px 10px !important;
    }
    
    .elevation-stats {
        padding: 10px !important;
        gap: 8px !important;
    }
    
    .stat-row {
        padding: 6px 8px !important;
        font-size: 0.9em !important;
        gap: 8px !important;
    }
    
    .stat-icon {
        font-size: 1.1em !important;
    }
    
    .stat-label {
        font-size: 0.85em !important;
        flex: 1;
    }
    
    .stat-value {
        font-size: 0.95em !important;
        white-space: nowrap;
    }
    
    .stat-item .stat-value {
        font-size: 1em !important;
    }
    
    .stat-item .stat-label {
        font-size: 0.7em !important;
    }
    
    .stat-item.snow-active .stat-value {
        font-size: 1.15em !important;
    }

    /* Webcams - stack vertically on small screens */
    .webcam-container {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .webcam-item {
        width: 100%;
    }

    .webcam-frame {
        height: 220px;
    }

    .webcam-info {
        padding: 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .webcam-link {
        align-self: stretch;
        text-align: center;
        padding: 8px;
        background: rgba(59, 130, 246, 0.1);
        border-radius: 6px;
    }

    /* Chart container */
    .chart-container {
        padding: 10px;
        height: 320px;
    }
    
    .chart-container canvas {
        max-height: 280px !important;
        height: 280px !important;
    }

    /* Countdown */
    .countdown {
        font-size: 1.1em;
    }

    .trip-date {
        font-size: 0.95em;
        padding: 8px;
        margin-bottom: 12px;
        word-wrap: break-word;
    }

    /* Progress bar */
    .progress-bar {
        height: 25px;
    }

    .progress-text {
        font-size: 0.9em;
    }
}

/* ============================================
   Authentication Styles
   ============================================ */

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 40px;
    max-width: 450px;
    width: 100%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h1 {
    font-size: 2em;
    color: #1e293b;
    margin-bottom: 8px;
}

.auth-tagline {
    color: #64748b;
    font-size: 0.95em;
}

.auth-form h2 {
    color: #1e293b;
    margin-bottom: 24px;
    font-size: 1.5em;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: #475569;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.9em;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid rgba(148, 163, 184, 0.3);
    border-radius: 10px;
    font-size: 1em;
    transition: all 0.3s;
    background: rgba(255, 255, 255, 0.8);
}

.form-group input:focus {
    outline: none;
    border-color: #3b82f6;
    background: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group small {
    display: block;
    color: #64748b;
    font-size: 0.8em;
    margin-top: 6px;
}

.auth-button {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 8px;
}

.auth-button:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.auth-button:active {
    transform: translateY(0);
}

.auth-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.auth-error {
    margin-top: 16px;
    padding: 12px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    color: #dc2626;
    font-size: 0.9em;
    display: none;
}

.form-select {
    width: 100%;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
    cursor: pointer;
}

.form-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.auth-error.show {
    display: block;
}

.auth-switch {
    text-align: center;
    margin-top: 24px;
    color: #64748b;
    font-size: 0.9em;
}

.auth-switch a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.auth-switch a:hover {
    color: #2563eb;
}

.confirm-message {
    color: #64748b;
    margin-bottom: 24px;
    line-height: 1.5;
}

.confirm-message strong {
    color: #1e293b;
}

/* Header with logout button */
.header-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    position: relative;
}

.header-content > div:first-child {
    flex: 1;
    text-align: center;
}

.header-content > div:last-child {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

.logout-btn {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Edit and Delete button styles */
.edit-trip-btn:hover {
    background: rgba(16, 185, 129, 0.25) !important;
    border-color: rgba(16, 185, 129, 0.5) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2) !important;
}

.delete-trip-btn:hover {
    background: rgba(239, 68, 68, 0.25) !important;
    border-color: rgba(239, 68, 68, 0.5) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2) !important;
}

.edit-trip-btn:active,
.delete-trip-btn:active {
    transform: translateY(0);
}

/* Mobile adjustments for auth */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 12px;
    }
    
    .header-content > div:last-child {
        position: static;
        transform: none;
        display: flex;
        gap: 10px;
    }
    
    .logout-btn {
        align-self: flex-end;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 30px 20px;
    }
    
    .auth-header h1 {
        font-size: 1.6em;
    }
    
    .auth-form h2 {
        font-size: 1.3em;
    }
}
