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

html, body {
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0a0a12;
    color: #fff;
}

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

/* Header */
#top-bar {
    height: 56px;
    background: linear-gradient(180deg, #1a1a2e 0%, #16162a 100%);
    border-bottom: 1px solid #2a2a4a;
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 20px;
    flex-shrink: 0;
}

.logo {
    font-weight: 700;
    font-size: 18px;
    color: #4fc3f7;
    letter-spacing: -0.5px;
}

.search-box {
    flex: 1;
    max-width: 300px;
}

.search-box input {
    width: 100%;
    padding: 8px 14px;
    border: 1px solid #333;
    border-radius: 6px;
    background: #0a0a12;
    color: #fff;
    font-size: 13px;
}

.search-box input:focus {
    outline: none;
    border-color: #4fc3f7;
}

.filter-box select {
    padding: 8px 12px;
    border: 1px solid #333;
    border-radius: 6px;
    background: #0a0a12;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
}

/* Main content */
#main-content {
    display: flex;
    flex: 1;
    min-height: 0;
}

/* Sidebar */
#sidebar {
    width: 260px;
    background: #12121f;
    border-right: 1px solid #2a2a4a;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 16px 16px 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #666;
    border-bottom: 1px solid #2a2a4a;
}

#model-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.category-section {
    margin-bottom: 4px;
}

.category-header {
    padding: 10px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #4fc3f7;
    cursor: pointer;
    user-select: none;
}

.category-header:hover {
    background: rgba(79, 195, 247, 0.05);
}

.category-items {
    padding: 0 8px;
}

.category-section.collapsed .category-items {
    display: none;
}

.model-item {
    padding: 8px 12px;
    font-size: 13px;
    color: #ccc;
    cursor: pointer;
    border-radius: 4px;
    margin: 2px 0;
}

.model-item:hover {
    background: rgba(79, 195, 247, 0.1);
    color: #fff;
}

.model-item.selected {
    background: rgba(79, 195, 247, 0.2);
    color: #4fc3f7;
}

/* 3D Viewer */
#viewer-container {
    flex: 1;
    position: relative;
    background: #0a0a12;
}

#webgl-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Footer */
#info-bar {
    height: 60px;
    background: linear-gradient(0deg, #1a1a2e 0%, #16162a 100%);
    border-top: 1px solid #2a2a4a;
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 24px;
    flex-shrink: 0;
}

.model-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

#model-name {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
}

#model-category {
    font-size: 11px;
    color: #666;
}

.stats {
    flex: 1;
    text-align: center;
    font-size: 12px;
    color: #888;
    font-family: monospace;
}

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

.controls button {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

#play-btn {
    background: #4fc3f7;
    color: #0a0a12;
}

#play-btn:hover {
    background: #29b6f6;
}

#pause-btn {
    background: #333;
    color: #fff;
}

#pause-btn:hover {
    background: #444;
}

.controls label {
    font-size: 12px;
    color: #888;
    display: flex;
    align-items: center;
    gap: 6px;
}

.controls input[type="range"] {
    width: 80px;
    accent-color: #4fc3f7;
}

/* Scrollbar */
#model-list::-webkit-scrollbar {
    width: 6px;
}

#model-list::-webkit-scrollbar-track {
    background: transparent;
}

#model-list::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}

#model-list::-webkit-scrollbar-thumb:hover {
    background: #444;
}
