/* ===================================================================
   BTK Reference Lightbox — index.html 갤러리와 동일한 GLightbox 스타일
   =================================================================== */

.glightbox-container .gcontainer {
    height: 100vh !important;
    height: 100dvh !important;
}

.glightbox-container .gslide {
    height: 100vh !important;
    height: 100dvh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.glightbox-container .gslide-inner-content {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    max-width: 100vw !important;
}

.glightbox-container .gslide-media {
    width: 100% !important;
    max-width: 100vw !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 1 1 auto !important;
}

.glightbox-container .gslide-image {
    align-items: center !important;
    justify-content: center !important;
}

.glightbox-container .gslide-image img {
    max-width: 95vw !important;
    max-height: 90vh !important;
    max-height: 90dvh !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    margin: auto !important;
}

.glightbox-container .gslide-description {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    padding: 8px 14px !important;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7)) !important;
    flex: 0 0 auto !important;
}

.glightbox-container .gslide-title {
    font-size: 0.75rem !important;
    color: rgba(255, 255, 255, 0.85) !important;
    margin: 0 !important;
}

.glightbox-container .gslide-desc {
    display: none !important;
}

/* 참조 패널 — 선택된 카드 확대 버튼 (index preview-link 스타일) */
.btk-ref-card-zoom {
    position: absolute;
    bottom: 8px;
    left: 8px;
    z-index: 4;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 1rem;
    line-height: 1;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
    transition: background 0.2s ease, transform 0.15s ease;
}

.btk-ref-card-zoom:hover,
.btk-ref-card-zoom:focus-visible {
    background: rgba(183, 78, 145, 0.85);
    transform: scale(1.06);
    outline: none;
}

.btk-ref-card-zoom:active {
    transform: scale(0.96);
}

.style-ref-card.selected .btk-ref-card-zoom,
.motion-video-card.selected .btk-ref-card-zoom {
    display: flex;
}

/* 푸터 확대 버튼 */
.btk-ref-footer-actions {
    display: flex;
    gap: 8px;
    width: 100%;
}

.btk-ref-zoom-btn {
    appearance: none;
    -webkit-appearance: none;
    flex: 0 0 auto;
    min-width: 52px;
    padding: 13px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 1.05rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease, transform 0.15s ease;
}

.btk-ref-zoom-btn:not(:disabled):hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(183, 78, 145, 0.45);
}

.btk-ref-zoom-btn:not(:disabled):active {
    transform: scale(0.97);
}

.btk-ref-zoom-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.style-ref-footer-actions .style-ref-apply-btn,
.btk-ref-footer-actions .style-ref-apply-btn,
.motion-video-footer-actions .motion-video-apply-btn {
    flex: 1;
    width: auto;
}

/* 비디오 확대 모달 (갤러리와 동일 패턴) */
#btk-ref-video-modal {
    position: fixed;
    inset: 0;
    z-index: 10050;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    box-sizing: border-box;
}

#btk-ref-video-modal .btk-ref-video-box {
    position: relative;
    width: min(95vw, calc(90dvh * 3 / 4));
    height: min(90dvh, calc(95vw * 4 / 3));
    max-width: 95vw;
    max-height: 90dvh;
    aspect-ratio: 3 / 4;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

#btk-ref-video-modal video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

#btk-ref-video-modal .btk-ref-video-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

#btk-ref-video-modal .btk-ref-video-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px 14px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.75rem;
    text-align: center;
    pointer-events: none;
}

@media (max-width: 480px) {
    .btk-ref-card-zoom {
        width: 38px;
        height: 38px;
        font-size: 1.05rem;
    }
}
