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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow: hidden;
}

#scene-container {
    width: 100vw;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
}

/* Header */
.header-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7), transparent);
    z-index: 100;
    pointer-events: none;
}

.header-overlay > * {
    pointer-events: auto;
}

.info-btn {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s;
}

.info-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.05);
}

/* Info Panel */
.info-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.9);
    backdrop-filter: blur(10px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.info-content {
    background: rgba(20,20,20,0.95);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 1rem;
    padding: 2rem;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s;
}

.close-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: rotate(90deg);
}

.formula-box {
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 0.5rem;
    padding: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: #60a5fa;
    overflow-x: auto;
}

/* Control Panel */
.control-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255,255,255,0.1);
    z-index: 100;
    padding: 1rem;
}

.toggle-btn {
    width: 100%;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
    margin-bottom: 1rem;
}

.toggle-btn:hover {
    background: rgba(255,255,255,0.15);
}

.controls-content {
    max-height: 60vh;
    overflow-y: auto;
}

.controls-content.hidden {
    display: none;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.tab-btn {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.6);
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.tab-btn:hover {
    color: rgba(255,255,255,0.8);
}

.tab-btn.active {
    color: white;
    border-bottom-color: #60a5fa;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Control Groups */
.control-group {
    margin-bottom: 1rem;
}

.control-group label {
    display: block;
    color: #d1d5db;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.value {
    color: #60a5fa;
    font-family: 'Courier New', monospace;
    float: right;
    font-size: 0.75rem;
}

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

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(102,126,234,0.5);
}

input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    border-radius: 50%;
    border: none;
    box-shadow: 0 0 10px rgba(102,126,234,0.5);
}

.select-input {
    width: 100%;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 0.5rem;
    border-radius: 0.375rem;
    outline: none;
    cursor: pointer;
}

.select-input:focus {
    border-color: #60a5fa;
}

input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
}

/* Presets */
.presets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.preset-btn {
    background: linear-gradient(135deg, rgba(102,126,234,0.3), rgba(118,75,162,0.3));
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.preset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102,126,234,0.4);
}

.preset-btn.calm {
    background: linear-gradient(135deg, rgba(96,165,250,0.3), rgba(59,130,246,0.3));
}

.preset-btn.energy {
    background: linear-gradient(135deg, rgba(239,68,68,0.3), rgba(220,38,38,0.3));
}

.preset-btn.meditation {
    background: linear-gradient(135deg, rgba(52,211,153,0.3), rgba(16,185,129,0.3));
}

.preset-btn.cosmic {
    background: linear-gradient(135deg, rgba(168,85,247,0.3), rgba(147,51,234,0.3));
}

.preset-btn.randomize {
    background: linear-gradient(135deg, rgba(251,191,36,0.3), rgba(245,158,11,0.3));
}

.preset-btn.reset {
    background: linear-gradient(135deg, rgba(156,163,175,0.3), rgba(107,114,128,0.3));
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.action-btn {
    flex: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 0.875rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102,126,234,0.4);
}

/* Notification */
.notification {
    position: fixed;
    top: 5rem;
    right: 2rem;
    background: rgba(34,197,94,0.9);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    z-index: 300;
    animation: slideIn 0.3s ease-out;
}

.notification.hidden {
    display: none;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Footer */
.footer-overlay {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.5rem;
    text-align: center;
    color: rgba(255,255,255,0.5);
    font-size: 0.75rem;
    background: linear-gradient(to top, rgba(0,0,0,0.5), transparent);
    z-index: 50;
    pointer-events: none;
}

.footer-overlay a {
    color: #60a5fa;
    text-decoration: none;
    pointer-events: auto;
}

.footer-overlay a:hover {
    color: #93c5fd;
}

/* Responsive */
@media (max-width: 768px) {
    .header-overlay h1 {
        font-size: 1.25rem;
    }
    
    .control-panel {
        max-height: 70vh;
    }
    
    .presets {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tabs {
        font-size: 0.8rem;
    }
    
    .tab-btn {
        padding: 0.5rem 0.75rem;
    }
}

/* Custom scrollbar */
.controls-content::-webkit-scrollbar,
.info-content::-webkit-scrollbar {
    width: 8px;
}

.controls-content::-webkit-scrollbar-track,
.info-content::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
}

.controls-content::-webkit-scrollbar-thumb,
.info-content::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
}

.controls-content::-webkit-scrollbar-thumb:hover,
.info-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.3);
}