/* ---------------------------------------------------------------------------
 * Form_MenuBookmark.xfdl 변환본 — 즐겨찾기 패널 + reference fragment 스타일.
 *
 * 원본 시각:
 *   - 270×100% 좌측 패널 (Static01 background=#827397 보라 톤)
 *   - "즐겨찾기 추가" 버튼 (250×34, btn_LFFAV_add)
 *   - Tree Grid (binddataset=dsBookmark, treelevel/treestate bind)
 *   - 우클릭 PopupMenu (폴더생성 / 삭제)
 *
 * sidebar-enhance.js 의 ★ 모드 활성 시 .admin-sidebar 에 data-mode="bookmark" 부여,
 * 본 CSS 가 메뉴 영역을 즐겨찾기 패널로 치환.
 * --------------------------------------------------------------------------- */

/* ★ 모드 시 시스템 메뉴 트리 숨기고 즐겨찾기 패널 표시 */
.admin-sidebar[data-mode="bookmark"] #sidebar-menu-container {
  display: none;
}
.admin-sidebar[data-mode="bookmark"] #bookmark-panel-container {
  display: block;
}

/* 즐겨찾기 패널 (기본 숨김 — ★ 모드 시 노출) */
#bookmark-panel-container {
  display: none;
  padding: 12px 10px;
  background: #20202e;
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
}

/* "즐겨찾기 추가" 버튼 — 원본 btn_LFFAV_add (250×34, 보라 톤) */
.bookmark-actions {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}
.bookmark-actions button {
  flex: 1 1 0;
  height: 32px;
  background: #4f6b96;
  color: #ffffff;
  border: 0;
  border-radius: 4px;
  font-family: 'Pretendard', 'Malgun Gothic', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s ease;
}
.bookmark-actions button:hover {
  background: #5d7ba8;
}
.bookmark-actions .btn-add-folder {
  background: #6d5f7b;
}
.bookmark-actions .btn-add-folder:hover {
  background: #7d6f8b;
}

/* 즐겨찾기 트리 — 원본 gridBookmark + treeitemcontrol 의 단순화된 버전 */
.bookmark-tree {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: 'Pretendard', 'Malgun Gothic', sans-serif;
  color: #c0c6d4;
}
.bookmark-tree .folder,
.bookmark-tree .item {
  position: relative;
  padding: 6px 8px 6px 28px;
  font-size: 13px;
  cursor: pointer;
  border-left: 3px solid transparent;
}
.bookmark-tree .folder {
  font-weight: 600;
  color: #d3c5e6;
  padding-left: 24px;
}
.bookmark-tree .folder::before {
  content: '▾';
  position: absolute;
  left: 8px;
  top: 6px;
  font-size: 10px;
  color: #6d7280;
  transition: transform 0.15s ease;
}
.bookmark-tree .folder.is-collapsed::before {
  transform: rotate(-90deg);
}
.bookmark-tree .folder.is-collapsed + .folder-children {
  display: none;
}
.bookmark-tree .folder-children {
  list-style: none;
  margin: 0;
  padding: 0;
}
.bookmark-tree .item {
  padding-left: 36px;
  color: #c0c6d4;
}
.bookmark-tree .item:hover,
.bookmark-tree .folder:hover {
  background: #2a2c3a;
  border-left-color: #d3c5e6;
}
.bookmark-tree .delete-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border: 0;
  background: transparent;
  color: #6d7280;
  cursor: pointer;
  border-radius: 3px;
  display: none;
  font-size: 12px;
}
.bookmark-tree .folder:hover .delete-btn,
.bookmark-tree .item:hover .delete-btn {
  display: block;
}
.bookmark-tree .delete-btn:hover {
  color: #ff8080;
  background: rgba(255, 128, 128, 0.12);
}

.bookmark-empty {
  padding: 20px 12px;
  color: #6d7280;
  font-size: 12px;
  text-align: center;
  font-family: 'Pretendard', 'Malgun Gothic', sans-serif;
  line-height: 1.6;
}

/* form-menu-bookmark reference fragment 스타일 (다른 reference 와 동일 톤) */
.form-menu-bookmark-fragment {
  padding: 24px;
  font-family: 'Pretendard', 'Malgun Gothic', sans-serif;
  color: #1f2a44;
}
.form-menu-bookmark-fragment h3 {
  margin: 0 0 12px 0;
  font-size: 16px;
  color: #2c4368;
}
.form-menu-bookmark-fragment p.lead {
  margin: 0 0 20px 0;
  font-size: 13px;
  color: #555;
  line-height: 1.7;
}
.form-menu-bookmark-mapping {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 24px;
}
.form-menu-bookmark-mapping th,
.form-menu-bookmark-mapping td {
  border: 1px solid #d0d4dc;
  padding: 8px 12px;
  vertical-align: top;
}
.form-menu-bookmark-mapping thead th {
  background: #eceefa;
  color: #1f2a44;
  font-weight: 600;
}
.form-menu-bookmark-mapping td code {
  background: #f5f6f8;
  padding: 1px 5px;
  border-radius: 2px;
  font-family: 'Menlo', 'Consolas', monospace;
  font-size: 12px;
  color: #2c4368;
}
.form-menu-bookmark-fragment .demo-box {
  background: #fbfbfc;
  border: 1px dashed #b8c0cf;
  border-radius: 4px;
  padding: 12px 16px;
  font-size: 13px;
  line-height: 1.7;
  color: #1f2a44;
}
.form-menu-bookmark-fragment .demo-box strong { color: #2c4368; }
