/* ============================================================================
 * ARCHIVO:        assets/css/arbol.css
 * DESCRIPCIÓN:    Estilos del árbol jerárquico del panel izquierdo.
 * VERSIÓN:        1.2.0  (Fase 9)
 * CREADO:         2026-05-23
 * ACTUALIZADO:    2026-05-31 (cursor pointer en botones de acción del árbol, no el de arrastre)
 * PROYECTO:       Mi Archivador
 * ============================================================================ */

/* Cada nodo del árbol */
.arbol-nodo {
    user-select: none;
}

.arbol-fila {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border-radius: var(--r-sm);
    cursor: pointer;
    color: var(--tinta);
    font-size: 13px;
    transition: background var(--t-rapida), color var(--t-rapida);
    position: relative;
    min-height: 28px;
}
.arbol-fila:hover {
    background: var(--fondo-hover);
}
.arbol-fila.seleccionado {
    background: var(--selec);
    color: var(--tinta);
    font-weight: 500;
}
.arbol-fila.seleccionado::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 3px;
    border-radius: 2px;
    background: var(--acento);
}

/* Flecha de plegar/desplegar */
.arbol-flecha {
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--tinta-tenue);
    transition: transform var(--t-rapida), color var(--t-rapida);
    cursor: pointer;
    border-radius: 3px;
}
.arbol-flecha:hover {
    background: var(--fondo-hover);
    color: var(--tinta);
}
.arbol-flecha.invisible {
    visibility: hidden;
    pointer-events: none;
}
.arbol-flecha.desplegado {
    transform: rotate(90deg);
}
.arbol-flecha svg {
    width: 10px;
    height: 10px;
}

/* Icono del nodo (emoji) */
.arbol-icono {
    font-size: 15px;
    line-height: 1;
    flex-shrink: 0;
    width: 18px;
    text-align: center;
}

/* Nombre del nodo */
.arbol-nombre {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.4;
}

/* Botón "+" para añadir hijo, aparece al hover */
.arbol-accion {
    opacity: 0;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    color: var(--tinta-tenue);
    transition: opacity var(--t-rapida), background var(--t-rapida), color var(--t-rapida);
    flex-shrink: 0;
    cursor: pointer;
}
/* El icono interno no debe capturar el cursor de arrastre de la fila */
.arbol-accion svg { cursor: pointer; pointer-events: none; }
.arbol-accion:hover {
    background: var(--tarjeta);
    color: var(--tinta);
    box-shadow: var(--sombra-xs);
}
.arbol-fila:hover .arbol-accion,
.arbol-fila.seleccionado .arbol-accion {
    opacity: 1;
}
.arbol-accion svg {
    width: 14px;
    height: 14px;
}

/* Contenedor de hijos */
.arbol-hijos {
    padding-left: 14px;
    border-left: 1px dashed transparent;
    margin-left: 8px;
    transition: max-height var(--t-media);
    overflow: hidden;
}
.arbol-hijos.plegado {
    display: none;
}

/* Mensaje de árbol vacío */
.arbol-vacio {
    padding: 30px 16px;
    text-align: center;
    color: var(--tinta-tenue);
    font-size: 13px;
}
.arbol-vacio button {
    margin-top: 12px;
}

/* Edición en línea del nombre */
.arbol-fila input.arbol-edicion {
    flex: 1;
    background: white;
    border: 1px solid var(--acento);
    border-radius: var(--r-xs);
    padding: 2px 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--tinta);
    outline: none;
    box-shadow: 0 0 0 2px var(--acento-suave);
    line-height: 1.3;
    height: 22px;
    min-width: 0;
}
