/* =============================================================================
   GALERIA DE IMAGENS E VÍDEOS (ABA COMPLETA)
   Caminho: front/pages/club/css/galeria.css
   ============================================================================= */

.club-gallery-grid-full {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.gallery-item-card {
    border-radius: var(--radius-card);
    overflow: hidden;
    aspect-ratio: 4 / 3;
    cursor: pointer;
    position: relative;
    border: 1px solid var(--border-color);
    background-color: #ffffff;
}

.gallery-item-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-item-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.75rem 1rem;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.8) 0%, rgba(15, 23, 42, 0) 100%);
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 700;
}

/* Lightbox de Imagens e Vídeos (React/SaaS Style) */
.gallery-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-lightbox-overlay.active {
    display: flex;
    opacity: 1;
}

/* Instagram-Style Modal Container */
.instagram-modal-container {
    display: flex;
    flex-direction: row;
    width: 90%;
    max-width: 1040px;
    height: 75vh;
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    border: none;
    position: relative;
}

.instagram-media-side {
    flex: 1 1 68%;
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    height: 100%;
}

.lightbox-media-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-media-container img,
.lightbox-media-container video,
.lightbox-media-container iframe {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border: none;
    display: block;
}

.instagram-info-side {
    width: 320px;
    flex-shrink: 0;
    background: #ffffff;
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.instagram-info-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.instagram-club-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.instagram-club-meta {
    display: flex;
    flex-direction: column;
}

.instagram-club-name {
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 700;
}

.instagram-media-type {
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.instagram-info-body {
    padding: 1.25rem 1rem;
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.instagram-media-title {
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.01em;
}

.instagram-media-description {
    color: var(--text-main);
    font-size: 0.825rem;
    line-height: 1.4;
}

.instagram-info-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lightbox-media-counter {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}

.lightbox-close-btn {
    position: absolute;
    top: 24px;
    right: 24px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.15);
    color: #000000;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 300;
    transition: all 0.25s ease;
    z-index: 10010;
    line-height: 1;
}

.lightbox-close-btn:hover {
    background: #000000;
    color: #ffffff;
    border-color: #000000;
}

.lightbox-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #000000;
    font-size: 1.15rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10005;
}

.lightbox-nav-arrow:hover {
    background: #000000;
    color: #ffffff;
    border-color: #000000;
}

.lightbox-nav-arrow.prev {
    left: 16px;
}

.lightbox-nav-arrow.next {
    right: 16px;
}

@media (max-width: 992px) {
    .lightbox-nav-arrow {
        width: 38px;
        height: 38px;
        font-size: 0.95rem;
    }
}

@media (max-width: 768px) {
    .instagram-modal-container {
        flex-direction: column;
        height: auto;
        max-height: 85vh;
        width: 92%;
    }
    
    .instagram-media-side {
        aspect-ratio: 16 / 9;
        height: auto;
        flex: none;
    }
    
    .instagram-info-side {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--border-color);
        height: auto;
    }
    
    .lightbox-nav-arrow {
        display: flex !important;
        width: 36px;
        height: 36px;
        font-size: 0.85rem;
    }
    
    .lightbox-nav-arrow.prev {
        left: 8px;
    }
    
    .lightbox-nav-arrow.next {
        right: 8px;
    }
    
    .lightbox-close-btn {
        top: 16px;
        right: 16px;
        width: 36px;
        height: 36px;
        font-size: 1.5rem;
    }
}

/* Botão Play estilo Backoffice */
.gallery-item-card.video-item {
    position: relative;
}

.video-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.5);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 14px;
    padding-left: 2px; /* Correção ótica para alinhar triângulo */
    pointer-events: none;
    z-index: 2;
    transition: background 0.2s ease;
}

.gallery-item-card:hover .video-play-overlay {
    background: rgba(0, 0, 0, 0.75);
}

/* Prevenir scroll na página por trás da Lightbox */
body.lightbox-open {
    overflow: hidden !important;
    height: 100vh !important;
}
