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

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

/* Layer Container - positioned behind UI elements */
#layerContainer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1;
    background: transparent;
    overflow: hidden;
}

/* Individual layer styling within the container */
#layerContainer .layer {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    overflow: hidden;
    box-sizing: border-box;
}

/* Ensure layer iframes scale properly */
#layerContainer .layer iframe {
    width: 100% !important;
    height: 100% !important;
    border: none;
    background: transparent;
    display: block;
}

/* Toolbar */
.toolbar {
    height: 40px;
    background-color: #2d2d30;
    border-bottom: 1px solid #3e3e42;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    font-size: 12px;
    position: relative;
    z-index: 1000;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.copyright {
    color: #6a6a6a;
    font-size: 11px;
}

.toolbar-btn {
    background: none;
    border: 1px solid #3e3e42;
    color: #d4d4d4;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s;
}

.toolbar-btn:hover {
    background-color: #3e3e42;
    border-color: #007acc;
}

.toolbar-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.toolbar-btn:disabled:hover {
    background: none;
    border-color: #3e3e42;
}

.toolbar-setting {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #d4d4d4;
    padding: 2px 6px;
    border: 1px solid #3e3e42;
    border-radius: 3px;
    background: rgba(62, 62, 66, 0.3);
}

.toolbar-setting label {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-size: 10px;
}

.toolbar-setting input[type="checkbox"] {
    margin: 0;
    width: 12px;
    height: 12px;
    accent-color: #007acc;
}

.toolbar-setting:hover {
    background: rgba(62, 62, 66, 0.5);
    border-color: #007acc;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
}

.status-indicator.online {
    color: #4caf50;
    background-color: rgba(76, 175, 80, 0.1);
}

.status-indicator.offline {
    color: #f44336;
    background-color: rgba(244, 67, 54, 0.1);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-indicator.online .status-dot {
    background-color: #4caf50;
}

.status-indicator.offline .status-dot {
    background-color: #f44336;
}

.device-id-display {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
    color: #2196F3;
    background-color: rgba(33, 150, 243, 0.1);
    border: 1px solid rgba(33, 150, 243, 0.2);
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.device-id-display:hover {
    background-color: rgba(33, 150, 243, 0.2);
    border-color: rgba(33, 150, 243, 0.4);
}

.device-id-label {
    color: #cccccc;
}

.device-id-value {
    color: #2196F3;
    font-weight: 600;
    letter-spacing: 1px;
}

.fps-counter {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
    color: #4caf50;
    background-color: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.2);
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-weight: 500;
}

.fps-label {
    color: #cccccc;
}

.fps-value {
    color: #4caf50;
    font-weight: 600;
    min-width: 24px;
    text-align: right;
}

.editor-container {
    display: flex;
    height: calc(100vh - 40px);
    position: relative;
    z-index: 100;
}

/* Left Panel - 200px initial width, resizable */
.left-panel {
    width: 200px;
    min-width: 150px;
    max-width: 400px;
    background-color: #1e1e1e;
    border-right: 1px solid #3e3e42;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.left-panel-header {
    padding: 8px 12px;
    background-color: #2d2d30;
    border-bottom: 1px solid #3e3e42;
    font-weight: 600;
    font-size: 11px;
    color: #cccccc;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.left-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
}

.option-item {
    padding: 6px 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
    font-size: 13px;
    position: relative;
    color: #cccccc;
    user-select: none;
}

.option-item:hover {
    background-color: #2a2d2e;
    color: #ffffff;
}

.option-item.active {
    background-color: #094771;
    border-left-color: #007acc;
    color: #ffffff;
}

.option-children {
    display: block;
    margin-left: 0;
    background-color: #1e1e1e;
}

.child-option {
    padding: 4px 12px 4px 20px;
    cursor: pointer;
    transition: all 0.15s ease;
    border-left: 2px solid transparent;
    font-size: 12px;
    color: #cccccc;
    position: relative;
    user-select: none;
}

.child-option:hover {
    background-color: #2a2d2e;
    color: #ffffff;
}

.child-option.active {
    background-color: #094771;
    border-left-color: #007acc;
    color: #ffffff;
}

.grandchild-option {
    padding: 3px 12px 3px 28px;
    cursor: pointer;
    transition: all 0.15s ease;
    border-left: 2px solid transparent;
    font-size: 11px;
    color: #aaaaaa;
    user-select: none;
}

.grandchild-option:hover {
    background-color: #2a2d2e;
    color: #ffffff;
}

.grandchild-option.active {
    background-color: #094771;
    border-left-color: #007acc;
    color: #ffffff;
}

/* Middle Panel - flexible width with CLI at bottom */
.middle-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: transparent;
    min-width: 300px;
}

.middle-content {
    flex: 1;
    background-color: transparent;
    overflow: hidden;
}

.cli-container {
    height: 200px;
    background-color: #0c0c0c;
    border-top: 1px solid #3e3e42;
    display: none; /* Hidden by default */
    flex-direction: column;
    overflow: hidden; /* Prevent container from scrolling */
    flex-shrink: 0; /* Prevent shrinking */
}

.cli-container.visible {
    display: flex;
}

.cli-header {
    padding: 8px 12px;
    background-color: #2d2d30;
    border-bottom: 1px solid #3e3e42;
    font-size: 12px;
    color: #cccccc;
    font-weight: 500;
    flex-shrink: 0; /* Prevent header from shrinking */
}

.cli-terminal {
    flex: 1;
    padding: 12px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    color: #d4d4d4;
    background-color: #0c0c0c;
    overflow-y: auto;
    white-space: pre-wrap;
    min-height: 0; /* Allow flex item to shrink below content size */
}

.cli-input-container {
    flex-shrink: 0; /* Prevent input container from shrinking */
    border-top: 1px solid #3e3e42;
}

.cli-input {
    width: 100%;
    background: transparent;
    border: none;
    color: #d4d4d4;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    padding: 8px 12px;
    outline: none;
}

.cli-input::placeholder {
    color: #6a6a6a;
}

/* CLI message type styling */
.cli-command {
    color: #00ff00;
    font-weight: bold;
}

.cli-error {
    color: #ff4444;
}

.cli-success {
    color: #44ff44;
}

.cli-info {
    color: #4444ff;
}

.cli-warning {
    color: #ffaa00;
}

.cli-json {
    color: #ff88ff;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

/* Console forwarding message types */
.cli-console-log {
    color: #d4d4d4;
    background-color: rgba(100, 149, 237, 0.1);
    border-left: 3px solid #6495ED;
    padding: 4px 8px;
    margin: 2px 0;
    border-radius: 0 3px 3px 0;
}

.cli-console-error {
    color: #ff6b6b;
    background-color: rgba(255, 107, 107, 0.1);
    border-left: 3px solid #ff6b6b;
    padding: 4px 8px;
    margin: 2px 0;
    border-radius: 0 3px 3px 0;
}

.cli-console-warn {
    color: #ffa726;
    background-color: rgba(255, 167, 38, 0.1);
    border-left: 3px solid #ffa726;
    padding: 4px 8px;
    margin: 2px 0;
    border-radius: 0 3px 3px 0;
}

.cli-console-info {
    color: #66bb6a;
    background-color: rgba(102, 187, 106, 0.1);
    border-left: 3px solid #66bb6a;
    padding: 4px 8px;
    margin: 2px 0;
    border-radius: 0 3px 3px 0;
}

.cli-console-debug {
    color: #ab47bc;
    background-color: rgba(171, 71, 188, 0.1);
    border-left: 3px solid #ab47bc;
    padding: 4px 8px;
    margin: 2px 0;
    border-radius: 0 3px 3px 0;
}

/* CLI header styling */
.cli-header-title {
    font-weight: 500;
    color: #cccccc;
}

.cli-header-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cli-header-btn {
    transition: all 0.2s ease;
    font-family: inherit;
}

.cli-header-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    filter: brightness(1.1);
}

.cli-header-select {
    background: #3e3e42;
    color: white;
    border: 1px solid #555;
    border-radius: 3px;
    font-size: 10px;
    font-family: inherit;
    outline: none;
    transition: all 0.2s ease;
}

.cli-header-select:hover {
    border-color: #007acc;
    background: #4a4a4a;
}

.cli-header-select:focus {
    border-color: #007acc;
    box-shadow: 0 0 0 2px rgba(0, 122, 204, 0.2);
}

.cli-header-select option {
    background: #3e3e42;
    color: white;
}

/* Right Panel - 200px initial width, resizable */
.right-panel {
    width: 200px;
    min-width: 150px;
    max-width: 400px;
    background-color: #1e1e1e;
    border-left: 1px solid #3e3e42;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.right-panel-header {
    padding: 8px 12px;
    background-color: #2d2d30;
    border-bottom: 1px solid #3e3e42;
    font-weight: 600;
    font-size: 11px;
    color: #cccccc;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.right-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

/* Resize handles */
.resize-handle {
    width: 4px;
    background-color: #3e3e42;
    cursor: col-resize;
    transition: background-color 0.2s;
    position: relative;
}

.resize-handle:hover {
    background-color: #007acc;
}

.resize-handle::after {
    content: '';
    position: absolute;
    top: 0;
    left: -2px;
    right: -2px;
    bottom: 0;
    background: transparent;
}

/* CLI Resize Handle */
.cli-resize-handle {
    height: 4px;
    background-color: #3e3e42;
    cursor: row-resize;
    transition: background-color 0.2s;
    position: relative;
    flex-shrink: 0;
}

.cli-resize-handle:hover {
    background-color: #007acc;
}

.cli-resize-handle::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: -2px;
    bottom: -2px;
    background: transparent;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #555555;
}

/* Placeholder content */
.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #6a6a6a;
    font-style: italic;
    font-size: 13px;
    text-align: center;
    padding: 20px;
}

