/* ==========================================
   Section Toolbar (floats over hovered sections)
   ========================================== */

.section-toolbar {
    position: fixed;
    z-index: 85;
    display: flex;
    align-items: center;
    gap: 1px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 3px;
    box-shadow: 0 4px 20px var(--shadow-color), 0 1px 4px var(--shadow-color);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
    user-select: none;
}

.section-toolbar.visible {
    opacity: 1;
    pointer-events: all;
}

/* Normal mode */
.sect-toolbar-normal {
    display: flex;
    align-items: center;
    gap: 1px;
}

/* Confirm delete mode */
.sect-toolbar-confirm {
    display: none;
    align-items: center;
    gap: 4px;
    padding: 0 6px;
}

.section-toolbar.confirm-mode .sect-toolbar-normal {
    display: none;
}

.section-toolbar.confirm-mode .sect-toolbar-confirm {
    display: flex;
}

/* Buttons */
.sect-btn {
    width: 28px;
    height: 28px;
    background: none;
    border: none;
    border-radius: 5px;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.12s, color 0.12s;
    flex-shrink: 0;
}

.sect-btn:hover {
    background: var(--hover-bg-strong);
    color: var(--text-main);
}

.sect-btn:disabled {
    opacity: 0.25;
    cursor: default;
    pointer-events: none;
}

.sect-btn svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
    flex-shrink: 0;
}

/* Drag handle */
.sect-btn-drag {
    cursor: grab;
    color: var(--text-muted);
}

.sect-btn-drag:active {
    cursor: grabbing;
}

/* Copy button */
.sect-btn-copy:hover {
    background: rgba(0, 122, 204, 0.2);
    color: #58a6ff;
}

/* Paste buttons */
.sect-btn-paste:hover {
    background: rgba(63, 185, 80, 0.2);
    color: #3fb950;
}

/* Delete button */
.sect-btn-delete:hover {
    background: rgba(229, 83, 75, 0.2);
    color: #e5534b;
}

/* Hide button */
.sect-btn-hide {
    opacity: 0.5;
}
.sect-btn-hide:hover {
    opacity: 1;
}

/* Divider */
.sect-divider {
    width: 1px;
    height: 18px;
    background: var(--border);
    margin: 0 2px;
    flex-shrink: 0;
}

/* Confirm row */
.sect-confirm-label {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    padding: 0 2px;
}

.sect-btn-confirm-yes {
    color: #3fb950 !important;
    font-size: 13px;
    font-weight: 700;
}
.sect-btn-confirm-yes:hover {
    background: rgba(63, 185, 80, 0.2) !important;
    color: #3fb950 !important;
}

.sect-btn-confirm-no {
    color: #e5534b !important;
    font-size: 13px;
    font-weight: 700;
}
.sect-btn-confirm-no:hover {
    background: rgba(229, 83, 75, 0.2) !important;
    color: #e5534b !important;
}

/* Global toggle button */
.sect-btn-global {
    color: var(--text-muted);
}
.sect-btn-global:hover {
    background: rgba(0, 122, 204, 0.2);
    color: #58a6ff;
}
.sect-btn-global.sect-btn-global-active {
    color: #58a6ff;
    background: rgba(0, 122, 204, 0.15);
}
.sect-btn-global.sect-btn-global-active:hover {
    background: rgba(229, 83, 75, 0.2);
    color: #e5534b;
}

/* Code editor button */
.sect-btn-code {
    color: var(--text-muted);
}
.sect-btn-code:hover {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
}

/* AI button */
.sect-btn-ai {
    color: var(--accent);
    opacity: 0.8;
}

.sect-btn-ai:hover {
    background: rgba(0, 122, 204, 0.2) !important;
    color: #58a6ff !important;
    opacity: 1;
}

/* Section drag ghost label */
.section-drag-ghost {
    position: fixed;
    background: var(--accent);
    color: white;
    padding: 7px 16px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    pointer-events: none;
    z-index: 9999;
    box-shadow: 0 4px 20px rgba(0, 122, 204, 0.5);
    white-space: nowrap;
    transform: translate(-50%, -120%);
}
