/* Pretendard 폰트 import */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable.min.css');

/* 기본 스타일 */
body {
    margin: 0;
    overflow: hidden;
    font-family: 'Pretendard Variable', sans-serif;
}

/* 인트로 영상 컨테이너 */
#intro-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    cursor: pointer;
}

#intro-container.hidden {
    display: none;
}

#intro-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* VR 씬 컨테이너 */
#vr-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#vr-container.active {
    z-index: 9999;
}

/* 지도 버튼 */
#map-button {
    position: fixed;
    top: 0;
    right: 0;
    width: 60px;
    height: 60px;
    cursor: pointer;
    z-index: 10001;
    transition: opacity 0.3s;
    display: none;
}

#vr-container.active #map-button {
    display: block;
}

#map-button:hover {
    opacity: 0.8;
}

#map-button img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 안내도 패널 */
#map-panel {
    position: fixed;
    top: 0;
    right: -520px;
    width: auto;
    max-width: 500px;
    height: auto;
    max-height: 580px;
    background-color: #ffffff;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
    z-index: 10002;
    transition: right 0.4s ease-in-out;
    border-radius: 0;
    overflow: hidden;
}

#map-panel.active {
    right: 0;
}

#map-close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    z-index: 10003;
    transition: opacity 0.3s;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#map-close-button:hover {
    opacity: 0.7;
    background-color: rgba(255, 255, 255, 0.9);
}

#map-close-button img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#map-image {
    display: block;
    max-width: 500px;
    max-height: 580px;
    width: auto;
    height: auto;
}

/* 좌측 사이드바 */
#sidebar-container {
    position: fixed;
    left: 0;
    top: 0;
    width: 320px;
    height: 100%;
    background-color: #142D4B;
    z-index: 10001;
    transition: left 0.4s ease-in-out;
    display: none;
}

#vr-container.active #sidebar-container {
    display: block;
}

#sidebar-container.closed {
    left: -320px;
}

/* 사이드바 토글 버튼 */
#sidebar-toggle {
    position: absolute;
    right: -60px;
    top: 0;
    width: 60px;
    height: 60px;
    background: url('/assets/menu_on.png') center center / cover;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.3s, background-image 0.3s;
}

#sidebar-container.closed #sidebar-toggle {
    background-image: url('/assets/menu_off.png');
}

#sidebar-toggle:hover {
    opacity: 1;
}

/* 상단 여백 1 (16px, #57ABCC) */
#sidebar-top-spacer {
    width: 320px;
    height: 16px;
    background-color: #57ABCC;
}

/* 사이드바 로고 영역 (402px, #FFFFFF) */
#sidebar-logo {
    width: 320px;
    height: 402px;
    background: #FFFFFF url('/assets/logo1.png') center center / contain no-repeat;
    cursor: pointer;
}

/* 하단 여백 (16px, #57ABCC) */
#sidebar-bottom-spacer {
    width: 320px;
    height: 16px;
    background-color: #57ABCC;
}

/* 사이드바 메뉴 영역 */
#sidebar-menu {
    width: 320px;
    height: calc(100% - 434px);
    overflow-y: auto;
    overflow-x: hidden;
    background-color: #142D4B;
    padding: 16px 12px;
    box-sizing: border-box;
}

/* 메인 메뉴 뷰 */
#main-menu-view {
    display: block;
}

#main-menu-view.hidden {
    display: none;
}

/* 서브 메뉴 뷰 */
#sub-menu-view {
    display: none;
    padding: 0;
    margin: -16px -12px;
}

#sub-menu-view.active {
    display: block;
}

/* 현재 선택된 메인 메뉴 표시 (주황색 버튼) */
#current-main-menu {
    width: 320px;
    height: 65px;
    background-color: #FF914C;
    cursor: pointer;
    position: relative;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0;
    margin-bottom: 16px;
}

#current-main-menu-text {
    color: #000000;
    font-family: 'Pretendard Variable', sans-serif;
    font-weight: 600;
    font-size: 18px;
    flex: 1;
    text-align: center;
    padding-left: 36px;
}

#current-main-menu-arrow {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%) scaleX(-1);
    width: 24px;
    height: 24px;
    background: url('/assets/arr_item_right.png') center center / contain no-repeat;
}

/* 서브메뉴 아이템 */
.sub-menu-item {
    width: 296px;
    height: 60px;
    margin: 0 0 10px 0;
    background-color: #FFFFFF;
    cursor: pointer;
    position: relative;
    transition: background-color 0.2s;
    border-radius: 30px;
}

.sub-menu-item:hover {
    background-color: #E8F8FF;
}

.sub-menu-item.active {
    background-color: #7AD7FF;
}

.sub-menu-item-text {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    color: #000000;
    font-family: 'Pretendard Variable', sans-serif;
    font-weight: 400;
    font-size: 18px;
    text-decoration: none;
    padding: 0;
    text-align: center;
}

.sub-menu-item-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    background: url('/assets/arr_item_right.png') center center / contain no-repeat;
    pointer-events: none;
}

/* 사이드바 메뉴 아이템 - 둥근 모서리 + 선택 상태 */
.sidebar-item {
    width: 296px;
    height: 60px;
    margin: 0 0 10px 0;
    background-color: #FFFFFF;
    cursor: pointer;
    position: relative;
    transition: background-color 0.2s;
    border-radius: 30px;
}

.sidebar-item:hover {
    background-color: #E8F8FF;
}

.sidebar-item.active {
    background-color: #7AD7FF;
}