/* Command Control Styles */
.command-control {
    margin-bottom: 16px;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
}

.command-control:last-child {
    margin-bottom: 0;
}

.command-title {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.command-description {
    font-size: 12px;
    color: #cccccc;
    margin-bottom: 12px;
    font-style: italic;
}

.command-parameters {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.parameter-control {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.parameter-label {
    font-size: 12px;
    color: #cccccc;
    font-weight: 500;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.parameter-type {
    font-size: 10px;
    color: #888;
    background: #3e3e42;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: auto;
}

.control-input {
    background: #2d2d30;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    color: #d4d4d4;
    padding: 6px 8px;
    font-size: 13px;
    transition: border-color 0.2s ease;
}

.control-input:focus {
    outline: none;
    border-color: #007acc;
    box-shadow: 0 0 0 2px rgba(0, 122, 204, 0.2);
}

.control-input:hover {
    border-color: #5a5a5a;
}

.control-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #3e3e42;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.control-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #353a42;
    cursor: pointer;
    border: 2px solid #1e1e1e;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.control-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #007acc;
    cursor: pointer;
    border: 2px solid #1e1e1e;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.control-slider-value {
    font-size: 11px;
    color: #888;
    text-align: right;
    margin-top: 2px;
}

.control-color {
    width: 100%;
    height: 32px;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    background: none;
    cursor: pointer;
    padding: 0;
}

.control-color::-webkit-color-swatch-wrapper {
    padding: 0;
}

.control-color::-webkit-color-swatch {
    border: none;
    border-radius: 3px;
}

.control-select {
    background: #2d2d30;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    color: #d4d4d4;
    padding: 6px 8px;
    font-size: 13px;
    cursor: pointer;
    width: 100%;
}

.control-select:focus {
    outline: none;
    border-color: #007acc;
    box-shadow: 0 0 0 2px rgba(0, 122, 204, 0.2);
}

.control-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    padding: 4px 0;
    font-size: 13px;
    color: #d4d4d4;
    transition: color 0.15s;
}

.control-checkbox:hover {
    color: #ffffff;
}

.control-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #353a42;
    background-color: #23272e;
    border: 1.5px solid #444950;
    border-radius: 4px;
    transition: border-color 0.18s, box-shadow 0.18s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.18);
}

