/* CSS Variables for Dynamic Theming */
:root {
    /* Spring Theme - Realistic Forest/Garden */
    --spring-primary: url('https://images.unsplash.com/photo-1490750967868-88aa4486c946?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80');
    --spring-day: url('https://images.unsplash.com/photo-1490750967868-88aa4486c946?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80');
    --spring-night: url('https://images.unsplash.com/photo-1518837695005-2083093ee35b?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80');
    --spring-secondary: rgba(168, 230, 207, 0.3);
    --spring-accent: #7fb069;
    --spring-particles: #ffffff;
    
    /* Summer Theme - Realistic Beach/Sunny Landscape */
    --summer-primary: url('https://images.unsplash.com/photo-1507525428034-b723cf961d3e?ixlib=rb-4.0.3&auto=format&fit=crop&w=2073&q=80');
    --summer-day: url('https://images.unsplash.com/photo-1507525428034-b723cf961d3e?ixlib=rb-4.0.3&auto=format&fit=crop&w=2073&q=80');
    --summer-night: url('https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80');
    --summer-secondary: rgba(255, 236, 210, 0.3);
    --summer-accent: #ff6b6b;
    --summer-particles: #fff2cc;
    
    /* Autumn Theme - Realistic Fall Forest */
    --autumn-primary: url('https://images.unsplash.com/photo-1441974231531-c6227db76b6e?ixlib=rb-4.0.3&auto=format&fit=crop&w=2071&q=80');
    --autumn-day: url('https://images.unsplash.com/photo-1441974231531-c6227db76b6e?ixlib=rb-4.0.3&auto=format&fit=crop&w=2071&q=80');
    --autumn-night: url('https://images.unsplash.com/photo-1509773896068-7fd415d91e2e?ixlib=rb-4.0.3&auto=format&fit=crop&w=2069&q=80');
    --autumn-secondary: rgba(210, 153, 194, 0.3);
    --autumn-accent: #d69e2e;
    --autumn-particles: #ffa500;
    
    /* Winter Theme - Realistic Snowy Landscape */
    --winter-primary: url('https://images.unsplash.com/photo-1483664852095-d6cc6870702d?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80');
    --winter-day: url('https://images.unsplash.com/photo-1483664852095-d6cc6870702d?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80');
    --winter-night: url('https://images.unsplash.com/photo-1578662996442-48f60103fc96?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80');
    --winter-secondary: rgba(102, 126, 234, 0.3);
    --winter-accent: #4facfe;
    --winter-particles: #ffffff;
    /* UI Colors */
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-primary: rgba(255, 255, 255, 0.9);
    --text-secondary: rgba(255, 255, 255, 0.7);
    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-strong: 0 16px 64px rgba(0, 0, 0, 0.2);
    
    /* Fallback gradients for when images don't load */
    --spring-fallback: linear-gradient(135deg, #a8e6cf 0%, #dcedc1 50%, #ffd3a5 100%);
    --summer-fallback: linear-gradient(135deg, #ffecd2 0%, #fcb69f 50%, #ff9a9e 100%);
    --autumn-fallback: linear-gradient(135deg, #d299c2 0%, #fef9d7 50%, #d69e2e 100%);
    --winter-fallback: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    
    /* Animation Variables */
    --transition-smooth: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Preload critical images */
body::before {
    content: '';
    position: absolute;
    top: -9999px;
    left: -9999px;
    width: 1px;
    height: 1px;
    background-image: 
        var(--spring-day),
        var(--summer-day),
        var(--autumn-day),
        var(--winter-day),
        var(--spring-night),
        var(--summer-night),
        var(--autumn-night),
        var(--winter-night);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    overflow: hidden;
    cursor: none;
    background: #000;
}

/* Custom Cursor */
body::after {
    content: '';
    position: fixed;
    top: var(--cursor-y, 0);
    left: var(--cursor-x, 0);
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 10000;
    transition: all 0.1s ease;
    transform: translate(-50%, -50%);
    mix-blend-mode: difference;
}

/* Cursor hover effects */
.season-btn:hover ~ body::after,
.weather-btn:hover ~ body::after,
.toggle-btn:hover ~ body::after {
    width: 30px;
    height: 30px;
    background: radial-gradient(circle, rgba(255, 255, 255, 1) 0%, transparent 70%);
}

/* Environment Container */
.environment {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: var(--spring-primary);
    transition: var(--transition-smooth);
}

/* Background Layers */
.background-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: var(--spring-primary);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    transition: var(--transition-smooth);
    z-index: 1;
}

/* Fallback for when images don't load */
.background-layer {
    background: var(--spring-fallback), var(--spring-primary);
}

.environment.spring .background-layer {
    background: var(--spring-fallback), var(--spring-day);
}

.environment.summer .background-layer {
    background: var(--summer-fallback), var(--summer-day);
}

.environment.autumn .background-layer {
    background: var(--autumn-fallback), var(--autumn-day);
}

.environment.winter .background-layer {
    background: var(--winter-fallback), var(--winter-day);
}

/* Add realistic depth and lighting effects */
.background-layer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.1) 50%,
        rgba(0, 0, 0, 0.3) 100%
    );
    z-index: 1;
    transition: var(--transition-smooth);
}

