/* 기본 초기화 */
body, html { margin: 0; padding: 0; width: 100%; height: 100%; font-family: 'Pretendard', -apple-system, sans-serif; overflow: hidden; }
#main-content { width: 100%; height: 100%; }
#map { width: 100vw; height: 100vh; }

/* 🎬 인트로 화면 스타일 & 슬라이드쇼 페이드 효과 */
#intro-screen { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: #2d3748; /* 사진 로딩 전 기본 배경 */
    display: flex; justify-content: center; align-items: center; z-index: 9999;
    color: white; text-align: center;
    transition: opacity 0.8s ease-in-out; 
}

/* 인트로 배경 사진 공통 레이어 */
.intro-bg {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover; background-position: center;
    opacity: 0;
    transition: opacity 1.5s ease-in-out; /* 사진 변할 때 1.5초 동안 사르륵 변경 */
    z-index: 1;
}
.intro-bg.active { opacity: 1; }

/* 글씨 가독성을 위한 어두운 투명 장막 */
#intro-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.45); /* 사진 위에 45%만큼 어둡게 덮음 */
    z-index: 2;
}

/* 인트로 콘텐츠 글씨 영역 */
.intro-content {
    position: relative; z-index: 3;
    animation: fadeInSlideUp 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    opacity: 0; transform: translateY(30px);
}
@keyframes fadeInSlideUp {
    to { opacity: 1; transform: translateY(0); }
}