.control-checkbox input[type="checkbox"]:focus {
    outline: none;
    border-color: #353a42;
    box-shadow: 0 0 0 2px rgba(33,150,243,0.18);
}

.control-vector {
    display: flex;
    gap: 4px;
    align-items: center;
}

.control-vector input {
    flex: 1;
    min-width: 0;
}

.control-vector-label {
    font-size: 10px;
    color: #888;
    min-width: 12px;
    text-align: center;
}

.control-textarea {
    background: #2d2d30;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    color: #d4d4d4;
    padding: 8px;
    font-size: 13px;
    font-family: 'Courier New', monospace;
    resize: vertical;
    min-height: 60px;
    width: 100%;
}

.control-textarea:focus {
    outline: none;
    border-color: #007acc;
    box-shadow: 0 0 0 2px rgba(0, 122, 204, 0.2);
}

.control-button {
    background: #23272e;
    border: 1px solid #353a42;
    border-radius: 5px;
    color: #e6e6e6;
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition:
        background 0.18s cubic-bezier(.4,0,.2,1),
        border-color 0.18s cubic-bezier(.4,0,.2,1),
        color 0.18s cubic-bezier(.4,0,.2,1),
        box-shadow 0.18s cubic-bezier(.4,0,.2,1),
        transform 0.12s cubic-bezier(.4,0,.2,1);
    width: 100%;
    text-align: center;
    margin: 3px 0;
    box-shadow: 0 1px 2px 0 rgba(0,0,0,0.10);
    letter-spacing: 0.01em;
}