/* Add realistic atmospheric perspective */
.background-layer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        ellipse at center top,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.05) 30%,
        transparent 70%
    );
    z-index: 2;
    transition: var(--transition-smooth);
}

/* Enhanced image loading states */
.background-layer.loading {
    background-size: 0;
    animation: imageLoad 2s ease-in-out;
}

@keyframes imageLoad {
    0% { 
        background-size: 0;
        filter: blur(20px);
    }
    50% {
        background-size: cover;
        filter: blur(10px);
    }
    100% { 
        background-size: cover;
        filter: blur(0);
    }
}

.atmosphere-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(0, 0, 0, 0.1) 100%);
    transition: var(--transition-smooth);
    z-index: 2;
}

/* Particle Canvas */
.particle-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    pointer-events: none;
}

/* Weather Effects */
.weather-effects {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 4;
    pointer-events: none;
}

.rain-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: var(--transition-smooth);
}

.snow-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: var(--transition-smooth);
}

.fog-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0.05) 50%, 
        rgba(255, 255, 255, 0.1) 100%);
    opacity: 0;
    transition: var(--transition-smooth);
    animation: fogDrift 20s ease-in-out infinite;
}

.lightning-flash {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    opacity: 0;
    z-index: 5;
}

/* Enhanced scrollbar with particle effects */
.control-panel {
    position: fixed;
    top: 2rem;
    right: 2rem;
    width: 320px;
    max-height: calc(100vh - 4rem);
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: var(--shadow-strong);
    z-index: 1000;
    transition: var(--transition-smooth);
    overflow-y: auto;
    overflow-x: hidden;
    cursor: auto;
    
    /* Custom scrollbar styling */
    scrollbar-gutter: stable;
}

.control-panel:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.3);
}

/* Add scrollbar track glow effect */
.control-panel::-webkit-scrollbar-track {
    position: relative;
}

.control-panel::-webkit-scrollbar-track::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.05) 50%,
        rgba(255, 255, 255, 0.1) 100%
    );
    border-radius: 6px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.control-panel:hover::-webkit-scrollbar-track::before {
    opacity: 1;
}

/* Scrollbar thumb with enhanced effects */
.control-panel::-webkit-scrollbar-thumb {
    position: relative;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.25) 0%, 
        rgba(255, 255, 255, 0.1) 50%, 
        rgba(255, 255, 255, 0.2) 100%
    );
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.control-panel::-webkit-scrollbar-thumb::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        transparent 50%, 
        rgba(255, 255, 255, 0.1) 100%
    );
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.control-panel::-webkit-scrollbar-thumb:hover::before {
    opacity: 1;
}

.panel-header {
    text-align: center;
    margin-bottom: 2rem;
}

.panel-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #fff 0%, rgba(255, 255, 255, 0.7) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.panel-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Section Headers */
.control-panel h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Season Selector */
.season-selector {
    margin-bottom: 2rem;
}

.season-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.season-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    backdrop-filter: blur(10px);
}

