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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #87CEEB 0%, #98FB98 100%);
    color: #333;
    overflow: hidden;
}

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

/* Toolbar */
#toolbar {
    height: 60px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

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

.control-btn {
    background: #4A90E2;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: #357ABD;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(74, 144, 226, 0.3);
}

#timeScale {
    width: 100px;
}

#speedValue {
    font-weight: bold;
    color: #4A90E2;
    min-width: 30px;
}

/* Main Content */
#mainContent {
    flex: 1;
    display: flex;
    position: relative;
}

/* Left Sidebar */
#leftSidebar {
    width: 250px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px;
    overflow-y: auto;
    border-right: 2px solid #E0E0E0;
}

.sidebar-header h3 {
    color: #4A90E2;
    margin-bottom: 15px;
    font-size: 18px;
}

#searchAssets {
    width: 100%;
    padding: 10px;
    border: 2px solid #E0E0E0;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
}

.asset-category {
    margin-bottom: 25px;
}

.category-header {
    background: #6ABF4B;
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 14px;
    cursor: pointer;
}

.asset-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.asset-item {
    background: white;
    border: 2px solid #E0E0E0;
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.asset-item:hover {
    border-color: #4A90E2;
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.2);
}

.asset-item img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    margin-bottom: 5px;
}

.asset-item span {
    font-size: 12px;
    font-weight: bold;
    color: #666;
    display: block;
}

/* Viewport */
#viewport {
    flex: 1;
    position: relative;
    background: linear-gradient(to bottom, #87CEEB 0%, #98FB98 100%);
}

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

#physics-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px;
    border-radius: 8px;
}

.hidden {
    display: none;
}

/* Right Panel */
#rightPanel {
    width: 300px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-left: 2px solid #E0E0E0;
    transition: transform 0.3s ease;
}

#rightPanel.collapsed {
    transform: translateX(100%);
}

.panel-header {
    background: #4A90E2;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h3 {
    font-size: 16px;
}

.panel-header button {
    background: transparent;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
}

.panel-content {
    padding: 20px;
    overflow-y: auto;
    height: calc(100% - 60px);
}

.property-group {
    margin-bottom: 25px;
}

.property-group h4 {
    color: #4A90E2;
    margin-bottom: 15px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.property-group label {
    display: block;
    margin-bottom: 10px;
    font-size: 14px;
    color: #666;
}

.property-group input[type="range"] {
    width: 100%;
    margin-left: 10px;
}

.property-group input[type="color"] {
    width: 50px;
    height: 30px;
    border: none;
    border-radius: 5px;
    margin-left: 10px;
}

/* Bottom Panel */
#bottomPanel {
    height: 200px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-top: 2px solid #E0E0E0;
    transition: transform 0.3s ease;
}

#bottomPanel.collapsed {
    transform: translateY(calc(100% - 50px));
}

#bottomPanel .panel-header {
    height: 50px;
    padding: 10px 20px;
}

#bottomPanel .panel-content {
    height: calc(100% - 50px);
    padding: 15px;
}

.timeline-container {
    display: flex;
    height: 100%;
    gap: 15px;
}

.event-library, .action-library {
    width: 150px;
    background: #F8F9FA;
    border-radius: 10px;
    padding: 15px;
}

.event-library h4, .action-library h4 {
    color: #4A90E2;
    margin-bottom: 10px;
    font-size: 14px;
}

.timeline {
    flex: 1;
    background: #F8F9FA;
    border-radius: 10px;
    padding: 15px;
}

.timeline-track {
    height: 50px;
    background: white;
    border-radius: 8px;
    margin-bottom: 10px;
    padding: 10px;
    border: 2px dashed #E0E0E0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.timeline-track h4 {
    margin: 0;
    font-size: 12px;
    color: #666;
    min-width: 80px;
}

.node-item {
    background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    margin-bottom: 8px;
    text-align: center;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.3s ease;
    user-select: none;
}

.node-item:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

.event-node {
    background: linear-gradient(135deg, #6ABF4B 0%, #5AA83A 100%);
}

.action-node {
    background: linear-gradient(135deg, #F5D76E 0%, #E6C85D 100%);
    color: #333;
}

.timeline-node {
    height: 30px;
    padding: 5px 10px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    min-width: 80px;
}

.event-timeline-node {
    background: #6ABF4B;
    color: white;
}

.action-timeline-node {
    background: #F5D76E;
    color: #333;
}

/* Responsive Design */
@media (max-width: 1200px) {
    #leftSidebar {
        width: 200px;
    }
    
    #rightPanel {
        width: 250px;
    }
    
    .asset-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    #toolbar {
        flex-direction: column;
        height: auto;
        padding: 10px;
    }
    
    .toolbar-section {
        margin-bottom: 5px;
    }
    
    #leftSidebar {
        width: 150px;
    }
    
    #rightPanel {
        width: 200px;
    }
    
    #bottomPanel {
        height: 150px;
    }
    
    .timeline-container {
        flex-direction: column;
    }
    
    .event-library, .action-library {
        width: 100%;
        height: 60px;
    }
}

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

::-webkit-scrollbar-track {
    background: #F0F0F0;
    border-radius: 4px;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #357ABD;
}