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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: linear-gradient(135deg, #2a2a2a 0%, #f0f0f0 100%);
    color: #ffffff;
    overflow: hidden;
    height: 100vh;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Top Navigation */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(42, 42, 42, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
}

.top-nav h1 {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ff3366;
}

.nav-section {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-btn {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

/* Main Content */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* 3D Scene Container */
#scene-container {
    flex: 1;
    position: relative;
    background: transparent;
    min-height: 0;
}

#scene-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* Control Panel */
.control-panel {
    width: 300px;
    background: rgba(42, 42, 42, 0.9);
    backdrop-filter: blur(10px);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.control-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #ff3366;
    border-bottom: 1px solid rgba(255, 51, 102, 0.3);
    padding-bottom: 0.5rem;
}

.control-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

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

.control-item input[type="range"] {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    -webkit-appearance: none;
}

.control-item input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ff3366;
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.control-item input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ff3366;
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.control-item .value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: #ff3366;
    text-align: right;
}

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

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

.play-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff3366, #ff1744);
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 51, 102, 0.4);
}

.control-btn {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.control-btn.active {
    background: #ff3366;
    color: #ffffff;
}

/* Shape Presets */
.shape-presets {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.preset-btn {
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.preset-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.preset-btn.active {
    background: #ff3366;
    color: #ffffff;
}

/* Timeline */
.timeline {
    background: rgba(42, 42, 42, 0.9);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.timeline-track {
    flex: 1;
    position: relative;
}

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

.timeline-track input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ff3366;
    cursor: pointer;
    border: 3px solid #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.timeline-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.time-display {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    color: #cccccc;
    min-width: 80px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .control-panel {
        width: 100%;
        max-height: 300px;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .top-nav {
        padding: 0.5rem 1rem;
    }
    
    .nav-section {
        gap: 0.5rem;
    }
    
    .nav-btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
    }
    
    .timeline {
        padding: 0.5rem 1rem;
    }
}

/* Scrollbar Styling */
.control-panel::-webkit-scrollbar {
    width: 6px;
}

.control-panel::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.control-panel::-webkit-scrollbar-thumb {
    background: #ff3366;
    border-radius: 3px;
}

.control-panel::-webkit-scrollbar-thumb:hover {
    background: #ff1744;
}

/* Animation effects */
@keyframes glow {
    0% { box-shadow: 0 0 5px rgba(255, 51, 102, 0.3); }
    50% { box-shadow: 0 0 20px rgba(255, 51, 102, 0.6); }
    100% { box-shadow: 0 0 5px rgba(255, 51, 102, 0.3); }
}

.play-btn {
    animation: glow 2s infinite ease-in-out;
}

/* Loading fallback */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: #2a2a2a;
    color: white;
    font-family: Arial, sans-serif;
}

.error-message {
    text-align: center;
    max-width: 500px;
    padding: 2rem;
}