/* 기본 스타일 리셋 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    background-color: #ffffff;
}

/* 기본 폰트 및 색상 설정 */
:root {
    --primary-color: #28eb25;
    --secondary-color: #535353;
    --accent-color: #28eb25;
    --bg-color: #ffffff;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
}

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: #ffffff;
    overflow-x: hidden;
    min-height: 100vh;
}

/* 헤더 스타일 */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.back-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.back-btn:hover {
    background: var(--accent-color);
    transform: translateY(-1px);
}

.exhibition-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.exhibition-info {
    display: flex;
    gap: 2rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.exhibition-period,
.exhibition-location {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.exhibition-period::before {
    content: '📅';
}

.exhibition-location::before {
    content: '📍';
}

.exhibition-description {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(40, 235, 37, 0.05);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-primary);
}

/* 메인 컨텐츠 */
.main-content {
    margin-top: 120px;
    padding: 2rem;
    min-height: calc(100vh - 120px);
    background-color: #ffffff;
}

/* 미디어 컨테이너 - 새로운 갤러리 */
.media-container {
    position: relative;
    width: 100%;
    min-height: calc(100vh - 120px);
    padding: 0;
    background-color: #ffffff;
    overflow: visible;
}

/* 슬라이더 컨테이너 추가 스타일 */
.media-container .slider-container {
    overflow: hidden;
}

/* 미디어 아이템 공통 스타일 */
.media-item {
    position: absolute;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    background: white;
}

.media-item:hover {
    transform: scale(1.03) rotate(0.5deg);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.12);
    z-index: 10;
}

/* 사진 아이템 */
.photo-item {
    background: white;
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.photo-item:hover img {
    transform: scale(1.1);
    filter: brightness(1.05);
}

/* 영상 아이템 */
.video-item {
    background: #f0f0f0; /* 더 밝은 배경색 */
    position: relative;
}

.video-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
    background-color: #f0f0f0; /* 비디오 배경색 */
}

/* 비디오 첫 프레임이 로드되기 전 배경 */
.video-item video {
    background-color: #222; /* 어두운 배경으로 변경 */
}

.video-item:hover video {
    transform: scale(1.05);
    filter: brightness(1.1) contrast(1.05);
}

/* 영상 재생 버튼 */
.video-item::before {
    content: '▶';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    opacity: var(--play-icon-opacity, 0.8);
    transition: all 0.3s ease;
    z-index: 2;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.video-item:hover::before {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
    background: rgba(0, 0, 0, 0.9);
}

/* 영상 클릭 힌트 */
.video-item::after {
    content: '클릭하여 확대';
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
    white-space: nowrap;
}

.video-item:hover::after {
    opacity: 1;
}

/* 로딩 스타일 */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    transition: opacity 0.3s ease;
}

.loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    .header {
        padding: 1rem;
    }
    
    .header-left {
        gap: 0.5rem;
    }
    
    .back-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .exhibition-title {
        font-size: 1.4rem;
    }
    
    .exhibition-info {
        flex-direction: column;
        gap: 0.5rem;
        font-size: 0.8rem;
    }
    
    .exhibition-description {
        font-size: 0.8rem;
        padding: 0.8rem;
        margin-top: 0.8rem;
    }
    
    .main-content {
        margin-top: 120px;
        padding: 1rem;
        background-color: #ffffff;
    }
    
    .media-container {
        padding: 0.5rem 0;
        background-color: #ffffff;
        height: calc(100vh - 180px);
        min-height: 400px;
    }
    
    .slide-item {
        padding: 10px;
    }
    
    .slider-nav {
        bottom: 10px;
        gap: 8px;
    }
    
    .slider-btn {
        width: 35px;
        height: 35px;
        font-size: 20px;
    }
    
    .slider-indicator {
        padding: 6px 12px;
        font-size: 12px;
        min-width: 60px;
    }
    
    /* 모바일에서 하단 썸네일 미리보기 조정 */
    .bottom-thumbnail-preview {
        bottom: 90px;
        width: 95%;
        height: 70px;
        padding: 8px;
    }
    
    .bottom-thumbnail-item {
        flex: 0 0 50px;
        height: 50px;
    }
    
    .slide-item {
        padding: 15px 15px 120px 15px;
    }
    
    .close-btn {
        width: 35px;
        height: 35px;
        font-size: 1.5rem;
    }
    
    /* 모바일에서 영상 재생 버튼 크기 조정 */
    .video-item::before {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    /* 모바일에서 영상 클릭 힌트 조정 */
    .video-item::after {
        font-size: 0.6rem;
        padding: 3px 6px;
        bottom: 5px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 0.8rem;
    }
    
    .header-left {
        gap: 0.3rem;
    }
    
    .back-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.7rem;
    }
    
    .exhibition-title {
        font-size: 1.2rem;
    }
    
    .exhibition-info {
        font-size: 0.7rem;
    }
    
    .exhibition-description {
        font-size: 0.75rem;
        padding: 0.6rem;
        margin-top: 0.6rem;
    }
    
    .main-content {
        margin-top: 110px;
        padding: 0.5rem;
        background-color: #ffffff;
    }
    
    .media-container {
        padding: 0.5rem 0;
        background-color: #ffffff;
        height: calc(100vh - 160px);
        min-height: 350px;
    }
    
    .close-btn {
        width: 30px;
        height: 30px;
        font-size: 1.2rem;
    }
}

