/* 플로팅 목차 - 네비게이션 아래 */
.floating-toc {
    position: fixed;
    top: 180px; /* 네비게이션 아래 */
    right: 20px;
    z-index: 998;
    max-height: 60vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    pointer-events: auto; /* 클릭 가능하도록 명시 */
}

.floating-toc-item {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(149, 165, 166, 0.3);
    border-radius: 20px;
    padding: 6px 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(10px);
    font-size: 12px;
    color: #2c3e50;
    height: 28px;
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer; /* 커서 명시 */
    pointer-events: auto; /* 클릭 가능하도록 명시 */
}

.floating-toc-item:hover {
    transform: translateY(-1px) translateX(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    background: rgba(149, 165, 166, 0.1);
    border-color: rgba(149, 165, 166, 0.5);
    max-width: 220px;
    color: #2c3e50; /* 호버 시에도 색상 유지 */
}

.toc-content {
    display: flex;
    align-items: center;
    white-space: nowrap;
    height: 100%;
    overflow: hidden;
    pointer-events: none; /* 내부 요소는 클릭 이벤트 차단 */
}

.toc-title {
    font-weight: 500;
    line-height: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}

/* 스크롤바 스타일링 */
.floating-toc::-webkit-scrollbar {
    width: 3px;
}

.floating-toc::-webkit-scrollbar-track {
    background: transparent;
}

.floating-toc::-webkit-scrollbar-thumb {
    background: rgba(149, 165, 166, 0.3);
    border-radius: 2px;
}

.floating-toc::-webkit-scrollbar-thumb:hover {
    background: rgba(149, 165, 166, 0.5);
}

/* 모바일에서 조정 */
@media (max-width: 768px) {
    .floating-toc {
        left: 10px;
        top: 55px;
        gap: 4px;
    }
    
    .floating-toc-item {
        padding: 6px 10px;
        font-size: 12px;
        height: 28px;
        border-radius: 14px;
    }
    
    .toc-content {
        gap: 2px;
    }
    
    .toc-title {
        font-size: 11px;
        line-height: 1.2;
    }
}

/* 태블릿에서 숨김 */
@media (max-width: 1024px) and (min-width: 769px) {
    .floating-toc {
        display: none;
    }
}

/* 다크 모드 대응 */
@media (prefers-color-scheme: dark) {
    .floating-toc-item {
        background: rgba(44, 62, 80, 0.95);
        color: #ecf0f1;
        border-color: rgba(149, 165, 166, 0.4);
    }
    
    .floating-toc-item:hover {
        background: rgba(149, 165, 166, 0.2);
        color: #ecf0f1;
    }
}