/**
 * sidebar.css — Toggle Sidebar Vincent
 * Colapsada: 64px | Expandida: 220px
 * Suporta: side-left / side-right | drag livre | dados persistidos
 */

/* ── Sidebar base ── */
.v-sidebar {
    position: fixed;
    top: 50%;
    left: 0;
    width: 64px;
    z-index: 1025;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 0 20px 20px 0;
    padding: 8px 0 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    box-shadow: 4px 0 24px rgba(0, 0, 0, .4),
        inset -1px 0 0 rgba(99, 102, 241, .15);
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-110%) translateY(-50%);
    transition: width .3s cubic-bezier(.16, 1, .3, 1),
        opacity .25s ease,
        transform .3s cubic-bezier(.16, 1, .3, 1);
}

/* Lado esquerdo (padrão) */
.v-sidebar.side-left {
    left: 0;
    right: auto;
    border-radius: 0 20px 20px 0;
    border-left: none;
    transform: translateX(-110%) translateY(-50%);
    box-shadow: 4px 0 24px rgba(0, 0, 0, .4);
}

.v-sidebar.side-left.visible {
    transform: translateX(0) translateY(-50%);
}

/* Lado direito */
.v-sidebar.side-right {
    left: auto;
    right: 0;
    border-radius: 20px 0 0 20px;
    border-right: none;
    transform: translateX(110%) translateY(-50%);
    box-shadow: -4px 0 24px rgba(0, 0, 0, .4);
}

.v-sidebar.side-right.visible {
    transform: translateX(0) translateY(-50%);
}

/* Expandido */
.v-sidebar.open {
    width: 220px;
}

.v-sidebar.side-right.open .v-sidebar-item,
.v-sidebar.side-right.open .v-sidebar-toggle,
.v-sidebar.side-right.open .v-sidebar-side-btn,
.v-sidebar.side-right.open .v-sidebar-avatar {
    flex-direction: row-reverse;
    text-align: right;
}

/* Visível */
.v-sidebar.visible {
    opacity: 1;
    pointer-events: all;
}

/* Durante drag: sem transição de posição para não atrasar */
.v-sidebar.dragging {
    transition: width .3s cubic-bezier(.16, 1, .3, 1),
        opacity .25s ease !important;
    user-select: none;
    cursor: grabbing !important;
}

/* ── Drag Handle ── */
.v-sidebar-drag-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 20px;
    color: rgba(255, 255, 255, .25);
    font-size: .75rem;
    cursor: grab;
    transition: color .2s;
    flex-shrink: 0;
}

.v-sidebar-drag-handle:hover {
    color: rgba(99, 102, 241, .7);
}

.v-sidebar-drag-handle:active {
    cursor: grabbing;
}


/* ── Toggle button (hamburguer no topo) ── */
.v-sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 44px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    cursor: pointer;
    border-radius: 10px;
    margin: 0 8px 8px;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
}

.v-sidebar.open .v-sidebar-toggle {
    width: calc(220px - 16px);
    justify-content: flex-start;
    gap: 12px;
    padding-left: 6px;
}

.v-sidebar-toggle:hover {
    background: rgba(99, 102, 241, 0.2);
    color: #a78bfa;
}

/* ── Separador ── */
.v-sidebar-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 6px 12px;
    flex-shrink: 0;
}

/* ── Item de navegação ── */
.v-sidebar-item {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 10px 0;
    margin: 0 8px;
    border-radius: 12px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    font-weight: 500;
    transition: background 0.2s, color 0.2s, gap 0.3s;
    cursor: pointer;
    border: none;
    background: transparent;
    width: calc(64px - 16px);
    overflow: hidden;
    white-space: nowrap;
}

.v-sidebar.open .v-sidebar-item {
    width: calc(220px - 16px);
    gap: 12px;
    padding: 10px 12px;
}

.v-sidebar-item:hover,
.v-sidebar-item.active {
    background: rgba(99, 102, 241, 0.18);
    color: #c4b5fd;
}

.v-sidebar-item.active {
    background: rgba(99, 102, 241, 0.25);
    color: #a78bfa;
    box-shadow: inset 3px 0 0 #6366f1;
}

/* ── Ícone ── */
.v-sidebar-icon {
    min-width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

/* ── Label (escondido quando colapsado) ── */
.v-sidebar-label {
    opacity: 0;
    transition: opacity 0.2s ease 0s;
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
}

.v-sidebar.open .v-sidebar-label {
    opacity: 1;
    transition-delay: 0.1s;
}

/* ── Avatar do usuário (rodapé) ── */
.v-sidebar-footer {
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.v-sidebar-avatar {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 8px;
    border-radius: 12px;
    margin: 0 8px;
    cursor: pointer;
    transition: background 0.2s, gap 0.3s;
    text-decoration: none;
}

.v-sidebar.open .v-sidebar-avatar {
    gap: 10px;
}

.v-sidebar-avatar:hover {
    background: rgba(255, 255, 255, 0.06);
}

.v-sidebar-avatar img,
.v-sidebar-avatar .avatar-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid rgba(99, 102, 241, 0.5);
    object-fit: cover;
    flex-shrink: 0;
}

.avatar-placeholder {
    background: linear-gradient(135deg, #6366f1, #a855f7);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
}

.v-sidebar-avatar-info {
    opacity: 0;
    transition: opacity 0.2s ease 0s;
    overflow: hidden;
}

.v-sidebar.open .v-sidebar-avatar-info {
    opacity: 1;
    transition-delay: 0.1s;
}

.v-sidebar-avatar-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    white-space: nowrap;
}

.v-sidebar-avatar-role {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    white-space: nowrap;
}

/* ── Indicador de área ativa (pulse) ── */
.v-sidebar-item.active .v-sidebar-icon::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #6366f1;
    top: 6px;
    right: 6px;
    animation: sidebarPulse 2s infinite;
}

@keyframes sidebarPulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.4);
    }
}

/* ── Estado Minimizado (Botão Flutuante) ── */
.v-sidebar.minimized {
    width: 64px !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    pointer-events: none; /* Deixa cliques vazarem pelo fundo invisível */
}

/* Esconde todos os itens (e handle de drag) exceto o próprio Toggle */
.v-sidebar.minimized > *:not(#v-sidebar-toggle) {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    position: absolute !important;
}

/* Transforma o ícone Menu em um círculo flutuante (FAB) */
.v-sidebar.minimized #v-sidebar-toggle {
    pointer-events: auto; /* Clicável */
    margin: 0 auto;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(99, 102, 241, 0.5);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), inset 0 0 12px rgba(99, 102, 241, 0.2);
    color: #c4b5fd;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.v-sidebar.minimized #v-sidebar-toggle:hover {
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(168, 85, 247, 0.6);
    color: #fff;
    transform: scale(1.08);
}