/* -------------------------------- 햄버거 버튼 -------------------------------- */

.hamburger-menu {
    padding: 19px 20px 29px 20px;

    position: fixed;
    top: 0px;
    right: 50px;

    cursor: pointer;
    /* display: inline-block; */


    z-index: 99999;

    /* 1. 두 가지 색상을 나란히 배치 */
    background: linear-gradient(to left, #2f8f7a 50%, #c74756 50%);
    background-size: 200% 100%; /* 배경 이미지를 요소 너비의 두 배로 설정 */
    
    /* 2. 시작 위치 설정 (첫 번째 색상만 보임) */
    background-position: 100% 0; 
    
    /* 3. 애니메이션 효과 설정 */
    transition: background-position 0.2s ease;

    /* border: 1px solid #ccc; */
}
@media (hover: hover) {
    .hamburger-menu:hover {
        background-position: 0 0;
    }
}

.bar {
    display: block;
    width: 20px;
    height: 2px;
    margin: 4px auto;
    /* border-radius: 30%; */
    background-color: #fac963;
    transition: 0.4s; /* 부드러운 애니메이션 효과 */
    transform: translateZ(0)
}

.hamburger-menu:hover .bar {
    background-color: white;
}

/* 체크박스 숨기기 */
input[type="checkbox"] {
    display: none;
}

input[type="checkbox"]:checked ~ .hamburger-menu {
    background-position: 0 0;
}

/* 체크된 상태일 때 첫 번째 바 회전 및 이동 */
input[type="checkbox"]:checked ~ .hamburger-menu .bar1 {
    background-color: white;    
    transform: translate(0, 5px) rotate(-45deg);
}

/* 체크된 상태일 때 두 번째 바 투명하게 숨기기 */
input[type="checkbox"]:checked ~ .hamburger-menu .bar2 {
    opacity: 0;
}

/* 체크된 상태일 때 세 번째 바 회전 및 이동 */
input[type="checkbox"]:checked ~ .hamburger-menu .bar3 {
    background-color: white;
    transform: translate(0, -7px) rotate(45deg);
}

/* ---------------------------------- 사이드메뉴 영역 ---------------------------------- */

/* 데스크톱 영역 */
@media screen and (min-width: 1025px) {
    /* 1. 체크되었을 때: 확실하게 화면에 고정 */
    input[type="checkbox"]:checked ~ .sidebar {
        transform: translateY(70px) !important; /* 우선순위 부여 */
        transition: transform 0.5s ease-in;
    }

    /* 2. 마우스를 올렸을 때 (선택 사항: 체크 안 된 상태에서도 보여줄지 결정) */
    /* 만약 체크했을 때만 보여주고 싶다면 아래 :hover ~ .sidebar 부분은 지우는 게 좋습니다. */
    .hamburger-menu:hover ~ .sidebar,
    .sidebar:hover {
        transform: translateY(70px);
        transition: transform 0.5s ease-in;
    }   

    /* 3. 기본 상태: 위로 확실히 숨김 */
    .sidebar {
        position: fixed;
        top: 0; 
        right: 50px;
        transform: translateY(-100%); 
        transition: transform 0.5s ease-out; /* 닫힐 때 애니메이션 */
        z-index: 99996;
        width: 30%;
        height: 100vh;
        background-color: white;
        border: 1px solid #ccc;
        box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    }
}


/* 메뉴 숨기기/보이기 (선택 사항) */
.sidebar {
    width: 30%;
    height: 100vh;
    background-color: white;
    position: fixed;
    border: 1px solid #ccc;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 99996;
    /* 여기에 메뉴 스타일 추가 (예: position, background 등) */
}

.sidebar .fixed_menu {
    width: 100%;
    height: 100%;
    padding: 20px 0px 70px 0px;
    scroll-behavior: smooth;
}

.sidebar .sidebar-menu-icon {
    width: 100%;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.sidebar .sidebar-menu-icon a {
    text-decoration: none;
    font-size: 20pt;
    font-weight: 600;
    font-family: shilla_culture_bold, sans-serif;
    color: #000000;
}

.sidebar .sidebar-menu-icon img {
    width: auto;
    height: 20px;
    margin: 0px 20px 0px 20px;
}

.sidebar nav ul {
    padding: 10px 40px;
    margin: 0;

    justify-content: space-around;
    
    list-style-type: none; /* 목록 앞에 붙는 점 제거 */
    
}

.sidebar nav ul .subtitle {
    display: flex;
    align-items: center;
    padding: 10px 0px 10px 0px;
    
}

.sidebar nav ul .subtitle a {
    width: 100%;
    
    display: flex;
    align-items: center;
    justify-content: space-between;

    color: #000000;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.4s ease-in-out;
    margin-left: 10px;

    /* border: 1px solid #ccc; 영역확인 */
}

.sidebar nav ul .subtitle:hover a {
    padding-left: 5px;
    transition: all 0.2s ease-in-out;
}

.sidebar nav ul img { /* 메뉴 아이콘 */
    width: 20px;
    height: 20px;
}

.sidebar nav ul .class_name {
    display: inline-block;
}

.sidebar nav ul li {
    width: 100%;
    display: flex;
    position: relative;
    align-items: center;
    justify-content: flex-start;
    padding: 0px 30px 0px 30px;
    margin-top: 10px;
    /* border: 1px solid #ccc; */
}

.sidebar nav ul li a {
    color: gray;
    display: block;        /* 링크 영역을 넓혀 클릭하기 쉽게 만듦 */
    text-align: center;
    text-decoration: none; /* 이전 질문의 밑줄 제거 코드 */

    cursor: pointer;    
    transition: all 0.3s ease-in-out;

    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    /* border: 1px solid #ccc;  */
}

.sidebar nav ul li a:hover {
    color: #2f8f7a;
    font-weight: 500;
    
    padding-left: 10px;
    transition: all 0.2s ease-in-out;
}

/* --------------------- Arrow --------------------- */

.sidebar .arrow {
    position: absolute;
    left: 0px;

    opacity: 0;
    width: fit-content; /* 내용물 너비만큼만 너비를 가짐 */
    margin-left: auto;  /* 왼쪽 마진을 자동으로 설정하여 오른쪽 정렬 */
    margin-right: 0;

    width: 10px; /*화살표 크기*/ 
    height: 10px; /*화살표 크기*/
    border-radius: 2px;
    border-top: 2px solid gray; /*화살표 선*/
    border-right: 2px solid gray; /*화살표 선*/
    transform: rotate(45deg);
    transition: all 0.3s ease-in-out;
}

.sidebar ul li:hover .arrow {
    left: 18px;
    opacity: 1;
}

.rotate_arrow {
    position: relative;
    display: flex;
    width: fit-content; /* 내용물 너비만큼만 너비를 가짐 */
    margin-left: auto;  /* 왼쪽 마진을 자동으로 설정하여 오른쪽 정렬 */
    margin-right: 0;

    width: 10px; /*화살표 크기*/ 
    height: 10px; /*화살표 크기*/
    border-radius: 2px;
    border-top: 2px solid gray; /*화살표 선*/
    border-right: 2px solid gray; /*화살표 선*/
    transform: rotate(45deg);
    transition: all 0.4s ease-in-out;
}

.sidebar .subtitle:hover .rotate_arrow {
    border-top: 2px solid #2f8f7a;
    border-right: 2px solid #2f8f7a;
    transform: rotate(135deg);
    transition: all 0.2s ease-in-out;
}