* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #0f0f1a;
    color: #e0e0e0;
    overflow: hidden;
}

#app {
    display: flex;
    height: 100vh;
}

#sidebar {
    width: 320px;
    min-width: 320px;
    flex-shrink: 0;
    background: #1a1a2e;
    padding: 20px;
    overflow-y: auto;
    border-right: 1px solid #2d2d44;
    display: flex;
    flex-direction: column;
}

#sidebar h1 {
    font-size: 1.5rem;
    margin-bottom: 4px;
    color: #fff;
}

.subtitle {
    color: #888;
    font-size: 0.85rem;
    margin-bottom: 20px;
}

.site-logo {
    display: inline-block;
    margin-bottom: 12px;
}

.site-logo img {
    height: 24px;
    width: auto;
}

.drop-zone {
    border: 2px dashed #4a4a6a;
    border-radius: 12px;
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
    position: relative;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}

.drop-zone-content {
    pointer-events: none;
}

.drop-zone svg {
    color: #f59e0b;
    margin-bottom: 10px;
}

.drop-zone p {
    margin-bottom: 4px;
    font-size: 0.9rem;
}

.drop-zone .hint {
    font-size: 0.8rem;
    color: #666;
}

.drop-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.file-list {
    margin-bottom: 20px;
}

.file-list h3 {
    font-size: 0.85rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.file-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.85rem;
    border-bottom: 1px solid #2d2d44;
}

.file-label {
    color: #666;
}

.file-name {
    color: #fff;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.anim-panel {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.anim-panel h3 {
    font-size: 0.85rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
}

.anim-panel h3 span {
    font-size: 0.75rem;
    color: #666;
}

#anim-items {
    list-style: none;
    overflow-y: auto;
    max-height: 250px;
    background: #252540;
    border-radius: 8px;
}

#anim-items li {
    padding: 8px 12px;
    font-size: 0.8rem;
    cursor: pointer;
    border-bottom: 1px solid #2d2d44;
    transition: background 0.2s;
}

#anim-items li:last-child {
    border-bottom: none;
}

#anim-items li:hover {
    background: #2d2d50;
}

#anim-items li.active {
    background: #f59e0b;
    color: #000;
}

#controls h3 {
    font-size: 0.85rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    margin-top: 16px;
}

#controls h3:first-child {
    margin-top: 0;
}

.current-anim {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 10px;
}

.current-anim span {
    color: #f59e0b;
    font-weight: 500;
}

.playback-controls {
    margin-bottom: 12px;
}

.control-group {
    margin-bottom: 12px;
}

.control-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    cursor: pointer;
}

.control-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #f59e0b;
}

.control-group input[type="color"] {
    width: 100%;
    height: 32px;
    border: 1px solid #3d3d5c;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 4px;
    background: #252540;
    padding: 4px;
}

.control-group input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.control-group input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

.control-group input[type="range"] {
    width: calc(100% - 40px);
    margin-top: 4px;
    accent-color: #f59e0b;
}

.control-group span {
    font-size: 0.75rem;
    color: #888;
}

.btn {
    width: 100%;
    padding: 10px 16px;
    background: #f59e0b;
    color: #000;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn:hover {
    background: #d97706;
}

.btn.secondary {
    background: #3d3d5c;
    color: #fff;
    margin-top: 8px;
}

.btn.secondary:hover {
    background: #4d4d6c;
}

#viewport {
    flex: 1;
    position: relative;
    background: #1a1a2e;
}

#canvas {
    width: 100%;
    height: 100%;
    display: block;
}

#loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 15, 26, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #2d2d44;
    border-top-color: #f59e0b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#stats {
    position: absolute;
    bottom: 16px;
    left: 16px;
    display: flex;
    gap: 16px;
    font-size: 0.8rem;
    color: #888;
    background: rgba(26, 26, 46, 0.9);
    padding: 8px 12px;
    border-radius: 6px;
}

.credits {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid #2d2d44;
    font-size: 0.75rem;
    color: #666;
    text-align: center;
}

.credits a {
    color: #888;
    text-decoration: none;
}

.credits a:hover {
    color: #f59e0b;
}

.credits a.author {
    color: #f59e0b;
    font-weight: 500;
}

#sidebar::-webkit-scrollbar {
    width: 8px;
}

#sidebar::-webkit-scrollbar-track {
    background: #1a1a2e;
}

#sidebar::-webkit-scrollbar-thumb {
    background: #3d3d5c;
    border-radius: 4px;
}

#anim-items::-webkit-scrollbar {
    width: 6px;
}

#anim-items::-webkit-scrollbar-thumb {
    background: #4d4d6c;
    border-radius: 3px;
}

/* Responsive - Tablet */
@media (max-width: 900px) {
    body {
        overflow: auto;
    }

    #app {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    #sidebar {
        width: 100%;
        min-width: auto;
        border-right: none;
        border-bottom: 1px solid #2d2d44;
        padding: 16px;
    }

    #sidebar h1 {
        font-size: 1.25rem;
    }

    #anim-items {
        max-height: 180px;
    }

    #viewport {
        min-height: 50vh;
        height: 50vh;
    }

    .credits {
        display: none;
    }
}

/* Responsive - Mobile */
@media (max-width: 640px) {
    #sidebar {
        padding: 12px;
    }

    #sidebar h1 {
        font-size: 1.1rem;
    }

    .subtitle {
        font-size: 0.8rem;
        margin-bottom: 12px;
    }

    .drop-zone {
        padding: 20px 16px;
        margin-bottom: 12px;
    }

    .drop-zone svg {
        width: 36px;
        height: 36px;
    }

    .file-item {
        padding: 8px 0;
        font-size: 0.8rem;
    }

    .file-name {
        max-width: none;
        flex: 1;
    }

    .anim-panel h3 {
        font-size: 0.8rem;
    }

    #anim-items {
        max-height: 150px;
    }

    #anim-items li {
        padding: 12px;
        font-size: 0.8rem;
    }

    #controls h3 {
        font-size: 0.8rem;
    }

    .control-group label {
        font-size: 0.8rem;
    }

    .control-group input[type="checkbox"] {
        width: 20px;
        height: 20px;
    }

    .control-group input[type="range"] {
        width: calc(100% - 50px);
    }

    .control-group input[type="color"] {
        height: 40px;
    }

    .btn {
        padding: 14px 16px;
        font-size: 0.85rem;
    }

    #viewport {
        min-height: 45vh;
        height: 45vh;
    }

    #stats {
        bottom: 12px;
        left: 12px;
        font-size: 0.7rem;
        padding: 6px 10px;
        gap: 12px;
    }
}

/* Very small phones */
@media (max-width: 380px) {
    #sidebar {
        padding: 10px;
    }

    .site-logo img {
        height: 20px;
    }

    .drop-zone {
        padding: 16px 12px;
    }

    #anim-items {
        max-height: 120px;
    }

    #anim-items li {
        padding: 10px;
    }

    .control-group span {
        font-size: 0.7rem;
    }
}
