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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #1a1a2e;
    color: white;
    overflow: hidden;
}

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

/* Header */
.header {
    background: linear-gradient(135deg, #16213e, #1a1a2e);
    padding: 0 1rem;
    height: 60px;
    display: flex;
    align-items: center;
    border-bottom: 2px solid #0f4c75;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.logo h1 {
    color: #4fc3f7;
    font-size: 1.5rem;
    margin-right: 2rem;
}

.nav {
    display: flex;
    gap: 1rem;
    flex: 1;
}

.nav-btn {
    background: transparent;
    border: 2px solid #0f4c75;
    color: white;
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: #0f4c75;
    transform: translateY(-2px);
}

.nav-btn.active {
    background: #4fc3f7;
    border-color: #4fc3f7;
    color: #1a1a2e;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255,107,107,0.3);
}

.user-profile {
    background: #0f4c75;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    color: #4fc3f7;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    height: calc(100vh - 120px);
}

/* Sidebars */
.left-sidebar, .right-sidebar {
    width: 280px;
    background: linear-gradient(180deg, #16213e, #1a1a2e);
    padding: 1rem;
    overflow-y: auto;
    border-right: 1px solid #0f4c75;
}

.right-sidebar {
    border-right: none;
    border-left: 1px solid #0f4c75;
}

.panel {
    background: rgba(15, 76, 117, 0.2);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(79, 195, 247, 0.3);
    backdrop-filter: blur(10px);
}

.panel h3 {
    color: #4fc3f7;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

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

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

.slider {
    width: 100%;
    margin-bottom: 0.5rem;
    appearance: none;
    height: 6px;
    background: #0f4c75;
    border-radius: 3px;
    outline: none;
}

.slider::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    background: #4fc3f7;
    border-radius: 50%;
    cursor: pointer;
}

.slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #4fc3f7;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* Button Grids */
.texture-grid, .tree-grid, .structure-grid, .particle-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.texture-btn, .tree-btn, .structure-btn, .particle-btn {
    background: rgba(79, 195, 247, 0.1);
    border: 2px solid rgba(79, 195, 247, 0.3);
    color: white;
    padding: 0.7rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8rem;
}

.texture-btn:hover, .tree-btn:hover, .structure-btn:hover, .particle-btn:hover {
    background: rgba(79, 195, 247, 0.2);
    transform: translateY(-2px);
}

.texture-btn.active, .tree-btn.active, .structure-btn.active {
    background: #4fc3f7;
    color: #1a1a2e;
}

/* Color Controls */
.color-controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.color-controls label {
    font-size: 0.8rem;
    margin-bottom: 0.2rem;
}

.color-controls input[type="color"] {
    width: 100%;
    height: 40px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

/* Animation Toggles */
.animation-toggles {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
}

.toggle input[type="checkbox"] {
    margin-right: 0.5rem;
    transform: scale(1.2);
}

/* Viewport */
.viewport {
    flex: 1;
    position: relative;
    background: #0a0a0a;
}

#scene-container {
    width: 100%;
    height: 100%;
}

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

/* Camera Controls */
.camera-controls {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
}

.camera-btn {
    background: rgba(15, 76, 117, 0.8);
    border: 1px solid #4fc3f7;
    color: white;
    padding: 0.5rem;
    border-radius: 5px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.camera-btn:hover {
    background: rgba(79, 195, 247, 0.3);
}

/* Mode Indicator */
.mode-indicator {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    background: rgba(15, 76, 117, 0.8);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid #4fc3f7;
    backdrop-filter: blur(10px);
}

/* Timeline */
.timeline {
    height: 60px;
    background: linear-gradient(135deg, #16213e, #1a1a2e);
    border-top: 2px solid #0f4c75;
    display: flex;
    align-items: center;
    padding: 0 2rem;
}

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

.play-btn {
    background: #4fc3f7;
    border: none;
    color: #1a1a2e;
    padding: 0.5rem 1rem;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.play-btn:hover {
    transform: scale(1.1);
}

.timeline-slider {
    flex: 1;
    height: 8px;
    background: #0f4c75;
    border-radius: 4px;
    outline: none;
    appearance: none;
}

.timeline-slider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    background: #4fc3f7;
    border-radius: 50%;
    cursor: pointer;
}

.time-display {
    color: #b3b3b3;
    font-size: 0.9rem;
    min-width: 100px;
}

/* Generation Buttons */
.generate-btn, .evolve-btn, .reset-btn {
    width: 100%;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #10ac84, #00d2d3);
}

.reset-btn {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
}

.evolve-btn {
    background: linear-gradient(135deg, #feca57, #ff9ff3);
}

/* Export Buttons */
.screenshot-btn, .record-btn {
    width: 100%;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #5f27cd, #00d2d3);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .left-sidebar, .right-sidebar {
        width: 240px;
    }
}

@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .left-sidebar, .right-sidebar {
        width: 100%;
        height: 200px;
        overflow-x: auto;
    }
    
    .panel {
        display: inline-block;
        width: 250px;
        margin-right: 1rem;
    }
    
    .nav {
        flex-wrap: wrap;
    }
    
    .header {
        height: auto;
        padding: 1rem;
    }
    
    .header-right {
        margin-top: 1rem;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1a1a2e;
}

::-webkit-scrollbar-thumb {
    background: #4fc3f7;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #0f4c75;
}

/* Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.panel {
    animation: fadeIn 0.3s ease;
}