/* ── Structure Panel — drawer latéral droit ─────────────────────────────── */

.str-panel {
    position: fixed;
    inset: 0;
    z-index: 1100;
    pointer-events: none;
}

.str-panel.hidden {
    display: none;
}

.str-panel__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 5, 18, 0.55);
    pointer-events: all;
    cursor: pointer;
}

.str-panel__drawer {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(440px, 100vw);
    background: #080f1c;
    border-left: 1px solid rgba(0, 160, 255, 0.18);
    display: flex;
    flex-direction: column;
    pointer-events: all;
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.55);
}

/* ── Header ── */
.str-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 12px;
    border-bottom: 1px solid rgba(0, 160, 255, 0.12);
    flex-shrink: 0;
}

.str-panel__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Orbitron', sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: rgba(0, 200, 255, 0.85);
    text-transform: uppercase;
}

.str-panel__title-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.str-panel__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    color: rgba(100, 140, 180, 0.6);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    padding: 0;
}
.str-panel__close i { width: 14px; height: 14px; }
.str-panel__close:hover {
    color: rgba(255, 100, 100, 0.85);
    border-color: rgba(255, 60, 60, 0.25);
}

/* ── Hint ── */
.str-panel__hint {
    padding: 8px 16px;
    font-size: 11px;
    color: rgba(100, 140, 180, 0.55);
    border-bottom: 1px solid rgba(0, 160, 255, 0.07);
    flex-shrink: 0;
    line-height: 1.5;
}

/* ── Tree ── */
.str-panel__tree {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 160, 255, 0.2) transparent;
}

/* ── Tree items ── */
.str-item {
    margin-bottom: 2px;
}

.str-item--deleted > .str-row .str-name {
    text-decoration: line-through;
    opacity: 0.4;
}
.str-item--deleted > .str-row .str-icon { opacity: 0.3; }

/* Row layout */
.str-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px 4px 8px;
    border-radius: 5px;
    border: 1px solid transparent;
    transition: border-color 0.12s, background 0.12s;
    min-height: 30px;
}

.str-row:focus-within,
.str-row:hover {
    background: rgba(0, 100, 200, 0.06);
    border-color: rgba(0, 160, 255, 0.12);
}

/* Indentation */
.str-row--indent1 { padding-left: 28px; }
.str-row--indent2 { padding-left: 52px; }

/* Icons */
.str-icon {
    font-size: 10px;
    flex-shrink: 0;
    line-height: 1;
    font-style: normal;
    width: 12px;
    text-align: center;
}
.str-icon--group { color: rgba(0, 200, 255, 0.70); }
.str-icon--canal { color: rgba(100, 180, 255, 0.55); }
.str-icon--channel { color: rgba(140, 160, 200, 0.55); font-size: 11px; }

/* Name input */
.str-name {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    outline: none;
    font-size: 12px;
    color: rgba(200, 220, 255, 0.85);
    font-family: 'JetBrains Mono', monospace;
    padding: 2px 4px;
    border-radius: 3px;
    transition: background 0.12s, color 0.12s;
}
.str-name:focus {
    background: rgba(0, 60, 120, 0.25);
    color: #fff;
}
.str-item--group > .str-row .str-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: rgba(0, 200, 255, 0.80);
    text-transform: uppercase;
}
.str-item--canal > .str-row .str-name {
    font-size: 11px;
    color: rgba(140, 190, 255, 0.80);
}
.str-name:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* ── Collapse button ── */
.str-collapse-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    color: rgba(100, 150, 200, 0.45);
    transition: color 0.12s;
}
.str-collapse-btn i { width: 11px; height: 11px; }
.str-collapse-btn:hover { color: rgba(0, 200, 255, 0.75); }

/* ── Drag handle ── */
.str-drag-handle {
    flex-shrink: 0;
    font-size: 12px;
    color: rgba(80, 120, 180, 0.25);
    cursor: grab;
    line-height: 1;
    user-select: none;
    padding: 0 2px;
    transition: color 0.12s;
}
.str-row:hover .str-drag-handle { color: rgba(0, 180, 255, 0.45); }
.str-row:active .str-drag-handle { cursor: grabbing; }

/* ── Dragging state ── */
.str-item--dragging { opacity: 0.35; }

/* ── Drop indicators ── */
.str-item--drop-above > .str-row {
    box-shadow: 0 -2px 0 0 rgba(0, 200, 255, 0.70);
}
.str-item--drop-below > .str-row {
    box-shadow: 0 2px 0 0 rgba(0, 200, 255, 0.70);
}