.control-button:hover {
    background: #2d323b;
    border-color: #4a90e2;
    color: #ffffff;
    box-shadow: 0 2px 8px 0 rgba(74,144,226,0.10);
    transform: translateY(-2px) scale(1.01);
}

.control-button:active {
    background: #1a1d22;
    border-color: #2d323b;
    color: #b3d1f7;
    box-shadow: 0 1px 2px 0 rgba(0,0,0,0.12);
    transform: translateY(0) scale(0.99);
}

.control-button:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 122, 204, 0.3);
}

/* Copy button wrapper for command controls (shared by layers & audio) */
.control-with-copy {
    position: relative;
    margin-bottom: 12px;
}

.control-with-copy .command-control {
    width: 100%;
}

.control-with-copy .command-control .control-button {
    width: 100%;
}

.individual-copy-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    padding: 0;
    background: rgba(74, 144, 226, 0.15);
    border: 1px solid rgba(74, 144, 226, 0.3);
    border-radius: 4px;
    color: #4a90e2;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease, background 0.2s ease, transform 0.1s ease;
    z-index: 10;
}

.control-with-copy:hover .individual-copy-btn {
    opacity: 1;
}

.individual-copy-btn:hover {
    background: rgba(74, 144, 226, 0.25);
    border-color: rgba(74, 144, 226, 0.5);
    transform: scale(1.05);
}

.individual-copy-btn:active {
    background: rgba(74, 144, 226, 0.35);
    transform: scale(0.95);
}

/* Layer Controls Copy Button Styling (specific positioning in basic controls) */
.basic-controls .control-with-copy {
    position: relative;
    margin-bottom: 12px;
}

.basic-controls .control-with-copy .command-control {
    width: 100%;
}

.basic-controls .control-with-copy .command-control .control-button {
    width: 100%;
}

.basic-controls .individual-copy-btn {
    position: absolute;
    top: -3px;
    right: 4px;
    width: 24px;
    height: 24px;
    padding: 0;
    background: rgba(74, 144, 226, 0.15);
    border: 1px solid rgba(74, 144, 226, 0.3);
    border-radius: 4px;
    color: #4a90e2;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease, background 0.2s ease, transform 0.1s ease;
    z-index: 10;
}

