/* =========================================
   1. 폰트 및 기본 설정
   ========================================= */
@font-face {
    font-family: 'Define';
    src: url('DEFINE.ttf') format('truetype');
    font-weight: normal;
}
@font-face {
    font-family: 'Define';
    src: url('DEFINE-Bold.ttf') format('truetype');
    font-weight: bold;
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100dvh; 
    overflow: hidden;
    font-family: 'Define', sans-serif;
    background-color: #0a0a0a;
}

/* =========================================
   2. 섹션 관리 (인트로 vs 뷰어)
   ========================================= */
.hidden-section {
    display: none !important;
}

/* -----------------------------------------
   [인트로 섹션 스타일] 
   ----------------------------------------- */
.intro-container {
    position: relative;
    width: 100%;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: #000;
    z-index: 100;
    cursor: pointer; 
}

#bg-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    z-index: 0;
    object-fit: cover;
    opacity: 0; 
    animation: fadeInVideo 2.5s ease-out forwards;
    animation-delay: 0.2s;
}

.touch-guide {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 20;
    color: #fff;
    font-size: 1.5rem;
    font-weight: 300;
    letter-spacing: 0.1em;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
    text-align: center;
    width: 100%;
    opacity: 0;
    pointer-events: none; 
    animation: blinkFlow 3s infinite ease-in-out;
    transition: opacity 0.5s ease;
}

@keyframes blinkFlow {
    0%, 100% { 
        opacity: 0.4; 
        transform: translate(-50%, -50%) scale(0.98); 
    }
    50% { 
        opacity: 1; 
        transform: translate(-50%, -50%) scale(1.02); 
    }
}

.intro-overlay {
    position: relative;
    z-index: 10;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    width: 90%;
    max-width: 600px;
    opacity: 0;
    pointer-events: none; 
    transition: opacity 1.0s ease; 
}

.intro-container.active .intro-overlay {
    opacity: 1;
    pointer-events: auto; 
}

.intro-container.active .touch-guide {
    opacity: 0 !important; 
    animation: none;
}

.intro-logo {
    width: 200px;
    margin-bottom: 20px;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.8));
}

.intro-title {
    color: #fff;
    font-family: 'Define', sans-serif;
    font-size: 2.5rem;
    font-weight: 300;
    text-shadow: 0 4px 10px rgba(0,0,0,1);
    letter-spacing: 0.1em;
    margin-bottom: 20px;
}

.type-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    width: 100%;
}