/* 슬라이더 스타일 */
.slider-container {
    display: flex;
    transition: transform 0.3s ease;
    height: 100%;
    width: 100%;
    position: relative;
}

.slide-item {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    position: relative;
}

/* 모바일에서 슬라이드 아이템 조정 */
@media (max-width: 768px) {
    .slide-item {
        padding: 15px 15px 120px 15px;
    }
}

.slide-item img {
    max-width: 90%;
    max-height: 80%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.3s ease;
    display: block;
}

.slide-item img:hover {
    transform: scale(1.02);
}

/* 모바일에서 이미지 크기 조정 */
@media (max-width: 768px) {
    .slide-item img {
        max-width: 95%;
        max-height: 85%;
    }
}

/* 영상 크기 조정 */
.slide-item video {
    max-width: 80%;
    max-height: 70%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    background-color: #f8f9fa; /* 로딩 시 배경색 */
}

/* 슬라이더 비디오 로딩 중 스타일 */
.slide-item video {
    background-color: #333; /* 비디오 로딩 중 배경 */
}

/* 모바일에서 영상 크기 조정 */
@media (max-width: 768px) {
    .slide-item video {
        max-width: 90%;
        max-height: 80%;
    }
}

/* 미리보기 탭 스타일 */
.bottom-thumbnails {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    padding: 10px;
    overflow-x: auto;
    white-space: nowrap;
    z-index: 1000;
    display: flex;
    justify-content: center;
}

.bottom-thumbnails-container {
    display: flex;
    gap: 10px;
    align-items: center;
    min-width: 0;
    max-width: 100%;
}

.bottom-thumbnail-item {
    flex: 0 0 auto;
    width: 60px;
    height: 60px;
    border: 2px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #333;
}

.bottom-thumbnail-item img,
.bottom-thumbnail-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background-color: #666; /* 로딩 시 배경색 */
}

/* 썸네일 비디오 로딩 중 스타일 */
.bottom-thumbnail-item video {
    background-color: #333; /* 비디오 로딩 중 배경 */
}

.bottom-thumbnail-item.active {
    border-color: #28eb25;
}

/* 미리보기 탭 스크롤 방지 */
.bottom-thumbnails::-webkit-scrollbar {
    display: none;
}

