/* 폴더 트리 컨테이너 여백 최소화 */
.folder-tree {
    padding: 2px;
    background-color: #ffffff !important;
}

.folder-tree-panel {
    padding: 0;
    background-color: #ffffff !important;
}

#folderTree {
    padding-left: 2px;
    background-color: #ffffff !important;
}

/* 선택된 항목 강제 스타일 - 최우선순위 */

/* 폴더 트리에서 선택된 항목 - 전체 영역에 배경색 적용 */
#folderTree .tree-node-content.selected,
.folder-tree .tree-node-content.selected,
.tree-node .tree-node-content.selected,
.tree-node-content.selected {
    background-color: #0078d4 !important;
    background: #0078d4 !important;
    color: #ffffff !important;
    /* 너비는 유지하되 margin 제거 */
    display: block !important;
    position: relative !important;
}

/* 선택된 노드의 모든 텍스트 요소 흰색 */
#folderTree .tree-node-content.selected *:not(.tree-action):not(.tree-actions),
.folder-tree .tree-node-content.selected *:not(.tree-action):not(.tree-actions),
.tree-node-content.selected *:not(.tree-action):not(.tree-actions) {
    color: #ffffff !important;
    /* background 제거 - 배경색 간섭 방지 */
}

/* 선택된 노드의 각 요소 개별 지정 */
.tree-node-content.selected .tree-expand,
.tree-node-content.selected .tree-icon,
.tree-node-content.selected .tree-label,
.tree-node-content.selected span:not(.tree-action) {
    color: #ffffff !important;
    /* background 제거 - 배경색 간섭 방지 */
}

/* 선택된 노드의 액션 버튼 */
.tree-node-content.selected .tree-actions {
    position: absolute !important;
    right: 5px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    display: inline-flex !important;
    gap: 2px !important;
    z-index: 10 !important;
}

.tree-node-content.selected .tree-actions .tree-action {
    background: #ffffff !important;
    color: #0078d4 !important;
    border-color: #ffffff !important;
}

.tree-node-content.selected .tree-actions .tree-action:hover {
    background: #e1e1e1 !important;
    color: #005a9e !important;
}

/* 선택된 후 호버해도 선택 상태 유지 */
.tree-node-content.selected:hover {
    background-color: #106ebe !important;
    background: #106ebe !important;
    color: #ffffff !important;
}

.tree-node-content.selected:hover *:not(.tree-action):not(.tree-actions) {
    color: #ffffff !important;
    /* background 제거 - 배경색 간섭 방지 */
}

/* tree-node-content 기본 스타일 */
.tree-node-content {
    display: block;
    padding: 2px 4px;
    cursor: pointer;
    user-select: none;
    position: relative;
    min-height: 20px;
    line-height: 20px;
}

/* 들여쓰기 처리 - data-indent 속성 사용 (최대한 왼쪽으로) */
.tree-node-content[data-indent="0"] { padding-left: 0px !important; }  /* 루트는 완전히 왼쪽 */
.tree-node-content[data-indent="10"] { padding-left: 16px !important; } /* 1레벨은 확장아이콘 너비만 */
.tree-node-content[data-indent="20"] { padding-left: 26px !important; }
.tree-node-content[data-indent="30"] { padding-left: 36px !important; }
.tree-node-content[data-indent="40"] { padding-left: 46px !important; }
.tree-node-content[data-indent="50"] { padding-left: 56px !important; }
.tree-node-content[data-indent="60"] { padding-left: 66px !important; }
.tree-node-content[data-indent="70"] { padding-left: 76px !important; }
.tree-node-content[data-indent="80"] { padding-left: 86px !important; }
.tree-node-content[data-indent="90"] { padding-left: 96px !important; }
.tree-node-content[data-indent="100"] { padding-left: 106px !important; }

/* 기본 호버 효과 */
.tree-node-content:hover {
    background-color: #e5e5e5;
}

/* tree-actions 기본 스타일 - 항상 같은 위치 유지 */
.tree-actions {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    display: none;
    gap: 2px;
    z-index: 10;
}

/* 호버 시에만 버튼 표시 */
.tree-node-content:hover .tree-actions {
    display: inline-flex;
}

/* 선택 시 전체 너비 차지 */
.tree-node-content.selected {
    box-sizing: border-box;
    position: relative;
}

/* 권한 관련 스타일 추가 */

/* 트리에서 제한된 폴더 표시 */
.tree-node-restricted .tree-node-content {
    opacity: 0.8;
}

/* 접근 제한 아이콘 */
.tree-access-icon {
    margin-left: 5px;
    font-size: 12px;
    color: #dc3545;
    vertical-align: middle;
    display: inline-block;
}

/* 비공개 폴더가 선택되었을 때 */
.tree-node-restricted .tree-node-content.selected .tree-access-icon {
    color: #fff !important;
    opacity: 0.9;
}

/* 파일 리스트에서 경고 표시 개선 */
.file-access-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 100%;
}

.file-access-toggle-btn:hover .access-badge {
    transform: scale(1.05);
    transition: transform 0.2s;
}

/* 경고 배지 스타일 */
.access-badge.warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    display: inline-block;
}

/* 툴팁 스타일 개선 */
.file-access-toggle-btn[title] {
    position: relative;
}

/* 호버 시 툴팁 표시 */
.file-access-toggle-btn:hover[title]::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 6px 10px;
    border-radius: 3px;
    white-space: nowrap;
    font-size: 11px;
    z-index: 10000;
    margin-bottom: 5px;
    pointer-events: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
