/* Premium Single Gallery View styling */

.media-gallery-view-section {
    background-color: #f8fafc;
}

/* Interactive Filter buttons */
.gallery-filter-wrap {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 40px;
}

.gallery-filter-btn {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #475569;
    padding: 8px 24px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.02);
    outline: none !important;
}

.gallery-filter-btn:hover {
    border-color: #1964a2;
    color: #1964a2;
}

.gallery-filter-btn.active-filter {
    background-color: #1964a2;
    border-color: #1964a2;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(25, 100, 162, 0.2);
}

/* Masonry Gallery Grid */
.masonry-gallery {
    column-count: 1;
    column-gap: 20px;
    width: 100%;
}

@media (min-width: 576px) {
    .masonry-gallery {
        column-count: 2;
    }
}

@media (min-width: 992px) {
    .masonry-gallery {
        column-count: 3;
    }
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 20px;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background-color: #0d1f2d;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.masonry-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease, opacity 0.3s ease;
}

.masonry-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.12);
}

.masonry-item:hover img {
    transform: scale(1.05);
}

/* Glassmorphic caption overlay */
.masonry-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(13, 31, 45, 0) 50%, rgba(13, 31, 45, 0.85) 100%);
    opacity: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.masonry-item:hover .masonry-overlay {
    opacity: 1;
}

.masonry-title {
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
    line-height: 1.4;
}

.masonry-subtitle {
    color: #cbd5e1;
    font-size: 12px;
}

/* Video specific button wrapper */
.video-item-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background-color: #ffffff;
    color: #1964a2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    z-index: 3;
    box-shadow: 0 4px 15px rgba(0,0,0,0.25);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.masonry-item:hover .video-item-btn {
    background-color: #1964a2;
    color: #ffffff;
    transform: translate(-50%, -50%) scale(1.12);
}

/* Video popup modal overlay */
.video-popup-modal {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(13, 31, 45, 0.85);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(8px);
}

.popup-modal-content {
    width: 100%;
    max-width: 800px;
    aspect-ratio: 16/9;
    background-color: #0d1f2d;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    border-radius: 12px;
}

.popup-modal-close {
    position: absolute;
    top: -45px;
    right: 0;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 36px;
    font-weight: 300;
    cursor: pointer;
    line-height: 1;
    outline: none !important;
}

.popup-modal-close:hover {
    color: #cbd5e1;
}

/* Lightbox styles */
.lightbox-modal {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(13, 31, 45, 0.95);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
}

.lightbox-content-wrap {
    position: relative;
    max-width: 90%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    animation: zoomEffect 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.lightbox-caption {
    color: #ffffff;
    margin-top: 15px;
    text-align: center;
}

.lightbox-caption h5 {
    margin: 0 0 5px 0;
    font-weight: 700;
    font-size: 16px;
}

.lightbox-caption p {
    margin: 0;
    font-size: 13px;
    color: #cbd5e1;
}

.lightbox-close {
    position: absolute;
    top: -45px;
    right: 0;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 36px;
    cursor: pointer;
    outline: none !important;
}

.lightbox-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #ffffff;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: background-color 0.2s ease;
    outline: none !important;
}

.lightbox-nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-prev {
    left: -70px;
}

.lightbox-next {
    right: -70px;
}

@media (max-width: 768px) {
    .lightbox-prev {
        left: -10px;
        background: rgba(13, 31, 45, 0.6);
    }
    .lightbox-next {
        right: -10px;
        background: rgba(13, 31, 45, 0.6);
    }
}

/* Bootstrap 4 ratio fallback */
.ratio {
    position: relative;
    width: 100%;
}
.ratio-16x9 {
    padding-top: 56.25%;
}
.ratio > iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

@keyframes zoomEffect {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Bottom action buttons spacing on mobile viewports */
.bottom-action-buttons {
    width: 100%;
}

.bottom-action-buttons a {
    margin-bottom: 12px;
    width: 100%;
}

@media (min-width: 576px) {
    .bottom-action-buttons {
        flex-direction: row !important;
    }
    .bottom-action-buttons a {
        margin-bottom: 0;
        width: auto;
    }
}