.season-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px) scale(1.02);
    box-shadow: var(--shadow-soft);
}

.season-btn.active {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.season-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.season-name {
    font-weight: 600;
}

/* Weather Controls */
.weather-controls {
    margin-bottom: 2rem;
}

.weather-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.weather-btn {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    backdrop-filter: blur(8px);
}

.weather-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.02);
}

.weather-btn.active {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.weather-icon {
    margin-right: 0.5rem;
    font-size: 1rem;
}

/* Environment Controls */
.environment-controls {
    margin-bottom: 1rem;
}

.control-group {
    margin-bottom: 1.5rem;
}

.control-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

input[type="range"] {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #fff 0%, rgba(255, 255, 255, 0.8) 100%);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: var(--transition-fast);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.time-display {
    float: right;
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 600;
}

.toggle-controls {
    display: flex;
    gap: 0.75rem;
}

.toggle-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    backdrop-filter: blur(8px);
}

.toggle-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.toggle-btn.active {
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.toggle-icon {
    margin-right: 0.5rem;
}

/* Weather Info Display */
.weather-info {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.5rem 2rem;
    box-shadow: var(--shadow-soft);
    z-index: 1000;
    transition: var(--transition-smooth);
    cursor: auto;
}

.weather-info:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.current-season {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.current-weather {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.temperature {
    font-size: 2rem;
    font-weight: 300;
    color: var(--text-primary);
    background: linear-gradient(135deg, #fff 0%, rgba(255, 255, 255, 0.7) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 1s ease, visibility 1s ease;
    overflow: hidden;
}

.loading-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('https://images.unsplash.com/photo-1419242902214-272b3f66ee7a?ixlib=rb-4.0.3&auto=format&fit=crop&w=2013&q=80');
    background-size: cover;
    background-position: center;
    opacity: 0.3;
    filter: blur(3px);
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    text-align: center;
    color: white;
    position: relative;
    z-index: 2;
}

.loading-spinner {
    width: 80px;
    height: 80px;
    margin: 0 auto 2rem;
    position: relative;
}

.loading-spinner::before,
.loading-spinner::after {
    content: '';
    position: absolute;
    border-radius: 50%;
}

.loading-spinner::before {
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-top-color: #4facfe;
    border-right-color: #00f2fe;
    animation: spin 1.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

.loading-spinner::after {
    width: 70%;
    height: 70%;
    top: 15%;
    left: 15%;
    border: 3px solid transparent;
    border-bottom-color: #ffd89b;
    border-left-color: #19547b;
    animation: spin 2s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite reverse;
}

.loading-text {
    font-size: 1.25rem;
    font-weight: 600;
    opacity: 0.95;
    letter-spacing: 1px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    animation: fadeInOut 2s ease-in-out infinite;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

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

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

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

@keyframes glow {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 255, 255, 0.2); }
    50% { box-shadow: 0 0 40px rgba(255, 255, 255, 0.4); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

@keyframes breathe {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.02) rotate(1deg); }
}

/* Enhanced button animations */
.season-btn:hover {
    animation: pulse 2s ease-in-out infinite;
}

.weather-btn:hover {
    animation: breathe 3s ease-in-out infinite;
}

/* Magical sparkle effect */
.control-panel::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    background-size: 200% 200%;
    border-radius: 26px;
    z-index: -1;
    animation: shimmer 3s ease-in-out infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.control-panel:hover::before {
    opacity: 1;
}

/* Season-specific Styles with Realistic Backgrounds */
.environment.spring .background-layer {
    background-image: var(--spring-day);
}

.environment.summer .background-layer {
    background-image: var(--summer-day);
}

.environment.autumn .background-layer {
    background-image: var(--autumn-day);
}

.environment.winter .background-layer {
    background-image: var(--winter-day);
}

/* Night mode variations */
.environment.spring.night-mode .background-layer {
    background-image: var(--spring-night);
    filter: brightness(0.4) contrast(1.2) saturate(0.8);
}

.environment.summer.night-mode .background-layer {
    background-image: var(--summer-night);
    filter: brightness(0.4) contrast(1.2) saturate(0.8);
}

.environment.autumn.night-mode .background-layer {
    background-image: var(--autumn-night);
    filter: brightness(0.4) contrast(1.2) saturate(0.8);
}

.environment.winter.night-mode .background-layer {
    background-image: var(--winter-night);
    filter: brightness(0.4) contrast(1.2) saturate(0.8);
}

/* Enhanced atmospheric effects for realism */
.environment.spring .atmosphere-layer {
    background: 
        radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        linear-gradient(180deg, rgba(135, 206, 235, 0.1) 0%, transparent 40%);
}

.environment.summer .atmosphere-layer {
    background: 
        radial-gradient(ellipse at 70% 10%, rgba(255, 215, 0, 0.15) 0%, transparent 60%),
        linear-gradient(180deg, rgba(255, 165, 0, 0.05) 0%, transparent 30%);
}

.environment.autumn .atmosphere-layer {
    background: 
        radial-gradient(ellipse at 50% 30%, rgba(255, 140, 0, 0.1) 0%, transparent 50%),
        linear-gradient(180deg, rgba(139, 69, 19, 0.1) 0%, transparent 40%);
}

.environment.winter .atmosphere-layer {
    background: 
        radial-gradient(ellipse at center, rgba(173, 216, 230, 0.15) 0%, transparent 60%),
        linear-gradient(180deg, rgba(176, 196, 222, 0.1) 0%, transparent 50%);
}

/* Weather-specific Effects */
.weather-rain .rain-container {
    opacity: 1;
}

.weather-snow .snow-container {
    opacity: 1;
}

.weather-fog .fog-overlay {
    opacity: 0.7;
}

.weather-thunderstorm .atmosphere-layer {
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.6) 100%);
}

/* Responsive Design */
@media (max-width: 768px) {
    .control-panel {
        top: 1rem;
        right: 1rem;
        left: 1rem;
        width: auto;
        max-height: 60vh;
        padding: 1.5rem;
    }
    
    .weather-info {
        bottom: 1rem;
        left: 1rem;
        right: 1rem;
        text-align: center;
        padding: 1rem 1.5rem;
    }
    
    .season-buttons {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }
    
    .weather-buttons {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .toggle-controls {
        flex-direction: column;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .control-panel {
        padding: 1rem;
        border-radius: 16px;
    }
    
    .panel-title {
        font-size: 1.25rem;
    }
    
    .season-buttons {
        grid-template-columns: 1fr;
    }
    
    .season-btn {
        padding: 0.75rem;
    }
    
    .weather-btn {
        padding: 0.625rem;
        font-size: 0.75rem;
    }
}

/* Performance Optimizations */
.particle-canvas,
.weather-effects,
.background-layer,
.atmosphere-layer {
    will-change: transform, opacity;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Custom Scrollbar Design */
/* Webkit browsers (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.3) 0%, 
        rgba(255, 255, 255, 0.15) 50%, 
        rgba(255, 255, 255, 0.25) 100%
    );
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.4) 0%, 
        rgba(255, 255, 255, 0.25) 50%, 
        rgba(255, 255, 255, 0.35) 100%
    );
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 
        0 6px 24px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 0 20px rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

::-webkit-scrollbar-thumb:active {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.5) 0%, 
        rgba(255, 255, 255, 0.3) 50%, 
        rgba(255, 255, 255, 0.4) 100%
    );
    transform: scale(0.95);
}

::-webkit-scrollbar-corner {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) rgba(255, 255, 255, 0.05);
}

/* Enhanced scrollbar for control panel */
.control-panel::-webkit-scrollbar {
    width: 8px;
}

.control-panel::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    margin: 4px;
}

.control-panel::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.25) 0%, 
        rgba(255, 255, 255, 0.1) 50%, 
        rgba(255, 255, 255, 0.2) 100%
    );
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 20px;
}