.basic-controls .control-with-copy:hover .individual-copy-btn {
    opacity: 1;
}

.basic-controls .individual-copy-btn:hover {
    background: rgba(74, 144, 226, 0.25);
    border-color: rgba(74, 144, 226, 0.5);
    transform: scale(1.05);
}

.basic-controls .individual-copy-btn:active {
    background: rgba(74, 144, 226, 0.35);
    transform: scale(0.95);
}


.parameter-info {
    font-size: 10px;
    color: #888;
    margin-top: 2px;
    font-style: italic;
}

/* Layer Option Items */
.layer-option-item {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.layer-option-item.layer-active {
    color: #ffffff;
}

.layer-option-item.layer-inactive {
    color: #6a6a6a;
}

.layer-option-item.layer-inactive .layer-name {
    opacity: 0.7;
}

.layer-name {
    flex: 1;
    cursor: pointer;
    transition: color 0.2s;
}

.visibility-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 12px;
    transition: all 0.2s;
    min-width: 20px;
    text-align: center;
    margin-right: 4px;
    flex-shrink: 0;
}

.visibility-toggle:hover {
    background-color: #3e3e42;
}

.visibility-toggle.visible {
    opacity: 1;
}

.visibility-toggle.hidden {
    opacity: 0.5;
    filter: grayscale(100%);
}

.no-layers-item {
    font-style: italic;
    color: #6a6a6a !important;
    cursor: default !important;
}

.no-layers-item:hover {
    background-color: transparent !important;
    color: #6a6a6a !important;
}

.no-layers {
    padding: 8px 12px 8px 20px;
    color: #6a6a6a;
    font-style: italic;
    font-size: 11px;
}

/* Content Sections */
.content-section {
    padding: 0;
}

.content-section h3 {
    color: #ffffff;
    font-size: 14px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #3e3e42;
}

.content-section .placeholder {
    height: auto;
    padding: 16px 0;
    text-align: left;
    display: block;
}

.content-section .placeholder p {
    margin: 6px 0;
    line-height: 1.4;
}

/* Layer Properties */
.layer-properties-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #3e3e42;
}

.layer-properties-header h3 {
    color: #ffffff;
    font-size: 14px;
    margin-bottom: 8px;
}

.layer-status {
    font-size: 12px;
    color: #cccccc;
}

.layer-status .active {
    color: #27a131;
    font-weight: 600;
}

.layer-status .inactive {
    color: #6a6a6a;
    font-weight: 600;
}

.layer-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Properties Sections */
.properties-section {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #3e3e42;
}

.properties-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.properties-section h4 {
    color: #ffffff;
    font-size: 13px;
    margin-bottom: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Custom Controls (Layer-specific commands) */
.custom-controls-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.custom-controls-category {
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 6px;
    background-color: #2d2d30;
    border: 1px solid #3e3e42;
}

.custom-controls-category h5 {
    margin: 0 0 8px 0;
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.category-controls {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #3e3e42;
}

/* Dropdown Containers */
.dropdown-container {
    margin-bottom: 12px;
}

.dropdown-container label {
    display: block;
    font-size: 12px;
    color: #cccccc;
    margin-bottom: 4px;
    font-weight: 500;
}

/* Controls Containers */
.controls-container {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #2d2d30;
}

.controls-container:empty {
    display: none;
}

/* No Items Styling */
.no-items {
    color: #6a6a6a;
    font-style: italic;
    font-size: 12px;
    margin: 8px 0;
    padding: 8px;
    background-color: #2d2d30;
    border-radius: 4px;
    text-align: center;
}

/* Audio Player Styles */
.current-track {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding: 12px;
    background-color: #2d2d30;
    border-radius: 8px;
}

.track-cover {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    margin-right: 12px;
    object-fit: cover;
}

.track-info {
    flex: 1;
}

.track-info h4 {
    margin: 0 0 4px 0;
    font-size: 14px;
    color: #ffffff;
    font-weight: 600;
}

.track-info p {
    margin: 0 0 8px 0;
    font-size: 12px;
    color: #cccccc;
}

.track-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #6a6a6a;
}

.progress-bar {
    flex: 1;
    height: 4px;
    background-color: #3e3e42;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: #f7b603;
    transition: width 0.1s ease;
}

.no-track {
    text-align: center;
    padding: 20px;
    color: #6a6a6a;
    font-style: italic;
}

/* Playlist Styles */
.playlist-section {
    margin-bottom: 20px;
}

.playlist-container {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #3e3e42;
    border-radius: 6px;
    background-color: #2d2d30;
}

.playlist-item {
    display: flex;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid #3e3e42;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.playlist-item:last-child {
    border-bottom: none;
}

.playlist-item:hover {
    background-color: #3e3e42;
}

.playlist-item.active {
    background-color: rgba(76, 175, 80, 0.1);
    border-left: 3px solid #f7b603;
}

.playlist-track-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px 0 8px;
    gap: 8px;
}

