/**
 * Estilos do Lightbox para a galeria de imagens
 *
 * @package Cinema_Filmes_Manager
 */

.cfm-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.cfm-lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cfm-lightbox-img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.cfm-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.cfm-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.cfm-lightbox-prev,
.cfm-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.cfm-lightbox-prev {
    left: 20px;
}

.cfm-lightbox-next {
    right: 20px;
}

.cfm-lightbox-prev:hover,
.cfm-lightbox-next:hover {
    background: rgba(255, 255, 255, 0.2);
}

.cfm-lightbox-caption {
    position: absolute;
    bottom: -40px;
    left: 0;
    right: 0;
    text-align: center;
    color: #fff;
    font-size: 14px;
    padding: 10px;
}

/* Animações */
@keyframes cfm-lightbox-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes cfm-lightbox-fade-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

.cfm-lightbox.fade-in {
    animation: cfm-lightbox-fade-in 0.3s ease forwards;
}

.cfm-lightbox.fade-out {
    animation: cfm-lightbox-fade-out 0.3s ease forwards;
}

/* Responsividade */
@media (max-width: 768px) {
    .cfm-lightbox-prev,
    .cfm-lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .cfm-lightbox-close {
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
        font-size: 20px;
    }

    .cfm-lightbox-caption {
        bottom: -30px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .cfm-lightbox-prev,
    .cfm-lightbox-next {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .cfm-lightbox-prev {
        left: 10px;
    }

    .cfm-lightbox-next {
        right: 10px;
    }
}

/* Suporte a Dark Mode */
@media (prefers-color-scheme: dark) {
    .cfm-lightbox {
        background: rgba(0, 0, 0, 0.95);
    }

    .cfm-lightbox-close,
    .cfm-lightbox-prev,
    .cfm-lightbox-next {
        background: rgba(255, 255, 255, 0.15);
    }

    .cfm-lightbox-close:hover,
    .cfm-lightbox-prev:hover,
    .cfm-lightbox-next:hover {
        background: rgba(255, 255, 255, 0.25);
    }
}

/* Popup da galeria */
.cfm-popup-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s;
}

.cfm-popup-img {
    max-width: 90vw;
    max-height: 80vh;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    background: #fff;
    border: 3px solid #fff;
    animation: zoomIn 0.2s;
}

.cfm-popup-close {
    position: absolute;
    top: 32px;
    right: 48px;
    font-size: 2.2rem;
    color: #fff;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 10000;
    font-weight: bold;
    transition: color 0.2s;
}

.cfm-popup-close:hover {
    color: #FFC000;
}

/* Botões de navegação */
.cfm-popup-prev,
.cfm-popup-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    border: 2px solid rgba(255,255,255,0.5);
    color: #fff;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    z-index: 10000;
}

.cfm-popup-prev {
    left: 20px;
}

.cfm-popup-next {
    right: 20px;
}

.cfm-popup-prev:hover,
.cfm-popup-next:hover {
    background: rgba(0,0,0,0.7);
    border-color: #fff;
}

/* Contador de imagens */
.cfm-popup-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.9rem;
}

/* Animações */
@keyframes fadeIn {
    from { opacity: 0; } 
    to { opacity: 1; }
}

@keyframes zoomIn {
    from { transform: scale(0.95); opacity: 0.7; } 
    to { transform: scale(1); opacity: 1; }
}

/* Prevenir scroll do body quando o lightbox está aberto */
body.cfm-no-scroll {
    overflow: hidden;
} 