.intro-content img { width: 160px; height: 160px; border-radius: 50%; border: 4px solid white; margin-bottom: 20px; box-shadow: 0 10px 20px rgba(0,0,0,0.3); object-fit: cover;}
.intro-content h1 { font-size: 28px; margin-bottom: 10px; text-shadow: 0 2px 5px rgba(0,0,0,0.4); }
.intro-content p { font-size: 16px; opacity: 0.9; margin-bottom: 35px; line-height: 1.6; text-shadow: 0 1px 3px rgba(0,0,0,0.4); }
.intro-content button { 
    background: #ecc94b; color: #744210; border: none; padding: 15px 40px; 
    border-radius: 50px; font-size: 18px; font-weight: bold; cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2); transition: transform 0.3s, background 0.3s;
}
.intro-content button:hover { transform: scale(1.05); background: #f6e05e; }

/* 검색창 스타일 */
#search-container { position: absolute; top: 25px; left: 50%; transform: translateX(-50%); z-index: 1000; background: rgba(255, 255, 255, 0.95); padding: 10px 15px; border-radius: 30px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2); display: flex; gap: 8px; align-items: center; width: max-content; }
#search-input { border: 1px solid #cbd5e0; padding: 8px 15px; border-radius: 20px; outline: none; font-size: 14px; width: 150px; font-family: inherit; }
#search-container button { background: #2b6cb0; color: white; border: none; padding: 8px 15px; border-radius: 20px; cursor: pointer; font-weight: bold; font-size: 13px; font-family: inherit; transition: background 0.2s; }
#search-container button:hover { background: #2c5282; }
#search-container .reset-btn { background: #718096; }
#search-container .reset-btn:hover { background: #4a5568; }

/* 프로필 명함 */
#profile-card { position: absolute; top: 25px; right: 25px; z-index: 1000; background: rgba(255, 255, 255, 0.95); padding: 15px 25px; border-radius: 50px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2); display: flex; align-items: center; gap: 15px; cursor: pointer; transition: transform 0.2s, background 0.2s; }
#profile-card:hover { transform: translateY(-3px); background: #ffffff; }
.profile-pic img { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; border: 2px solid #2b6cb0; }
.profile-info h3 { margin: 0 0 5px 0; font-size: 18px; color: #1a202c; }
.profile-info p { margin: 0; font-size: 14px; color: #718096; }
.profile-info strong { color: #2b6cb0; font-size: 16px; }

/* 말풍선(Popup) 커스텀 */
.custom-popup-content { max-height: 400px; min-width: 320px; overflow-y: auto; padding-right: 10px; }
.custom-popup-content::-webkit-scrollbar { width: 6px; }
.custom-popup-content::-webkit-scrollbar-thumb { background: #cbd5e0; border-radius: 3px; }
.popup-title-link { text-decoration: none; color: #2d3748; transition: color 0.2s; }
.popup-title-link:hover { color: #2b6cb0; text-decoration: underline; }
.popup-height { font-size: 13px; color: #718096; font-weight: normal; }
.popup-address { margin: 0 0 10px 0; font-size: 12px; color: #4a5568; line-height: 1.4; }

.popup-gallery { display: flex; gap: 5px; margin-bottom: 15px; overflow-x: auto; padding-bottom: 5px; }
.popup-gallery img { width: 55px; height: 55px; object-fit: cover; border-radius: 6px; border: 1px solid #e2e8f0; cursor: pointer; }
.popup-gallery img:hover { filter: brightness(0.8); }

.info-section { font-size: 12px; line-height: 1.6; color: #4a5568; border-top: 1px solid #e2e8f0; padding-top: 15px; }
.info-section p { margin: 0 0 10px 0; }
.info-section strong { color: #2b6cb0; display: block; margin-bottom: 2px; }
.course-table table { width: 100%; border-collapse: collapse; margin-top: 5px; background: #f7fafc; }
.course-table th { background: #edf2f7; border: 1px solid #cbd5e0; padding: 6px; text-align: center; color: #2d3748; font-weight: bold; }
.course-table td { border: 1px solid #cbd5e0; padding: 6px; }

/* 모달 및 뷰어 */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.7); z-index: 2000; }
.modal-content { background: white; margin: 10% auto; padding: 30px; width: 80%; max-width: 450px; border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,0.3); position: relative; }
.close-btn { position: absolute; top: 15px; right: 20px; cursor: pointer; font-size: 28px; color: #a0aec0; transition: color 0.2s; }
.close-btn:hover { color: #2d3748; }
.animate-popup { animation: scaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes scaleUp { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.modal-profile-header { display: flex; align-items: center; gap: 20px; margin-bottom: 15px; }
.modal-pic { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 3px solid #2b6cb0; transition: transform 0.2s; }
.modal-pic:hover { transform: scale(1.05); }
.modal-profile-header h2 { margin: 0; font-size: 22px; color: #2d3748; }
.profile-greeting { font-style: italic; color: #4a5568; background: #f7fafc; padding: 15px; border-radius: 8px; margin-top: 20px; font-size: 14px; text-align: center; line-height: 1.6; }

.photo-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; max-height: 60vh; overflow-y: auto; padding: 10px; }
.photo-grid img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 5px rgba(0,0,0,0.1); transition: transform 0.2s; }
.photo-grid img:hover { transform: scale(1.05); }

#image-viewer { background-color: rgba(0,0,0,0.9); z-index: 3000; text-align: center; }
.viewer-content { margin: auto; display: block; max-width: 90%; max-height: 90%; position: relative; top: 50%; transform: translateY(-50%); border-radius: 10px; box-shadow: 0 0 20px rgba(0,0,0,0.5); }
.close-viewer { position: absolute; top: 20px; right: 35px; color: #f1f1f1; font-size: 40px; font-weight: bold; cursor: pointer; }

/* 📱 모바일 대응 (갤럭시 S25 최적화) */
@media (max-width: 768px) {
    #search-container { top: 12px; width: 85%; padding: 6px 12px; gap: 5px; border-radius: 25px; box-sizing: border-box; }
    #search-input { flex: 1; width: auto; padding: 6px 10px; font-size: 13px; }
    #search-container button { padding: 6px 10px; font-size: 12px; }

    #profile-card { padding: 10px 18px; top: auto; bottom: 25px; right: 15px; gap: 12px; border-radius: 35px; }
    .profile-pic img { width: 48px; height: 48px; border-width: 2px; }
    .profile-info h3 { margin-bottom: 3px; font-size: 15px; font-weight: 600; }
    .profile-info p { font-size: 12px; }
    .profile-info strong { font-size: 13px; }
    
    .custom-popup-content { min-width: 260px; max-height: 350px; }
    .photo-grid { grid-template-columns: repeat(3, 1fr); } 
}