/* Viewport Panel Styles */
/* TouchDesigner-style design following gatito-cheer specifications */

.viewport-panel {
    position: relative;
    width: 320px;
    min-width: 200px;
    max-width: 800px;
    background: #1e1e1e;
    border-left: 1px solid #333;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #fff;
}

.viewport-panel-header {
    height: 40px;
    padding: 8px 12px;
    background: #252525;
    border-bottom: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.viewport-panel-title-section {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.viewport-panel-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.viewport-panel-title {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin: 0;
    white-space: nowrap;
}

.viewport-panel-subtitle {
    font-size: 11px;
    color: #888;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.viewport-panel-status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-left: 8px;
}

.viewport-panel-status-indicator.ready {
    background: #2ecc71;
}

.viewport-panel-status-indicator.rendering {
    background: #f39c12;
    animation: pulse 1s ease-in-out infinite;
}

.viewport-panel-status-indicator.error {
    background: #e74c3c;
}

.viewport-panel-status-indicator.disconnected {
    background: #666;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.viewport-panel-controls-section {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.viewport-panel-control-button {
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: color 0.2s;
    padding: 0;
}

.viewport-panel-control-button:hover {
    color: #fff;
}

.viewport-panel-control-button.active {
    color: #4a9eff;
}

.viewport-panel-container {
    flex: 1;
    position: relative;
    background: #000;
    border: 1px solid #444;
    overflow: hidden;
    min-height: 0;
}

.viewport-panel-canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: default;
}

.viewport-panel-canvas.panning {
    cursor: grabbing;
}

.viewport-panel-canvas.zoom-in {
    cursor: zoom-in;
}

.viewport-panel-canvas.zoom-out {
    cursor: zoom-out;
}

.viewport-panel-controls-overlay {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    padding: 4px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 10;
}

.viewport-panel-control-button-overlay {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: background 0.2s;
}

.viewport-panel-control-button-overlay:hover {
    background: rgba(255, 255, 255, 0.2);
}

.viewport-panel-control-button-overlay:active {
    background: rgba(255, 255, 255, 0.3);
}

.viewport-panel-info-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 24px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    padding: 4px 8px;
    display: flex;
    align-items: center;
    gap: 16px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: #888;
    z-index: 10;
}

.viewport-panel-info-item {
    white-space: nowrap;
}

.viewport-panel-settings {
    position: absolute;
    top: 0;
    right: 0;
    width: 280px;
    height: 100%;
    background: #1e1e1e;
    border-left: 1px solid #333;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 20;
    transform: translateX(100%);
    transition: transform 0.3s ease-out;
}

.viewport-panel-settings.open {
    transform: translateX(0);
}

.viewport-panel-settings::-webkit-scrollbar {
    width: 8px;
}

.viewport-panel-settings::-webkit-scrollbar-track {
    background: #1e1e1e;
}

.viewport-panel-settings::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

.viewport-panel-settings::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.viewport-panel-settings-header {
    padding: 12px;
    background: #252525;
    border-bottom: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.viewport-panel-settings-title {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.viewport-panel-settings-close {
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.viewport-panel-settings-close:hover {
    color: #fff;
}

.viewport-panel-settings-content {
    padding: 12px;
}

.viewport-panel-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #666;
    text-align: center;
    padding: 40px 20px;
}

.viewport-panel-empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.viewport-panel-empty-title {
    font-size: 16px;
    font-weight: 500;
    color: #888;
    margin: 0 0 8px 0;
}

.viewport-panel-empty-message {
    font-size: 13px;
    color: #666;
    margin: 0 0 16px 0;
}

.viewport-panel-empty-button {
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 4px;
    padding: 8px 16px;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.viewport-panel-empty-button:hover {
    background: #333;
}

.viewport-settings-section {
    margin-bottom: 16px;
}

.viewport-settings-section-header {
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #333;
}

.viewport-settings-section-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.viewport-setting-item-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.viewport-setting-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.viewport-setting-label {
    font-size: 12px;
    color: #ccc;
    margin: 0;
}

.viewport-setting-input,
.viewport-setting-select {
    width: 100%;
    height: 28px;
    background: #252525;
    border: 1px solid #444;
    border-radius: 4px;
    padding: 4px 8px;
    color: #fff;
    font-size: 13px;
    font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    outline: none;
}

.viewport-setting-input:focus,
.viewport-setting-select:focus {
    border-color: #4a9eff;
}

.viewport-setting-color {
    width: 100%;
    height: 28px;
    border: 1px solid #444;
    border-radius: 4px;
    cursor: pointer;
    background: none;
    padding: 0;
}

.viewport-setting-checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.viewport-setting-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #4a9eff;
}

.viewport-setting-slider-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.viewport-setting-slider {
    flex: 1;
    height: 6px;
    background: #333;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.viewport-setting-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #4a9eff;
    border: 2px solid #1e1e1e;
    border-radius: 50%;
    cursor: pointer;
}

.viewport-setting-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #4a9eff;
    border: 2px solid #1e1e1e;
    border-radius: 50%;
    cursor: pointer;
}

.viewport-setting-help {
    font-size: 11px;
    color: #888;
    font-style: italic;
    margin-top: 2px;
}