.control-panel::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.35) 0%, 
        rgba(255, 255, 255, 0.2) 50%, 
        rgba(255, 255, 255, 0.3) 100%
    );
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

/* Animated scrollbar glow effect */
@keyframes scrollbarGlow {
    0%, 100% { 
        box-shadow: 
            0 4px 16px rgba(0, 0, 0, 0.1),
            inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }
    50% { 
        box-shadow: 
            0 6px 24px rgba(0, 0, 0, 0.15),
            inset 0 1px 0 rgba(255, 255, 255, 0.3),
            0 0 20px rgba(255, 255, 255, 0.15);
    }
}

/* Season-specific scrollbar colors */
.environment.spring ::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, 
        rgba(168, 230, 207, 0.4) 0%, 
        rgba(168, 230, 207, 0.2) 50%, 
        rgba(168, 230, 207, 0.3) 100%
    );
}

.environment.summer ::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, 
        rgba(255, 236, 210, 0.4) 0%, 
        rgba(255, 236, 210, 0.2) 50%, 
        rgba(255, 236, 210, 0.3) 100%
    );
}

.environment.autumn ::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, 
        rgba(210, 153, 194, 0.4) 0%, 
        rgba(210, 153, 194, 0.2) 50%, 
        rgba(210, 153, 194, 0.3) 100%
    );
}

