/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #0a0f1c 0%, #1a1f2c 100%);
    color: #e2e8f0;
    overflow: hidden;
}

/* Header */
#header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(10, 15, 28, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 600;
    background: linear-gradient(45deg, #3b82f6, #06b6d4);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.wave-icon {
    font-size: 1.5rem;
    animation: wave 2s ease-in-out infinite;
}

@keyframes wave {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(10deg); }
}

.header-controls {
    display: flex;
    gap: 10px;
}

/* Scene container */
#scene-container {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

/* Control Panel */
#control-panel {
    position: fixed;
    top: 60px;
    right: 0;
    width: 320px;
    height: calc(100vh - 60px);
    background: rgba(26, 31, 44, 0.95);
    backdrop-filter: blur(20px);
    border-left: 1px solid rgba(59, 130, 246, 0.2);
    z-index: 50;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

#control-panel.collapsed {
    transform: translateX(280px);
}

.panel-toggle {
    position: absolute;
    left: -40px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 60px;
    background: rgba(26, 31, 44, 0.9);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-right: none;
    border-radius: 8px 0 0 8px;
    color: #e2e8f0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.panel-toggle:hover {
    background: rgba(59, 130, 246, 0.2);
}

.panel-content {
    padding: 20px;
}

.section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(59, 130, 246, 0.1);
}

.section:last-child {
    border-bottom: none;
}

.section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #3b82f6;
}

.control-group {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #cbd5e1;
}

.control-group input[type="range"] {
    width: 100%;
    height: 6px;
    background: rgba(100, 116, 139, 0.3);
    border-radius: 3px;
    outline: none;
    appearance: none;
    cursor: pointer;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    background: linear-gradient(45deg, #3b82f6, #06b6d4);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
    transition: transform 0.2s ease;
}

.control-group input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: linear-gradient(45deg, #3b82f6, #06b6d4);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.control-group .value {
    font-size: 0.8rem;
    color: #3b82f6;
    font-weight: 500;
    text-align: right;
}

.control-group select {
    width: 100%;
    padding: 8px 12px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 6px;
    color: #e2e8f0;
    outline: none;
    transition: all 0.3s ease;
}

.control-group select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.control-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #3b82f6;
}

/* Buttons */
.btn {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #e2e8f0;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.btn:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.btn:active {
    transform: translateY(0);
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-zone:hover {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.05);
}

.upload-zone p {
    margin-bottom: 10px;
    color: #94a3b8;
    font-size: 0.9rem;
}

/* Performance Monitor */
.performance-monitor {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(26, 31, 44, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.8rem;
    z-index: 50;
    display: flex;
    gap: 20px;
}

.performance-monitor div {
    color: #cbd5e1;
}

.performance-monitor span {
    color: #3b82f6;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    #control-panel {
        width: 100%;
        transform: translateY(100%);
    }
    
    #control-panel.collapsed {
        transform: translateY(calc(100% - 60px));
    }
    
    .panel-toggle {
        left: 50%;
        top: -40px;
        transform: translateX(-50%);
        width: 60px;
        height: 40px;
        border-radius: 8px 8px 0 0;
        border-bottom: none;
    }
    
    .header-controls {
        display: none;
    }
    
    .logo h1 {
        font-size: 1.2rem;
    }
    
    .performance-monitor {
        bottom: 10px;
        left: 10px;
        padding: 8px 12px;
        gap: 15px;
    }
}

/* Scrollbar styling */
#control-panel::-webkit-scrollbar {
    width: 6px;
}

#control-panel::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
}

#control-panel::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.3);
    border-radius: 3px;
}

#control-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.5);
}

/* Loading animation */
@keyframes pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

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

/* Enhanced interaction feedback */
.control-group input[type="range"]:active::-webkit-slider-thumb {
    transform: scale(1.2);
}

.section {
    transition: all 0.3s ease;
}

.section:hover {
    background: rgba(59, 130, 246, 0.02);
    padding: 20px;
    margin: -5px -20px 25px -20px;
    border-radius: 8px;
}