/* 1. Sidebar Nav (Icon Bar) (83-126) */
.sidebar-nav {
    width: 64px;
    min-width: 64px;
    background: var(--sidebar-nav);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 20px;
    z-index: 200;
    overflow-y: auto;
    overflow-x: hidden;
    touch-action: pan-y;
    scrollbar-width: none;
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1),
        min-width 0.25s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.2s ease;
}

/* 収納状態 */
.sidebar-nav.collapsed {
    width: 0;
    min-width: 0;
    opacity: 0;
    pointer-events: none;
    border-right: none;
}

/* 収納トグル共通スタイル */
#btn-sidebar-toggle,
#btn-right-panel-toggle {
    position: fixed;
    top: calc(50% - var(--player-bar-height, 72px) / 2);
    transform: translateY(-50%);
    width: 20px;
    height: 56px;
    background: rgba(0, 0, 0, 0.20);
    border: 1px solid rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 300;
    color: rgba(255, 255, 255, 0.85);
    font-size: 15px;
    font-weight: 600;
    transition: left 0.25s cubic-bezier(0.4, 0, 0.2, 1),
        right 0.25s cubic-bezier(0.4, 0, 0.2, 1),
        background 0.2s, color 0.2s;
}

#btn-sidebar-toggle {
    left: 64px;
    border-left: none;
    border-radius: 0 8px 8px 0;
}

#btn-right-panel-toggle {
    right: 0;
    border-right: none;
    border-radius: 8px 0 0 8px;
}

#btn-sidebar-toggle:hover,
#btn-right-panel-toggle:hover {
    background: rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.9);
}

body.sidebar-collapsed #btn-sidebar-toggle {
    left: 0;
}

body.right-panel-open #btn-right-panel-toggle {
    right: 160px;
}

.sidebar-nav::-webkit-scrollbar {
    display: none;
}

.nav-item {
    width: 44px;
    height: 44px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    cursor: pointer;
    color: var(--text-dim);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
}

.nav-item.active {
    background: var(--accent-glow);
    color: var(--accent);
}

/* Status (323-333) */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.healthy {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

/* ===== Status Indicator (Sidebar Nav Premium) (1475-1620) ===== */
.nav-status-wrap {
    width: 64px;
    padding: 15px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-status-wrap:hover {
    background: rgba(255, 255, 255, 0.03);
}

.logo-inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    position: absolute;
    bottom: -1px;
    right: -1px;
    border: 2px solid var(--sidebar-nav);
    box-shadow: 0 0 10px var(--success);
    z-index: 2;
    transition: all 0.3s ease;
}

.nav-status-wrap img {
    width: 32px;
    height: 32px;
    filter: drop-shadow(0 0 5px var(--accent-glow));
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.status-pulse::after {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: inherit;
    animation: statusPulse 2s infinite;
    opacity: 0.6;
    z-index: -1;
}

@keyframes statusPulse {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }

    100% {
        transform: scale(3);
        opacity: 0;
    }
}

/* Status States */
.nav-status-wrap.syncing .status-pulse {
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
}

.nav-status-wrap.syncing img {
    filter: drop-shadow(0 0 8px var(--accent));
}

.nav-status-wrap.warning .status-pulse {
    background: var(--warning);
    box-shadow: 0 0 10px var(--warning);
}

.nav-status-wrap.warning img {
    filter: drop-shadow(0 0 8px var(--warning));
}

.nav-status-wrap.error .status-pulse {
    background: var(--danger);
    box-shadow: 0 0 10px var(--danger);
}

.nav-status-wrap.error img {
    filter: drop-shadow(0 0 8px var(--danger));
}

/* Tooltip hint */
.nav-status-wrap:hover::before {
    content: attr(data-status);
    position: absolute;
    left: 60px;
    background: var(--surface);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 10px;
    white-space: nowrap;
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    z-index: 9999;
}

/* Brand Display */
.nav-status-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 0;
    user-select: none;
    cursor: default;
}

.st-display {
    font-size: 9px;
    font-weight: 600;
    color: var(--text-dim);
    font-family: 'Outfit', sans-serif;
    transition: all 0.3s ease;
}

.nav-status-wrap.syncing .st-display {
    color: var(--warning);
    font-weight: 700;
}

.nav-status-wrap.error .st-display {
    color: var(--danger);
    font-weight: 700;
}

.nav-status-wrap.warning .st-display {
    color: var(--warning);
}