/* onenote-nav.css — shared pieces of the library UI.
   The library drawer itself (#onenote-nav) is styled in library-drawer.css.
   What remains here: right-toolbar class icons, bulk-selection bar, context menu. */

/* Right-toolbar quick-access class icons */
.nav-book-item {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--bg-item);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    font-weight: 600;
    font-size: 1rem;
    border: 1px solid var(--border-glass);
    flex-shrink: 0;
    overflow: hidden;
    margin: 0 auto;
    /* Center in column */
}

.nav-book-item span:first-child,
.nav-book-item > i {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
    /* Better centering for single letters */
}

.nav-book-item:hover {
    background: var(--bg-item-hover);
    color: var(--text-main);
    transform: scale(1.05);
    border-color: var(--primary);
}

.nav-book-item.active {
    background: linear-gradient(135deg, var(--primary), #6366f1);
    color: white;
    box-shadow: 0 8px 20px rgba(var(--p-h), 90%, 60%, 0.3);
    border-color: rgba(255, 255, 255, 0.3);
}

.nav-book-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    /* Align to the inner edge of the item itself */
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background: white;
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 10px white;
}

.nav-book-item.archived {
    opacity: 0.7;
    filter: grayscale(0.8);
}

.nav-book-item.archived:hover {
    opacity: 1;
    filter: grayscale(0);
}

/* Bulk Bar - Floating Premium Look */
/* Bulk Bar - Floating Premium Look */
.nav-bulk-bar {
    position: fixed;
    bottom: 40px;
    left: 50%;
    /* Center relative to screen */
    transform: translateX(-50%) translateY(0) scale(1);
    background: var(--bg-surface-solid);
    border: 1px solid var(--border-glass);
    border-radius: 18px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: var(--z-bulk-bar);
    width: auto;
    max-width: 90vw;
}

.nav-bulk-bar.show {
    transform: translateX(-50%) translateY(0) scale(1);
}

.bulk-info {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
    /* Force 1 line */
    background: rgba(255, 255, 255, 0.03);
    padding: 8px 16px;
    border-radius: 10px;
    border: 1px solid var(--border-glass);
}

.bulk-info::before {
    content: '\f058';
    /* Check-circle icon */
    font-family: 'Font Awesome 6 Free';
    color: var(--primary);
    font-size: 1.1rem;
}

.bulk-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bulk-btn {
    height: 38px;
    padding: 0 16px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    background: var(--bg-item);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.bulk-btn:hover {
    background: var(--bg-item-hover);
    color: var(--text-main);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.bulk-btn.primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(var(--p-rgb), 0.3);
}

.bulk-btn.primary:hover {
    filter: brightness(1.1);
}

.bulk-btn.danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.bulk-btn.danger:hover {
    background: #ef4444;
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.bulk-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    margin-left: 8px;
    transition: all 0.2s;
    font-size: 1rem;
    padding: 0;
}

.bulk-close:hover {
    background: var(--bg-item-hover);
    color: var(--text-main);
    transform: rotate(90deg);
}

/* Navigation Context Menu */
#nav-context-menu {
    position: fixed;
    background: var(--bg-surface-solid);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    padding: 6px;
    min-width: 180px;
    z-index: var(--z-context-menu);
    display: none;
    backdrop-filter: blur(12px);
}

#nav-context-menu.show {
    display: block;
}

.ctx-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s;
}

.ctx-menu-item:hover {
    background: var(--bg-item-hover);
    color: var(--primary);
}

.ctx-menu-item.delete {
    color: #ef4444;
}

.ctx-menu-item.delete:hover {
    background: rgba(239, 68, 68, 0.1);
}

.ctx-menu-separator {
    height: 1px;
    background: var(--border-glass);
    margin: 4px 0;
}

/* Hidden while being measured/positioned; slides down once placed.
   `html body` + !important beats themes (e.g. Frost Bakery) that put
   `transition: all` on the menu, which made it fly in from off-screen. */
html body #nav-context-menu {
    transition: none !important;
    visibility: hidden;
    transform-origin: top center;
}

html body #nav-context-menu.show.is-open {
    visibility: visible;
    animation: navMenuSlideDown 0.22s cubic-bezier(0.22, 1, 0.36, 1) both !important;
}

@keyframes navMenuSlideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
        clip-path: inset(0 0 100% 0 round 12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
        clip-path: inset(0 0 0 0 round 16px);
    }
}

@media (prefers-reduced-motion: reduce) {
    html body #nav-context-menu.show.is-open {
        animation: none !important;
    }
}

/* Fix Bulk Bar Exit */
.nav-bulk-bar:not(.show) {
    pointer-events: none;
    opacity: 0;
    transform: translateX(-50%) translateY(150%) scale(0.9);
}

/* Missing Loading Spinner & Animations */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: var(--primary);
    font-size: 1.5rem;
}

@keyframes colFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

