/**
 * 에코걸 갤러리 전용 스타일
 */

/* 페이지 기본 스타일 */
body {
    margin: 0;
    padding: 0;
    background: var(--background);
}

/* 메인 콘텐츠 */
.main-content {
    margin-top: 80px;
    min-height: calc(100vh - 80px);
}

@media (max-width: 768px) {
    .main-content {
        margin-top: 60px;
    }
}

/* 갤러리 헤더 */
.gallery-header {
    text-align: center;
    padding: 3rem 1rem 2rem;
    background: white;
    border-bottom: 1px solid var(--border);
}

.gallery-header h1 {
    font-size: 2rem;
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
}

.gallery-header p {
    color: var(--text-secondary);
    margin: 0;
}

/* Masonry 그리드 컨테이너 */
.masonry-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    padding-bottom: 2rem; /* 푸터와의 간격 */
}

/* 사진 아이템 추가 스타일 - 공용 masonry-item 사용 */

/* 찜하기 버튼 */
.favorite-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    font-size: 1.2rem;
}

.favorite-btn:hover {
    background: white;
    transform: scale(1.1);
}

.favorite-btn.active {
    color: #EF4444;
}

/* 정보 오버레이 */
.photo-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    color: white;
    padding: 1.5rem 0.75rem 0.75rem;
    opacity: 0;
    transition: opacity 0.2s;
    cursor: pointer;
}

.photo-item:hover .photo-info {
    opacity: 1;
}

.girl-name {
    font-weight: 600;
    font-size: 1rem;
    margin: 0;
}

.girl-age {
    font-size: 0.875rem;
    opacity: 0.9;
    margin: 0.25rem 0 0;
}

/* 로딩 스피너 */
.loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    width: 100%;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #E5E7EB;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 에러 메시지 */
.error-message {
    text-align: center;
    padding: 3rem;
    color: var(--text-medium);
}

/* ========== 이미지 모달 ========== */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.image-modal.active {
    display: flex;
}

.modal-content {
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
}

.modal-content img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    display: block;
}

/* 모달 정보 - 오버레이 방식 */
.modal-info {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    border-radius: 25px;
    text-align: center;
    color: white;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: opacity 0.3s;
}

.modal-info:hover {
    background: rgba(0, 0, 0, 0.9);
}

.modal-info h3 {
    margin: 0;
    font-size: 1.2rem;
}

.modal-info p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.9rem;
}

.modal-info .btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    white-space: nowrap;
}

/* 모달 닫기 버튼 */
.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 1.5rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 1001;
}

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

/* 네비게이션 버튼 */
.modal-navigation {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    pointer-events: none;
}

.nav-prev,
.nav-next {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    pointer-events: all;
}

.nav-prev:hover,
.nav-next:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* 무한 스크롤 로딩 */
.loading-more {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    grid-column: 1 / -1;
}

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

/* 완료 메시지 */
.end-message {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* 모바일 반응형 추가 스타일 */
@media (max-width: 768px) {
    .gallery-header h1 {
        font-size: 1.5rem;
    }
    
    .pinterest-grid {
        columns: 2;
    }
    
    /* 모바일에서는 항상 정보 표시 */
    .photo-info {
        opacity: 1;
        padding: 1rem 0.5rem 0.5rem;
    }
    
    .girl-name {
        font-size: 0.875rem;
    }
    
    .girl-age {
        font-size: 0.75rem;
    }
    
    /* 모달 정보 모바일 조정 */
    .modal-info {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0.75rem 1.5rem;
    }
    
    .modal-info h3 {
        font-size: 1rem;
    }
    
    .modal-info p {
        font-size: 0.8rem;
    }
    
    .modal-info .btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
}