.type-card {
    background: rgba(20, 20, 20, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 12px; 
    opacity: 0; 
}

.intro-container.active .type-card {
    animation: fadeInUp 0.8s ease-out forwards;
}
.intro-container.active .type-card:nth-child(1) { animation-delay: 0.1s; }
.intro-container.active .type-card:nth-child(2) { animation-delay: 0.2s; }
.intro-container.active .type-card:nth-child(3) { animation-delay: 0.3s; }
.intro-container.active .type-card:nth-child(4) { animation-delay: 0.4s; }

.type-card:hover {
    background: rgba(50, 50, 50, 0.8);
    border-color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}

.type-name {
    color: #fff;
    font-family: 'Define', sans-serif;
    font-size: 1.5rem;
    font-weight: bold;
}

.type-desc {
    color: #aaa;
    font-size: 0.9rem;
    margin-top: 5px;
}

@keyframes fadeInVideo {
    0% { opacity: 0; }
    100% { opacity: 0.6; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
    .type-grid { grid-template-columns: 1fr; }
    .intro-title { font-size: 1.8rem; }
    .touch-guide { font-size: 1rem; width: 80%; text-align: center; line-height: 1.4; }
}

/* -----------------------------------------
   [VR 뷰어 섹션 스타일] 
   ----------------------------------------- */
.main-container { display: flex; width: 100%; height: 100dvh; }
.pano-area { position: relative; overflow: hidden; }
#panorama { width: 100%; height: 100%; }
.ui-area { background-color: #000; background-image: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('./images/Marble.png'); background-repeat: repeat; background-size: auto, 20vh auto; display: flex; box-sizing: border-box; border-left: 1px solid rgba(255,255,255,0.05); border-top: 1px solid rgba(255,255,255,0.05); z-index: 20; }
.ui-slot { flex: 1; display: flex; justify-content: center; align-items: center; padding: 5px; box-sizing: border-box; border: none; overflow: hidden; }

@media (orientation: landscape) {
    .main-container { flex-direction: row; }
    .pano-area { flex: 1; width: auto; height: 100%; }
    .ui-area { width: 12%; min-width: 100px; height: 100%; flex-direction: column; border-left: 1px solid rgba(255,255,255,0.1); }
    .btn-group-grid, .btn-group-col { width: 80% !important; }
}
@media (orientation: portrait) {
    .main-container { flex-direction: column; }
    .pano-area { width: 100%; height: 80%; }
    .ui-area { width: 100%; height: 20%; min-height: 100px; flex-direction: row; border-top: 1px solid rgba(255,255,255,0.1); }
    #ui-slot-4 { display: none !important; }
}
@media (orientation: landscape) and (max-height: 500px) {
    .ui-area { background-size: auto, 100px auto; }
    .ui-logo { max-height: 60% !important; width: auto !important; max-width: 80%; }
    .ui-logo-text { font-size: 10px !important; }
    .ui-btn { font-size: 0.7rem !important; }
    .ui-slot { padding: 2px !important; }
    .btn-group-grid, .btn-group-col { gap: 3px !important; }
}

#ui-slot-1 { flex-direction: column; gap: 5px; }
.ui-logo { width: 80%; height: auto; object-fit: contain; max-height: 70%; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.8)); transition: all 1s ease; }
.ui-logo-text { color: #e0e0e0; font-family: 'Define', sans-serif; text-align: center; line-height: 1; text-shadow: 0 2px 4px rgba(0,0,0,1); font-weight: 300; letter-spacing: 0.05em; transition: all 1s ease; }
.btn-group-grid { width: 100%; height: 100%; padding: 2px; overflow: hidden !important; }
.btn-group-col { display: flex; flex-direction: column; gap: 6px; width: 100%; padding: 2px;}
.ui-btn { width: 100%; background: rgba(10, 10, 10, 0.6); border: 1px solid rgba(255, 255, 255, 0.1); color: #999; padding: 10px 0; cursor: pointer; border-radius: 4px; font-family: 'Define', sans-serif; font-size: 0.8rem; text-align: center; white-space: normal; line-height: 1.2; backdrop-filter: blur(4px); box-shadow: inset 0 0 10px rgba(0,0,0,0.5); transition: all 1s ease; }
.ui-btn:hover { background: rgba(30, 30, 30, 0.7); border-color: rgba(255, 255, 255, 0.6); color: #fff; box-shadow: 0 0 15px rgba(255, 255, 255, 0.2); text-shadow: 0 0 5px rgba(255,255,255,0.5); transform: translateY(-1px); }
.ui-btn.active { background: rgba(20, 20, 20, 0.8); border: 1px solid #ffffff; color: #ffffff; font-weight: bold; box-shadow: 0 0 5px rgba(255, 255, 255, 0.8), 0 0 20px rgba(255, 255, 255, 0.3), inset 0 0 10px rgba(255,255,255,0.1); text-shadow: 0 0 8px rgba(255,255,255,0.6); }
#ui-slot-5 { position: relative; padding: 0; display: flex; justify-content: center; align-items: center; overflow: hidden !important; z-index: 1; -webkit-mask-image: -webkit-radial-gradient(white, black); mask-image: radial-gradient(white, black); transform: translateZ(0); }
#minimap-container { position: relative; display: flex; justify-content: center; align-items: center; width: auto !important; height: auto !important; max-width: 95%; max-height: 95%; overflow: visible !important; }
#minimap-img { display: block; max-width: 100%; max-height: 100%; min-width: 0; min-height: 0; object-fit: contain; filter: brightness(0.8) grayscale(30%); transition: all 1s ease; }
#minimap-points { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }
.map-point { position: absolute; width: 8px; height: 8px; background-color: rgba(255, 255, 255, 0.5); border: 1px solid rgba(255,255,255,0.8); border-radius: 50%; transform: translate(-50%, -50%); cursor: pointer; z-index: 10; box-shadow: 0 0 5px rgba(255,255,255,0.5); transition: background-color 0.3s, border 0.3s, box-shadow 0.3s; pointer-events: auto; }
.map-point:hover { background-color: #fff; transform: translate(-50%, -50%) scale(1.5); box-shadow: 0 0 10px rgba(255,255,255,0.8); }
.map-point.active { width: 12px; height: 12px; background-color: #fff; border: 2px solid #000; box-shadow: 0 0 15px rgba(255, 255, 255, 1); z-index: 20; }
.radar { position: absolute; width: 90px; height: 90px; transform-origin: center center; transform: translate(-50%, -50%); pointer-events: none; z-index: 5; transition: top 0.3s ease, left 0.3s ease; display: none; }
.radar.active { display: block; }
.radar svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.5)); }
.radar path { fill: rgba(255, 255, 255, 0.25); stroke: rgba(255, 255, 255, 0.8); stroke-width: 1.5; stroke-linecap: round; }
#scene-title-box { position: absolute; top: 20px; left: 20px; z-index: 10; color: #fff; font-size: 1.2rem; font-weight: 300; text-shadow: 2px 2px 8px rgba(0,0,0,1); pointer-events: none; max-width: 80%; letter-spacing: 0.05em; }

/* [수정됨] 썸네일 리스트 숨김 */
.thumbnail-wrapper { 
    display: none !important; 
}

.thumbnail-scroll { display: flex; overflow-x: auto; gap: 10px; padding-bottom: 5px; scrollbar-width: thin; }
.thumbnail-scroll::-webkit-scrollbar { height: 4px; }
.thumbnail-scroll::-webkit-scrollbar-track { background: rgba(255,255,255,0.05); border-radius:2px; }
.thumbnail-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.3); border-radius:2px; }
.thumb-item { flex: 0 0 90px; height: 65px; cursor: pointer; position: relative; border: 1px solid transparent; border-radius: 4px; overflow: hidden; background: #000; transition: all 1s ease; }
.thumb-item img { width: 100%; height: 100%; object-fit: cover; opacity: 0.4; filter: grayscale(30%); transition: all 1s ease; }
.thumb-item span { position: absolute; bottom: 0; left: 0; width: 100%; background: rgba(0,0,0,0.85); color: #aaa; font-size: 9px; text-align: center; padding: 4px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: all 1s ease; }
.thumb-item:hover { border-color: rgba(255,255,255,0.5); box-shadow: 0 0 10px rgba(255,255,255,0.2); transform: translateY(-2px); }
.thumb-item:hover img { opacity: 0.8; filter: grayscale(0%); }
.thumb-item:hover span { color: #fff; }
.thumb-item.active { border-color: #ffffff; box-shadow: 0 0 15px rgba(255, 255, 255, 0.3); }
.thumb-item.active img { opacity: 1; filter: grayscale(0%); }
.thumb-item.active span { background: #000; color: #fff; font-weight: bold; }
.pnlm-load-box { display: none !important; }
.pnlm-zoom-controls { display: none !important; } 
.pnlm-title-box { display: none !important; }    
.pnlm-about-msg { display: none !important; }    
#custom-loader { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 50; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 15px; background-color: transparent; pointer-events: none; opacity: 0; transition: opacity 1.5s ease, background-color 1.5s ease; }
#custom-loader.initial-load { background-color: #000; }
#custom-loader.visible { opacity: 1; pointer-events: all; }
.loader-text { color: #fff; font-family: 'Define', sans-serif; font-size: 1.5rem; font-weight: 300; letter-spacing: 0.2em; text-transform: uppercase; text-shadow: 0 0 20px rgba(255,255,255,0.4); }
.loader-dots { display: flex; gap: 8px; }
.loader-dots span { width: 6px; height: 6px; background-color: #fff; border-radius: 50%; opacity: 0.2; box-shadow: 0 0 5px rgba(255,255,255,0.8); animation: dotPulse 1.5s infinite ease-in-out; }
.loader-dots span:nth-child(1) { animation-delay: 0s; }
.loader-dots span:nth-child(2) { animation-delay: 0.3s; }
.loader-dots span:nth-child(3) { animation-delay: 0.6s; }
@keyframes dotPulse { 0%, 100% { opacity: 0.2; transform: scale(1); } 50% { opacity: 1; transform: scale(1.5); box-shadow: 0 0 10px rgba(255,255,255,1); } }
@media (orientation: landscape) {
    .btn-group-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; height: auto !important; }
    #type-filters .ui-btn { aspect-ratio: 2.5 / 1; height: auto !important; padding: 0 !important; display: flex; align-items: center; justify-content: center; }
}
@media (orientation: portrait) {
    .ui-btn { font-size: 0.75rem; padding: 8px 0; }
    .btn-group-grid { display: flex !important; flex-direction: column; height: 100%; gap: 3px !important; } 
    .btn-group-col { gap: 4px; }
    #type-filters .ui-btn { flex: 1; height: auto !important; padding: 0 !important; display: flex; align-items: center; justify-content: center; min-height: 0; }
    #scene-title-box { font-size: 1rem; top: 15px; left: 15px; }
    .thumbnail-wrapper { bottom: 15px; width: 95%; max-width: 95%; padding: 6px;}
    .thumb-item { flex: 0 0 80px; height: 60px; }
}

/* =========================================
   [수정됨] 핫스팟 스타일 (반투명 둥근 사각형)
   ========================================= */
.vr-hotspot {
    background: rgba(20, 20, 20, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px; /* 둥근 모서리 */
    padding: 8px 16px;
    color: #fff;
    font-family: 'Define', sans-serif;
    font-size: 0.9rem;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    
    /* [중요] transition에 transform(위치) 제외. 색상 등만 부드럽게 */
    transition: background-color 0.2s, border-color 0.2s, transform 0s; 
    
    /* [중요] 중앙 정렬을 위해 translate 추가 */
    transform: translate(-50%, -50%);
    
    display: flex;
    justify-content: center;
    align-items: center;
    white-space: nowrap; 
    
    width: auto !important; 
    height: auto !important;
}

.vr-hotspot:hover {
    background: rgba(50, 50, 50, 0.9);
    border-color: #fff;
    
    /* [중요] hover 시에도 translate 유지하며 scale 적용 */
    transform: translate(-50%, -50%) scale(1.1);
    transition: transform 0.2s; /* 호버 시 스케일만 부드럽게 */
    
    box-shadow: 0 6px 15px rgba(255,255,255,0.3);
    z-index: 100;
}

/* 내부 텍스트 클릭 통과 */
.vr-hotspot span {
    pointer-events: none;
}

/* =========================================
   [디버그 모드용 패널 & 마커]
   ========================================= */
#dev-panel {
    position: fixed;
    
    /* [위치 수정] 하단 썸네일 리스트 위쪽 중앙 */
    top: auto; 
    bottom: 120px; 
    
    left: 50%;
    transform: translateX(-50%);
    
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid #fff;
    padding: 20px;
    z-index: 9999;
    color: #fff;
    border-radius: 8px;
    width: 300px;
    text-align: center;
    box-shadow: 0 0 20px rgba(0,0,0,0.8);
    display: none; 
}

.debug-header { font-size: 1.2rem; font-weight: bold; margin-bottom: 10px; }
.debug-info { margin-bottom: 10px; color: #aaa; }

#debug-code { 
    width: 100%; height: 60px; background: #222; color: #0f0; 
    border: 1px solid #444; margin-bottom: 10px; padding: 5px; box-sizing: border-box;
    resize: none;
}

#debug-copy-btn {
    background: #007bff; color: white; border: none; padding: 8px 15px;
    border-radius: 4px; cursor: pointer; margin-right: 5px; font-family: 'Define', sans-serif;
}

#debug-close-btn {
    background: #555; color: white; border: none; padding: 8px 15px;
    border-radius: 4px; cursor: pointer; font-family: 'Define', sans-serif;
}

#debug-copy-btn:hover { background: #0056b3; }
#debug-close-btn:hover { background: #333; }

/* 크로스헤어(조준점) - 화면 중앙 고정 */
.dev-crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 999;
}
.dev-crosshair::before, .dev-crosshair::after {
    content: '';
    position: absolute;
    background: red;
}
.dev-crosshair::before { top: 9px; left: 0; width: 100%; height: 2px; }
.dev-crosshair::after { top: 0; left: 9px; width: 2px; height: 100%; }

/* 미니맵 클릭 시 생기는 마커 */
.debug-marker {
    position: absolute;
    width: 12px; height: 12px;
    background: red; border: 2px solid white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    pointer-events: none;
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
}

.disclaimer-msg {
    position: absolute;
    bottom: 20px;       /* 바닥에서 20px 띄움 */
    left: 20px;         /* 왼쪽에서 20px 띄움 */
    z-index: 60;        /* 뷰어보다 위에 표시 */
    
    color: rgba(255, 255, 255, 0.7); /* 약간 투명한 흰색 */
    font-family: 'Define', sans-serif;
    font-size: 0.85rem;
    font-weight: 300;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.8); /* 가독성을 위한 그림자 */
    pointer-events: none; /* 클릭 방해 안 함 */
    
    display: none; /* 기본적으로 숨김 */
}

/* 활성화 클래스 */
.disclaimer-msg.visible {
    display: block;
    animation: fadeInMsg 0.5s ease-out;
}

@keyframes fadeInMsg {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 모바일 세로 모드 대응 (위치 조정 필요 시) */
@media (orientation: portrait) {
    .disclaimer-msg {
        bottom: 15px;
        left: 15px;
        font-size: 0.75rem;
        max-width: 80%; /* 너무 길면 줄바꿈 */
        line-height: 1.4;
    }
}