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

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

#app {
    width: 100vw;
    height: 100vh;
    display: flex;
    position: relative;
}

#viewport {
    flex: 1;
    position: relative;
    margin-left: 200px;
    transition: margin-left 0.3s ease;
}

#canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.controls-panel {
    width: 200px;
    background-color: #2a2a2a;
    border-right: 1px solid #444;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    order: -1;
    transform: translateX(0);
    transition: transform 0.3s ease;
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.35);
}

.controls-panel.collapsed {
    transform: translateX(-100%);
    box-shadow: none;
}

.controls-content {
    padding: 20px;
    height: calc(100vh - 40px);
    overflow-y: auto;
}

.control-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #444;
}

.control-section:last-child {
    border-bottom: none;
}

.control-section h3 {
    margin-bottom: 15px;
    color: #00ff88;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.control-section label {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    color: #ccc;
}

.control-section input,
.control-section select,
.control-section button {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    background-color: #3a3a3a;
    border: 1px solid #555;
    color: #ffffff;
    border-radius: 4px;
    font-size: 12px;
}

.control-section input:focus,
.control-section select:focus,
.control-section button:focus {
    outline: none;
    border-color: #00ff88;
}

.control-section button {
    cursor: pointer;
    transition: background-color 0.2s;
}

.control-section button:hover {
    background-color: #4a4a4a;
}

.control-section button:active {
    background-color: #00ff88;
    color: #000;
}

.play-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    margin-top: 10px;
}

.play-controls button:first-child {
    grid-column: 1 / -1;
}

.pattern-btn {
    margin-bottom: 5px !important;
    padding: 6px !important;
    font-size: 11px !important;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: #555;
    border: none !important;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #00ff88;
    cursor: pointer;
    border-radius: 50%;
}

input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #00ff88;
    cursor: pointer;
    border-radius: 50%;
    border: none;
}

input[type="color"] {
    height: 30px;
    border: none !important;
    cursor: pointer;
}

input[type="checkbox"] {
    width: auto !important;
    margin-right: 8px !important;
    margin-bottom: 0 !important;
}

.camera-help {
    margin-top: 10px;
    padding: 10px;
    background-color: #1a1a1a;
    border-radius: 4px;
    line-height: 1.4;
}

.status-bar {
    position: absolute;
    bottom: 0;
    left: 200px;
    right: 0;
    height: 40px;
    background-color: #2a2a2a;
    border-top: 1px solid #444;
    display: flex;
    align-items: center;
    padding: 0 20px;
    font-size: 12px;
    z-index: 50;
    transition: left 0.3s ease;
}

.status-bar span {
    margin-right: 20px;
    color: #ccc;
}

.status-bar span:last-child {
    margin-right: 0;
}

.controls-toggle {
    position: fixed;
    top: 20px;
    left: 210px;
    z-index: 150;
    background-color: #00ff88;
    color: #000;
    border: none;
    border-radius: 0 4px 4px 0;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    transition: left 0.3s ease, background-color 0.2s ease, color 0.2s ease;
}

.controls-toggle:hover {
    background-color: #33ffaa;
}

.controls-toggle:active {
    background-color: #ffffff;
}

body.controls-collapsed #viewport {
    margin-left: 0;
}

body.controls-collapsed .status-bar {
    left: 0;
}

body.controls-collapsed .controls-toggle {
    left: 20px;
    border-radius: 4px;
    background-color: #2a2a2a;
    color: #00ff88;
    border: 1px solid #00ff88;
}

@media (max-width: 768px) {
    .controls-panel {
        width: 200px;
    }

    #viewport {
        margin-left: 200px;
    }

    .status-bar {
        left: 200px;
    }
}