.bottom-thumbnails {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.slider-nav {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 100;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px 15px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
}

.slider-btn {
    background: rgba(40, 235, 37, 0.9);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-btn:hover {
    background: rgba(40, 235, 37, 1);
    transform: scale(1.1);
}

.slider-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.slider-indicator {
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* 하단 썸네일 미리보기 스타일 (아이폰 사진 앱 스타일) */
.bottom-thumbnail-preview {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 600px;
    height: 80px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 20px;
    padding: 10px;
    backdrop-filter: blur(10px);
    z-index: 100;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
    justify-content: flex-start;
    align-items: center;
}

.bottom-thumbnail-preview::-webkit-scrollbar {
    display: none;
}

.bottom-thumbnail-item {
    flex: 0 0 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    background: #333;
    margin: 0 4px;
}

.bottom-thumbnail-item:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.bottom-thumbnail-item.active {
    border-color: #28eb25;
    transform: scale(1.05);
}

/* 모바일에서 하단 썸네일 미리보기 조정 */
@media (max-width: 768px) {
    .bottom-thumbnail-preview {
        bottom: 90px;
        width: 95%;
        height: 70px;
        padding: 8px;
        gap: 6px;
    }
    
    .bottom-thumbnail-item {
        flex: 0 0 50px;
        height: 50px;
        margin: 0 3px;
    }
}

/* 애니메이션 효과 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.slide-item {
    animation: fadeInScale 0.8s ease-out;
}

/* 영상 모달 스타일 */
.video-modal video {
    border-radius: 8px;
    filter: brightness(1.2) contrast(1.1);
}

.video-modal video::-webkit-media-controls {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}

.video-modal video::-webkit-media-controls-panel {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
}

/* 영상 모달 컨테이너 개선 */
.video-modal .video-container {
    background: #000;
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* 스크롤바 스타일링 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

/* 부드러운 스크롤 */
html {
    scroll-behavior: smooth;
}

/* ===========================================
   새로운 모던 갤러리 디자인
   =========================================== */

/* 전시소개 탭 기본 스타일 */
.tab-content#exhibition-intro {
    padding: 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: calc(100vh - 200px);
    max-height: none;
    border-radius: 0 0 20px 20px;
    overflow-y: visible;
}

/* 미디어 컨테이너에 갤러리 배경 적용 */
.media-container {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
}

/* 갤러리 컨테이너 */
.modern-gallery {
    padding: 100px 40px 150px 40px;
    max-width: 1400px;
    margin: 0 auto;
}

/* 갤러리 헤더 */
.gallery-header {
    text-align: center;
    margin-bottom: 50px;
    animation: fadeInUp 0.8s ease-out;
}

.gallery-title {
    font-size: 2.8rem;
    font-weight: 200;
    color: #2c3e50;
    margin-bottom: 15px;
    letter-spacing: -0.02em;
    position: relative;
}

.gallery-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), #20c997);
    border-radius: 2px;
}

.gallery-subtitle {
    font-size: 1.2rem;
    color: #6c757d;
    font-weight: 300;
    margin-top: 20px;
}

/* 마사지 그리드 레이아웃 */
.masonry-grid {
    columns: 4;
    column-gap: 30px;
    margin-top: 0;
}

@media (max-width: 1200px) {
    .masonry-grid { 
        columns: 3; 
        column-gap: 25px;
    }
    .modern-gallery {
        padding: 80px 30px 100px 30px;
    }
}

@media (max-width: 768px) {
    .masonry-grid { 
        columns: 2; 
        column-gap: 20px;
    }
    .modern-gallery {
        padding: 70px 20px 80px 20px;
    }
}

@media (max-width: 480px) {
    .masonry-grid { 
        columns: 1; 
        column-gap: 0;
    }
    .modern-gallery {
        padding: 60px 15px 60px 15px;
    }
}

/* 갤러리 아이템 */
.gallery-item {
    break-inside: avoid;
    margin-bottom: 30px;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    position: relative;
    opacity: 0;
    animation: fadeInScale 0.6s ease-out forwards;
}

.gallery-item:nth-child(1) { animation-delay: 0.1s; }
.gallery-item:nth-child(2) { animation-delay: 0.2s; }
.gallery-item:nth-child(3) { animation-delay: 0.3s; }
.gallery-item:nth-child(4) { animation-delay: 0.4s; }
.gallery-item:nth-child(5) { animation-delay: 0.5s; }
.gallery-item:nth-child(6) { animation-delay: 0.6s; }
.gallery-item:nth-child(7) { animation-delay: 0.7s; }
.gallery-item:nth-child(8) { animation-delay: 0.8s; }

.gallery-item:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.gallery-item img,
.gallery-item video {
    width: 100%;
    height: auto;
    display: block;
    transition: all 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
    background-color: #f8f9fa; /* 로딩 시 배경색 */
}

/* 갤러리 비디오 기본 스타일 */
.gallery-item video {
    background-color: #333; /* 비디오 로딩 중 배경 */
}

.gallery-item:hover img,
.gallery-item:hover video {
    transform: scale(1.1);
    filter: brightness(1.1) saturate(1.2);
}

/* 비디오 오버레이 */
.video-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    backdrop-filter: blur(15px);
    transition: all 0.4s ease;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.gallery-item:hover .video-overlay {
    background: rgba(0, 0, 0, 0.8);
    transform: translate(-50%, -50%) scale(1.15);
    border-color: var(--primary-color);
}

/* 로딩 애니메이션 */
.loading-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
    border-radius: 20px;
}

/* 애니메이션 키프레임 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* 새로운 라이트박스 모달 */
.modern-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    backdrop-filter: blur(20px);
}

.modern-lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
    transform: scale(0.8);
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.modern-lightbox.active .lightbox-content {
    transform: scale(1);
}

.lightbox-content img,
.lightbox-content video {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: -50px;
    right: -10px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}
