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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    overflow-x: hidden;
    min-height: 100vh;
}

.header {
    text-align: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.8;
    font-style: italic;
}

.controls-panel {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.control-group label {
    font-weight: 600;
    white-space: nowrap;
}

input[type="range"] {
    width: 120px;
    accent-color: #667eea;
}

button {
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

button:active {
    transform: translateY(0);
}

.layer-toggle {
    font-size: 0.9rem;
    padding: 6px 12px;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.layer-toggle.active {
    opacity: 1;
    background: linear-gradient(45deg, #38a169, #48bb78);
}

.canvas-container {
    position: relative;
    margin: 0 auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    overflow: hidden;
}

#canvas {
    display: block;
    background: #000;
    cursor: grab;
}

#canvas:active {
    cursor: grabbing;
}

.scroll-indicator {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 20px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
}

.scroll-bar {
    width: 200px;
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    position: relative;
}

.scroll-thumb {
    position: absolute;
    left: 0;
    top: 0;
    width: 20px;
    height: 6px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-radius: 3px;
    transition: left 0.1s ease;
}

#scrollPosition {
    font-size: 0.9rem;
    white-space: nowrap;
}

.info-panel {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    max-width: 300px;
    z-index: 1000;
}

.info-toggle {
    width: 100%;
    margin-bottom: 15px;
}

.info-content {
    display: none;
}

.info-content h3 {
    margin: 15px 0 10px 0;
    color: #667eea;
    font-size: 1.1rem;
}

.info-content p {
    margin-bottom: 10px;
    line-height: 1.4;
    font-size: 0.9rem;
}

.info-content code {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

.scene-presets {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    flex-wrap: wrap;
}

.preset-btn {
    padding: 10px 20px;
    font-size: 0.9rem;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.1);
    opacity: 0.7;
    transition: all 0.3s ease;
}

.preset-btn.active {
    opacity: 1;
    background: linear-gradient(45deg, #667eea, #764ba2);
    transform: scale(1.05);
}

footer {
    text-align: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    margin-top: auto;
}

footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

footer a:hover {
    text-decoration: underline;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .controls-panel {
        flex-direction: column;
        align-items: center;
    }
    
    .control-group {
        justify-content: center;
    }
    
    .info-panel {
        position: static;
        transform: none;
        margin: 20px;
        max-width: none;
    }
    
    .scene-presets {
        gap: 10px;
    }
    
    .preset-btn {
        padding: 8px 16px;
        font-size: 0.8rem;
    }
    
    .scroll-indicator {
        flex-direction: column;
        gap: 10px;
    }
    
    .scroll-bar {
        width: 150px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5rem;
    }
    
    .controls-panel {
        padding: 15px;
        gap: 15px;
    }
    
    .control-group {
        flex-direction: column;
        text-align: center;
    }
    
    input[type="range"] {
        width: 100px;
    }
    
    button {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

/* Animation for layer speed indicators */
#layerSpeeds p {
    transition: color 0.3s ease;
}

#layerSpeeds p:hover {
    color: #667eea;
}

/* Smooth transitions */
* {
    transition: opacity 0.3s ease;
}

/* Performance optimizations */
.canvas-container {
    will-change: transform;
}

#canvas {
    will-change: contents;
}