.playlist-track-row .track-name {
    font-size: 13px;
    color: #ffffff;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.playlist-remove-btn {
    min-width: 22px;
    height: 22px;
    line-height: 18px;
    padding: 0 6px;
    background: none;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    color: #ff6b6b;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.playlist-remove-btn:hover {
    background-color: rgba(255, 107, 107, 0.15);
    border-color: #ff6b6b;
    color: #ff8080;
}

.track-number {
    width: 24px;
    text-align: center;
    font-size: 12px;
    color: #6a6a6a;
    font-weight: 500;
}

.playlist-cover {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    margin: 0 8px;
    object-fit: cover;
}

.playlist-track-info {
    flex: 1;
    min-width: 0;
}

.track-title {
    font-size: 13px;
    color: #ffffff;
    font-weight: 500;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.track-artist {
    font-size: 11px;
    color: #cccccc;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.track-duration {
    font-size: 11px;
    color: #6a6a6a;
    margin-top: 2px;
}

.playlist-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
}

.playlist-controls button {
    background: none;
    border: 1px solid #3e3e42;
    color: #cccccc;
    font-size: 10px;
    padding: 4px 6px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.playlist-controls button:hover:not(:disabled) {
    background-color: #f7b603;
    border-color: #f7b603;
    color: #ffffff;
}

.playlist-controls button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.btn-play-track {
    background-color: #f7b603 !important;
    border-color: #f7b603 !important;
    color: #ffffff !important;
}

/* Audio Stats Styles */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat label {
    font-size: 11px;
    color: #cccccc;
    font-weight: 500;
}

.stat span {
    font-size: 11px;
    color: #6a6a6a;
}

.level-meter {
    height: 8px;
    background-color: #3e3e42;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.level-fill {
    height: 100%;
    background-color: #f7b603;
    transition: width 0.1s ease;
}

.level-fill.rms {
    background-color: #FF9800;
}

/* Horizontal Player Controls - Nav Bar Style */
.player-controls-horizontal {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    background-color: #2d2d30;
    border-radius: 8px;
    margin-bottom: 16px;
    border: 1px solid #3e3e42;
}

.player-controls-horizontal .control-btn {
    min-width: 42px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    background-color: #3e3e42;
    border: 1px solid #555555;
    color: #ffffff;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
    position: relative;
    margin: 0;
    border-radius: 0;
    outline: none;
    padding: 2px;
}

/* First button - rounded left */
.player-controls-horizontal .control-btn.first {
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
    border-right: none;
}

/* Last button - rounded right */
.player-controls-horizontal .control-btn.last {
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
    border-left: none;
}

/* Middle buttons - no borders on sides */
.player-controls-horizontal .control-btn:not(.first):not(.last) {
    border-left: none;
    border-right: none;
}

/* Hover effects - no flickering */
.player-controls-horizontal .control-btn:hover {
    background-color: #f7b603;
    color: #ffffff;
    z-index: 1;
}

/* Active/pressed state */
.player-controls-horizontal .control-btn:active {
    background-color: #f7b603;
    transform: none;
}

/* Playing state for play/pause button */
.player-controls-horizontal .control-btn.playing {
    background-color: #f7b603;
    color: #ffffff;
}

.player-controls-horizontal .control-btn.playing:hover {
    background-color: #f7b603;
}

/* Interactive Progress Bar */
.progress-section {
    margin-bottom: 20px;
}

.time-display {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #6a6a6a;
    margin-bottom: 6px;
}

.progress-bar-container {
    padding: 8px 0;
    cursor: pointer;
}

.progress-bar-track {
    position: relative;
    height: 6px;
    background-color: #3e3e42;
    border-radius: 3px;
    overflow: visible;
}

.progress-bar-fill {
    height: 100%;
    background-color: #f7b603;
    border-radius: 3px;
    transition: width 0.1s ease;
    pointer-events: none;
}

.progress-bar-handle {
    position: absolute;
    top: -4px;
    width: 14px;
    height: 14px;
    background-color: #f7b603;
    border-radius: 50%;
    cursor: grab;
    transform: translateX(-50%);
    transition: all 0.1s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.progress-bar-handle:hover {
    transform: translateX(-50%) scale(1.2);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.4);
}

.progress-bar-handle:active {
    cursor: grabbing;
    transform: translateX(-50%) scale(1.1);
}

/* Volume Controls */
.volume-controls {
    margin-bottom: 20px;
}

.volume-controls .control-item {
    margin-bottom: 8px;
}

/* Frequency Visualization */
.frequency-visualization {
    margin-bottom: 20px;
}

.freq-meters {
    padding: 12px;
    background-color: #2d2d30;
    border-radius: 6px;
    border: 1px solid #3e3e42;
}

.freq-meter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}