/* Action buttons */
.str-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.12s;
}
.str-row:hover .str-actions,
.str-row:focus-within .str-actions {
    opacity: 1;
}

.str-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 3px;
    color: rgba(100, 150, 200, 0.6);
    cursor: pointer;
    transition: color 0.12s, border-color 0.12s, background 0.12s;
    padding: 0;
}
.str-btn i { width: 11px; height: 11px; }
.str-btn:hover {
    color: rgba(0, 200, 255, 0.90);
    border-color: rgba(0, 180, 255, 0.25);
    background: rgba(0, 120, 255, 0.08);
}
.str-btn--delete:hover {
    color: rgba(255, 80, 80, 0.9);
    border-color: rgba(255, 60, 60, 0.25);
    background: rgba(255, 40, 40, 0.07);
}
.str-btn--restore {
    color: rgba(60, 220, 120, 0.7);
}
.str-btn--restore:hover {
    color: rgba(60, 255, 140, 1);
    border-color: rgba(40, 200, 100, 0.3);
    background: rgba(40, 200, 100, 0.07);
}

/* Channel flags (RP / Galerie checkboxes) */
.str-flags {
    display: flex;
    gap: 14px;
    padding: 3px 8px 5px;
}

.str-flag {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    color: rgba(140, 160, 200, 0.55);
    cursor: pointer;
    user-select: none;
    font-family: 'JetBrains Mono', monospace;
}
.str-flag input[type="checkbox"] {
    accent-color: rgba(0, 180, 255, 0.85);
    cursor: pointer;
    width: 12px;
    height: 12px;
}

/* Add buttons */
.str-add-row {
    padding: 2px 8px 4px;
}
.str-add-row--indent1 { padding-left: 30px; }
.str-add-row--indent2 { padding-left: 54px; }

.str-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: transparent;
    border: 1px dashed rgba(0, 160, 255, 0.18);
    border-radius: 4px;
    color: rgba(0, 160, 255, 0.45);
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
    cursor: pointer;
    transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.str-add-btn i { width: 10px; height: 10px; }
.str-add-btn:hover {
    color: rgba(0, 200, 255, 0.85);
    border-color: rgba(0, 200, 255, 0.35);
    background: rgba(0, 120, 255, 0.07);
}
.str-add-btn--root {
    margin-top: 8px;
    border-color: rgba(0, 200, 255, 0.25);
    color: rgba(0, 200, 255, 0.55);
}

/* Inline add form */
.str-add-form {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    margin: 2px 0;
}
.str-add-form--indent1 { padding-left: 30px; }
.str-add-form--indent2 { padding-left: 54px; }

.str-add-input {
    flex: 1;
    min-width: 0;
    background: rgba(0, 40, 80, 0.30);
    border: 1px solid rgba(0, 160, 255, 0.30);
    border-radius: 4px;
    outline: none;
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    color: #fff;
    padding: 4px 8px;
}
.str-add-input:focus { border-color: rgba(0, 200, 255, 0.55); }

.str-add-confirm {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: rgba(0, 160, 255, 0.15);
    border: 1px solid rgba(0, 160, 255, 0.30);
    border-radius: 4px;
    color: rgba(0, 200, 255, 0.85);
    cursor: pointer;
    transition: background 0.12s;
    padding: 0;
    flex-shrink: 0;
}
.str-add-confirm i { width: 12px; height: 12px; }
.str-add-confirm:hover { background: rgba(0, 160, 255, 0.28); }

.str-add-cancel {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    color: rgba(150, 150, 180, 0.5);
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}
.str-add-cancel i { width: 12px; height: 12px; }
.str-add-cancel:hover { color: rgba(255, 100, 100, 0.85); }

/* ── Footer ── */
.str-panel__footer {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid rgba(0, 160, 255, 0.12);
    flex-shrink: 0;
}

.str-panel__btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    background: transparent;
    border: 1px solid rgba(0, 160, 255, 0.25);
    border-radius: 5px;
    color: rgba(140, 180, 220, 0.75);
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.str-panel__btn i { width: 13px; height: 13px; }
.str-panel__btn:hover {
    background: rgba(0, 80, 160, 0.15);
    border-color: rgba(0, 160, 255, 0.45);
    color: rgba(200, 220, 255, 0.9);
}
.str-panel__btn--primary {
    border-color: rgba(0, 200, 255, 0.40);
    color: rgba(0, 200, 255, 0.85);
    background: rgba(0, 80, 160, 0.12);
}
.str-panel__btn--primary:hover {
    background: rgba(0, 100, 200, 0.22);
    border-color: rgba(0, 200, 255, 0.65);
    color: #00e8ff;
}
.str-panel__btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
