/* 4.sidebar.css - Navigation & Menu Styles */

/* ------------------------------------------------------------
   A. 사이드바 기본 프레임
   ------------------------------------------------------------ */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--primary-color);
    position: fixed; 
    top: 0; 
    left: 0;
    z-index: 1100;
    transition: transform 0.3s ease;
    overflow: hidden; 
}

/* 사이드바가 닫혔을 때 (왼쪽으로 숨김) */
body.sidebar-closed .sidebar {
    transform: translateX(calc(var(--sidebar-width) * -1));
}

/* ------------------------------------------------------------
   B. 사이드바 내부 (로고, 뱃지)
   ------------------------------------------------------------ */
.sidebar-logo {
    padding: 30px 20px;
    background: #1a252f;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.sidebar-logo h2 {
    font-size: 18px;
    letter-spacing: 1px;
    margin: 0;
    color: var(--accent-blue, #3498db);
}

.user-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    background: var(--accent-blue, #3498db);
    color: white;
    margin-top: 5px;
}

/* ------------------------------------------------------------
   C. 네비게이션 메뉴 (Nav Links)
   ------------------------------------------------------------ */
.nav-container {
    display: flex;
    flex-direction: column;
    padding-top: 10px;
    flex: 1;
    overflow-y: auto;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #bdc3c7;
    text-decoration: none;
    font-size: 14px;
    transition: 0.2s;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background: #34495e;
    color: white;
    border-left-color: var(--accent-blue, #3498db);
}

.nav-link.active {
    background: #1e2b37;
    color: white;
    font-weight: bold;
    border-left-color: var(--accent-blue, #3498db);
}

.sidebar-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
    margin: 15px 20px;
}

/* ------------------------------------------------------------
   D. 드롭다운 및 서브 메뉴
   ------------------------------------------------------------ */
.dropdown-btn {
    width: 100%;
    padding: 12px 20px;
    background: none;
    border: none;
    color: #bdc3c7;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
}

.dropdown-container {
    background: #1a252f;
    display: none;
}

.dropdown-container .nav-link {
    padding-left: 40px;
    font-size: 13px;
}

.hidden { display: none !important; }

/* 보기 설정 체크리스트 드롭다운 */
.dropdown-check-list { position: relative; display: inline-block; }
.dropdown-check-list .anchor {
    position: relative; cursor: pointer; display: inline-flex; 
    align-items: center; background: #fff; border: 1px solid #ccc;
    padding: 5px 10px; font-size: 12px; border-radius: 4px;
}
.dropdown-check-list .anchor:after {
    content: ""; border-left: 4px solid transparent; border-right: 4px solid transparent;
    border-top: 5px solid #000; margin-left: 8px;
}
.dropdown-check-list ul.items {
    padding: 8px; display: none; margin: 0;
    border: 1px solid #ccc; border-top: none;
    position: absolute; top: 100%; right: 0; 
    background: #fff; width: 180px; z-index: 100;
    list-style: none; box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border-radius: 0 0 4px 4px;
}
.dropdown-check-list.visible ul.items { display: block; }
.dropdown-check-list ul.items li { padding: 4px 0; font-size: 12px; color: #333; }

/* ------------------------------------------------------------
   E. 사이드바 토글 버튼 (화살표)
   ------------------------------------------------------------ */
.sidebar-toggle-btn {
    position: fixed;
    top: 50px;
    
    /* [JS에서 style로 넣었지만, CSS에서도 이중 안전장치] */
    left: var(--sidebar-width);
    
    z-index: 1200; 
    width: 15px; 
    height: 40px;
    background: #5a6268;
    border: 1px solid #555;
    border-left: none;
    border-radius: 0 6px 6px 0;
    box-shadow: 2px 0 5px rgba(0,0,0,0.15);
    font-size: 10px;
    cursor: pointer;
    color: #ffffff;
    display: flex; align-items: center; justify-content: center;
    transition: left 0.3s ease, transform 0.3s ease, background 0.2s;
}

.sidebar-toggle-btn:hover {
    background: #495057;
    width: 24px; /* 호버 시 살짝 길어지는 효과 */
}

/* 닫혔을 때 스타일: 왼쪽(0px)으로 딱 붙임 */
body.sidebar-closed .sidebar-toggle-btn {
    /* transform 대신 left 속성을 직접 제어하여 위치 오류 방지 */
    left: 0 !important; 
    
    border-left: 1px solid #555; 
    background: #495057; 
    transform: none; /* 기존 transform 제거 */
}

body.sidebar-closed .sidebar-toggle-btn:hover {
    background: #343a40; 
}