.freq-meter {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.freq-meter label {
    font-size: 11px;
    color: #cccccc;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.meter-bar {
    height: 12px;
    background-color: #3e3e42;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.meter-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.05s ease;
    background: linear-gradient(90deg, #f7b603 0%, #8BC34A 50%, #CDDC39 100%);
}

.meter-fill.bass {
    background: linear-gradient(90deg, #8E24AA 0%, #9C27B0 100%);
}

.meter-fill.low {
    background: linear-gradient(90deg, #1976D2 0%, #2196F3 100%);
}

.meter-fill.mid {
    background: linear-gradient(90deg, #388E3C 0%, #f7b603 100%);
}

.meter-fill.high {
    background: linear-gradient(90deg, #F57C00 0%, #FF9800 100%);
}

.meter-fill.treble {
    background: linear-gradient(90deg, #D32F2F 0%, #F44336 100%);
}

.meter-fill.average {
    background: linear-gradient(90deg, #455A64 0%, #607D8B 100%);
}

.freq-meter span {
    font-size: 10px;
    color: #6a6a6a;
    text-align: center;
}

/* Compact command selector (reusable) */
.command-selector-compact {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.command-selector-label {
    font-size: 12px;
    color: #cccccc;
    font-weight: 500;
}

.command-selector-description {
    font-size: 11px;
    color: #888888;
    min-height: 14px;
}

.command-selector-buttons {
    display: flex;
    gap: 8px;
}

.command-selector-buttons .control-button {
    flex: 1;
    margin: 0;
}

.no-viz {
    color: #6a6a6a;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* Legacy Player Controls Layout (keep for compatibility) */
.player-controls .control-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 8px;
}

.player-controls .control-item {
    margin-bottom: 8px;
}

/* Audio EQ Controls Layout */
.audio-eq-controls .control-item {
    margin-bottom: 12px;
}

/* Drag and Drop States */
.playlist-item.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
}

.playlist-item.drag-over {
    border-top: 2px solid #f7b603;
}

/* Responsive adjustments for smaller panels */
@media (max-width: 300px) {
    .current-track {
        flex-direction: column;
        text-align: center;
    }

    .track-cover {
        margin: 0 0 8px 0;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .playlist-controls {
        flex-wrap: wrap;
    }
}
