/* ===== Settings Specific Styles ===== */
/* Requires: help_menus_styles.css for shared panel styles */

/* Settings-specific number input width */
.settings-input-number {
    width: 80px;
    min-width: 80px;
}

/* Gear Button - inherits .drawer-footer-btn styles when in drawer */
/* Only apply these styles when NOT in drawer (toolbar context) */
#toolbar #settings-gear-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: var(--font-size-h4);
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#toolbar #settings-gear-btn:hover {
    background-color: var(--neutral-700);
    color: var(--shade-white);
}

#toolbar #settings-gear-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Shotgrid/Flow Button - only apply toolbar styles when in toolbar */
#toolbar #sg-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: var(--font-size-h4);
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#toolbar #sg-btn:hover {
    background-color: var(--neutral-700);
    color: var(--shade-white);
}

#toolbar #sg-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Panel Button (for settings) */
.panel-button {
    padding: 6px 14px;
    background: rgba(74, 158, 255, 0.2);
    border: 1px solid rgba(74, 158, 255, 0.4);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.9);
    font-size: var(--font-size-body-xs);
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: all 0.15s ease;
    min-width: 120px;
}

.panel-button:hover:not(:disabled) {
    background: rgba(74, 158, 255, 0.35);
    border-color: rgba(74, 158, 255, 0.6);
}

.panel-button:active:not(:disabled) {
    background: rgba(74, 158, 255, 0.45);
}

.panel-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.panel-button--success {
    background: rgba(91, 217, 117, 0.25);
    border-color: rgba(91, 217, 117, 0.5);
    color: rgba(91, 217, 117, 1);
}

.panel-button--success:hover:not(:disabled) {
    background: rgba(91, 217, 117, 0.35);
    border-color: rgba(91, 217, 117, 0.7);
}

.panel-button--error {
    background: rgba(255, 99, 99, 0.25);
    border-color: rgba(255, 99, 99, 0.5);
    color: rgba(255, 99, 99, 1);
}

.panel-button--error:hover:not(:disabled) {
    background: rgba(255, 99, 99, 0.35);
    border-color: rgba(255, 99, 99, 0.7);
}

/* Gear button wrapper for indicator positioning */
.gear-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

/* ComfyUI Connection Status Indicator */
.comfyui-indicator {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    pointer-events: none;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.comfyui-disconnected {
    background-color: var(--neutral-600);
    box-shadow: none;
}

.comfyui-connecting {
    background-color: var(--warning-500);
    box-shadow: 0 0 4px rgba(240, 173, 78, 0.6);
    animation: pulse-connecting 1.5s ease-in-out infinite;
}

.comfyui-connected {
    background-color: var(--node-action-play);
    box-shadow: 0 0 4px rgba(91, 217, 117, 0.6);
}

@keyframes pulse-connecting {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ===== Connections Status Bar (Drawer Footer Bottom) ===== */
.connections-status-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 6px 0;
    margin: 0;
}

.connections-status-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.connections-status-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.connections-status-label {
    color: rgba(255, 255, 255, 0.4);
    font-size: var(--font-size-ui-xs);
    font-weight: 500;
    user-select: none;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.connections-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* Collapsed drawer - just show dots in a column */
#drawer.collapsed .connections-status-bar {
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px 0;
    justify-content: center;
}

#drawer.collapsed .connections-status-item {
    padding: 6px;
    justify-content: center;
}

#drawer.collapsed .connections-status-label {
    display: none;
}

#drawer.collapsed .connections-status-dot {
    width: 8px;
    height: 8px;
}

.connections-status-dot.status-disconnected {
    background-color: var(--neutral-600);
    box-shadow: none;
}

.connections-status-dot.status-connecting {
    background-color: var(--warning-500);
    box-shadow: 0 0 4px rgba(240, 173, 78, 0.6);
    animation: pulse-connecting 1.5s ease-in-out infinite;
}

.connections-status-dot.status-connected {
    background-color: var(--node-action-play);
    box-shadow: 0 0 4px rgba(91, 217, 117, 0.6);
}

/* ===== Connections Panel Specific ===== */

/* Section containers with colored left border */
.connections-section {
    margin: 8px 12px 16px 12px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border-left: 3px solid;
}

.connections-section--nodey {
    border-left-color: var(--accent-main);
}

.connections-section--comfyui {
    border-left-color: var(--hue-purple);
}

.connections-section--shotgrid {
    border-left-color: var(--node-action-play);
}

/* Section header styling */
.connections-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.connections-section-title {
    color: rgba(255, 255, 255, 0.9);
    font-size: var(--font-size-ui-md);
    font-weight: 600;
    letter-spacing: 0.3px;
}

.connections-section-icon {
    width: 18px;
    height: 18px;
    opacity: 0.8;
}

/* Items within sections */
.connections-section .panel-item {
    padding: 8px 4px;
    border-bottom: none;
}

.connections-section .panel-item:hover {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
}

.connections-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: var(--font-size-ui-sm);
    font-weight: 500;
    white-space: nowrap;
}

.connections-status-badge.status-connected {
    background: rgba(91, 217, 117, 0.2);
    color: var(--node-action-play);
    border: 1px solid rgba(91, 217, 117, 0.3);
}

.connections-status-badge.status-disconnected {
    background: rgba(102, 102, 102, 0.2);
    color: var(--text-muted);
    border: 1px solid rgba(102, 102, 102, 0.3);
}

.connections-status-badge.status-connecting {
    background: rgba(240, 173, 78, 0.2);
    color: var(--warning-500);
    border: 1px solid rgba(240, 173, 78, 0.3);
    animation: pulse-connecting 1.5s ease-in-out infinite;
}

.connections-link {
    color: var(--accent-main);
    text-decoration: none;
    border-bottom: 1px dashed rgba(74, 158, 255, 0.5);
    transition: border-color 0.15s ease;
}

.connections-link:hover {
    border-bottom-color: var(--accent-main);
}

.panel-code-block {
    display: block;
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: var(--font-size-ui-md);
    color: var(--text-primary);
}