.sidebar-item-text {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    color: #000000;
    font-family: 'Pretendard Variable', sans-serif;
    font-weight: 400;
    font-size: 18px;
    text-decoration: none;
    padding: 0;
    text-align: center;
}

.sidebar-item-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    background: url('/assets/arr_item_right.png') center center / contain no-repeat;
    pointer-events: none;
}

/* 스크롤바 스타일 */
#sidebar-menu::-webkit-scrollbar {
    width: 6px;
}

#sidebar-menu::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

#sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

#sidebar-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* 하단 컨트롤 바 */
#control-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 400px;
    height: 40px;
    z-index: 10001;
    display: none;
    transition: opacity 0.3s;
}

#vr-container.active #control-bar {
    display: flex;
    gap: 0;
    align-items: center;
    justify-content: center;
}

#control-bar.hidden {
    opacity: 0;
    pointer-events: none;
}

/* 컨트롤 버튼 공통 스타일 */
.control-btn {
    width: 40px;
    height: 40px;
    cursor: pointer;
    background-size: 40px 120px;
    background-position: 0 0;
    background-repeat: no-repeat;
}

.control-btn:hover {
    background-position: 0 -40px;
}

.control-btn:active {
    background-position: 0 -80px;
}

.control-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* 개별 버튼 스타일 */
#btn-prev {
    background-image: url('/assets/btn_previous_scene.png');
}

#btn-next {
    background-image: url('/assets/btn_next_scene.png');
}

#btn-zoom-in {
    background-image: url('/assets/btn_zoom_in.png');
}

#btn-zoom-out {
    background-image: url('/assets/btn_zoom_out.png');
}

#btn-vr-mode {
    background-image: url('/assets/btn_vr_mode.png');
}

#btn-vr-mode.off {
    background-image: url('/assets/btn_vr_mode_off.png');
    background-size: 40px 40px;
}

#btn-sound {
    background-image: url('/assets/btn_stop_sound.png');
}

#btn-sound.muted {
    background-image: url('/assets/btn_start_sound.png');
}

#btn-autorotate {
    background-image: url('/assets/btn_start_autorotation.png');
}

#btn-autorotate.active {
    background-image: url('/assets/btn_stop_autorotation.png');
}

#btn-fullscreen {
    background-image: url('/assets/btn_enter_fs.png');
}

#btn-fullscreen.active {
    background-image: url('/assets/btn_close_fs.png');
}

#btn-help {
    background-image: url('/assets/btn_help.png');
}

#btn-hide-controls {
    background-image: url('/assets/btn_hide_controls.png');
}

#btn-hide-controls.hidden-mode {
    background-image: url('/assets/btn_show_controls.png');
}

/* 힌트 팝업 */
#hint-popup {
    position: fixed;
    bottom: -700px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    max-width: 90%;
    height: auto;
    z-index: 10003;
    transition: bottom 0.5s ease-in-out;
    cursor: pointer;
    display: none;
}

#vr-container.active #hint-popup {
    display: block;
}

#hint-popup.active {
    bottom: 120px;
}

#hint-popup img {
    width: 100%;
    height: auto;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.5);
    border-radius: 8px;
}

/* 페이지 이름 라벨 */
#page-label {
    position: fixed;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    padding: 10px 30px;
    border-radius: 20px;
    font-family: 'Malgun Gothic', 'Noto Sans KR', sans-serif;
    font-size: 16px;
    font-weight: 500;
    z-index: 10000;
    display: none;
    white-space: nowrap;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

#vr-container.active #page-label {
    display: block;
}
/* 동영상 팝업 */
#video-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 20000;
    display: none;
    justify-content: center;
    align-items: center;
}

#video-popup-overlay.active {
    display: flex;
}

#video-popup-container {
    position: relative;
    width: 90%;
    max-width: 1492px;
    height: auto;
}

#video-popup-player {
    width: 100%;
    height: auto;
    max-height: 85vh;
    background-color: #000;
    outline: none;
}

#video-popup-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 36px;
    height: 36px;
    background-color: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

#video-popup-close:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

#video-popup-close svg {
    width: 24px;
    height: 24px;
    fill: #ffffff;
}

/* A-Frame 커서 스타일 */
a-cursor {
    cursor: pointer;
}

/* 클릭 가능한 요소 표시 */
.clickable {
    cursor: pointer;
}

/* A-Frame 씬에서 마우스 포인터 활성화 */
a-scene {
    cursor: default;
}

a-scene .clickable:hover {
    cursor: pointer !important;
}
/* 이미지 팝업 */
#image-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 20000;
    display: none;
    justify-content: center;
    align-items: center;
}

#image-popup-overlay.active {
    display: flex;
}

#image-popup-container {
    position: relative;
    width: 90%;
    max-width: 1492px;
    height: auto;
}

#image-popup-viewer {
    width: 100%;
    height: auto;
    max-height: 85vh;
    object-fit: contain;
    background-color: #000;
}

#image-popup-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 36px;
    height: 36px;
    background-color: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

#image-popup-close:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

#image-popup-close svg {
    width: 24px;
    height: 24px;
    fill: #ffffff;
}

/* 서브메뉴 컨테이너 스크롤 */
#sub-menu-container {
    max-height: calc(100vh - 434px - 65px - 32px);
    overflow-y: auto;
    overflow-x: hidden;
}

#sub-menu-container::-webkit-scrollbar {
    width: 6px;
}

#sub-menu-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

#sub-menu-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

#sub-menu-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}