.environment.winter ::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, 
        rgba(102, 126, 234, 0.4) 0%, 
        rgba(102, 126, 234, 0.2) 50%, 
        rgba(102, 126, 234, 0.3) 100%
    );
}

/* Scrollbar hover animations */
::-webkit-scrollbar-thumb:hover {
    animation: scrollbarGlow 2s ease-in-out infinite;
}

/* Enhanced scrollbar states */
.control-panel.scrollbar-active::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.35) 0%, 
        rgba(255, 255, 255, 0.2) 50%, 
        rgba(255, 255, 255, 0.3) 100%
    );
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 0 15px var(--scroll-glow, rgba(255, 255, 255, 0.1));
}

.control-panel.scrollbar-active::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
}

/* Scrollbar with seasonal themes */
.environment.spring .control-panel.scrollbar-active::-webkit-scrollbar-thumb {
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(168, 230, 207, 0.4),
        0 0 15px rgba(168, 230, 207, 0.3);
}

.environment.summer .control-panel.scrollbar-active::-webkit-scrollbar-thumb {
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 236, 210, 0.4),
        0 0 15px rgba(255, 236, 210, 0.3);
}

.environment.autumn .control-panel.scrollbar-active::-webkit-scrollbar-thumb {
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(210, 153, 194, 0.4),
        0 0 15px rgba(210, 153, 194, 0.3);
}

.environment.winter .control-panel.scrollbar-active::-webkit-scrollbar-thumb {
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(102, 126, 234, 0.4),
        0 0 15px rgba(102, 126, 234, 0.3);
}

/* Scrollbar pulse animation */
@keyframes scrollbarPulse {
    0%, 100% { 
        transform: scaleY(1);
        opacity: 1;
    }
    50% { 
        transform: scaleY(1.1);
        opacity: 0.8;
    }
}

.control-panel::-webkit-scrollbar-thumb:active {
    animation: scrollbarPulse 0.3s ease-in-out;
}

/* Custom scrollbar for different screen sizes */
@media (max-width: 768px) {
    ::-webkit-scrollbar {
        width: 8px;
        height: 8px;
    }
    
    .control-panel::-webkit-scrollbar {
        width: 6px;
    }
    
    .control-panel::-webkit-scrollbar-thumb {
        border-radius: 4px;
        min-height: 15px;
    }
}

@media (max-width: 480px) {
    ::-webkit-scrollbar {
        width: 6px;
        height: 6px;
    }
    
    .control-panel::-webkit-scrollbar {
        width: 4px;
    }
    
    .control-panel::-webkit-scrollbar-thumb {
        border-radius: 3px;
        min-height: 12px;
        border: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .control-panel {
        background: rgba(0, 0, 0, 0.8);
        border: 2px solid white;
    }
    
    .season-btn,
    .weather-btn,
    .toggle-btn {
        border: 2px solid rgba(255, 255, 255, 0.5);
    }
    
    ::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.8);
        border: 2px solid rgba(255, 255, 255, 1);
    }
}