/* 메뉴 버튼 */
.menu-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    font-size: 24px;
    background: var(--bg-container);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    cursor: pointer;
    padding: 5px 10px;
    color: var(--text-main);
}

/* 사이드 메뉴 */
.side-menu {
    position: fixed;
    top: 0;
    left: -300px; /* 그림자까지 완전히 숨기기 위해 여유값 추가 */
    width: 280px;
    height: 100%;
    background: var(--bg-container);
    z-index: 1001;
    /* opacity를 추가하여 사라지는 과정을 더 부드럽게 보정 */
    opacity: 0;
    /* 닫힐 때: 0.3초 동안 이동 및 페이드아웃 후 visibility 숨김 처리 */
    transition: left 0.3s ease, opacity 0.3s ease, visibility 0s linear 0.3s;
    box-shadow: 2px 0 10px rgba(0,0,0,0.2);
    padding: 20px;
    visibility: hidden;
}
.side-menu.active { 
    left: 0; 
    opacity: 1;
    visibility: visible; 
    /* 열릴 때: 즉시 보이게 설정하고 0.3초 동안 이동 및 페이드인 */
    transition: left 0.3s ease, opacity 0.3s ease, visibility 0s linear 0s;
}

.menu-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; font-weight: bold; font-size: 1.2em; }
.close-btn { font-size: 24px; background: none; border: none; cursor: pointer; color: var(--text-main); }

.menu-list { list-style: none; padding: 0; }
.menu-list li { margin: 20px 0; }
.menu-list a { text-decoration: none; color: var(--text-main); font-size: 1.1em; display: flex; align-items: center; }
.menu-list a::before {
    content: "•";
    margin-right: 10px;
    color: var(--table-header);
    font-size: 1.2em;
}

/* 오버레이 */
.menu-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    z-index: 1000;
    /* 닫힐 때: opacity가 0이 된 후 visibility 숨김 */
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}
.menu-overlay.active { 
    opacity: 1; 
    visibility: visible; 
    /* 열릴 때: 즉시 보이게 설정 */
    transition: opacity 0.3s ease, visibility 0s linear 0s;
}

/* 테마 스위치 */
.theme-switch-wrapper {
    position: absolute;
    bottom: 80px;
    width: calc(100% - 40px);
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}
.dark-mode-label {
    font-size: 1em;
    font-weight: 500;
    color: var(--text-main);
}
.switch-container {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    font-size: 1.1em;
}
.theme-switch {
    position: relative;
    width: 50px;
    height: 26px;
    background-color: var(--switch-bg);
    border-radius: 15px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
}
.theme-switch::after {
    content: '';
    position: absolute;
    top: 3px; left: 3px; width: 20px; height: 20px;
    background-color: white; border-radius: 50%;
    transition: transform 0.3s; box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
body.dark-mode .theme-switch::after { transform: translateX(24px); }