/* Content Lightbox - Estilos para el lightbox de galería multimedia */

.content-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: scale(0.95);
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.lightbox-container {
    position: relative;
    width: 90%;
    height: 90%;
    max-width: 1200px;
    max-height: 800px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Botón cerrar */
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10002;
    backdrop-filter: blur(10px);
    touch-action: manipulation;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

.lightbox-close:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.3);
}

/* Contador */
.lightbox-counter {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10001;
    backdrop-filter: blur(10px);
}

/* Contenido principal */
.lightbox-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 80px 80px;
}

.lightbox-media-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Imágenes */
.lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* Videos */
.lightbox-video {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* Navegación desktop */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10001;
    backdrop-filter: blur(10px);
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

/* Indicadores móviles */
.lightbox-indicators {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10001;
}

.lightbox-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
}

.lightbox-dot.active {
    background: white;
    transform: scale(1.2);
}

.lightbox-dot:hover {
    background: rgba(255, 255, 255, 0.7);
}

/* Overlay para videos en galería */
.video-lightbox-overlay {
    transition: opacity 0.3s ease !important;
}

.video-lightbox-overlay:hover .video-expand-icon {
    transform: scale(1.1);
}

.video-expand-icon {
    transition: transform 0.3s ease;
}

/* Responsive Design */

/* Tablets */
@media (max-width: 1024px) {
    .lightbox-content {
        padding: 60px 40px 80px;
    }
    
    .lightbox-nav {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    
    .lightbox-prev {
        left: 15px;
    }
    
    .lightbox-next {
        right: 15px;
    }
}

/* Móviles */
@media (max-width: 768px) {
    .lightbox-container {
        width: 95%;
        height: 95%;
    }
    
    .lightbox-content {
        padding: 50px 20px 70px;
    }
    
    .lightbox-close {
        top: 15px;
        right: 15px;
        width: 36px;
        height: 36px;
        font-size: 18px;
        z-index: 10002;
    }
    
    .lightbox-counter {
        top: 15px;
        font-size: 13px;
        padding: 6px 12px;
    }
    
    /* Ocultar completamente navegación con flechas en móviles */
    .lightbox-nav {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
    
    /* Hacer los indicadores más grandes en móviles */
    .lightbox-indicators {
        bottom: 20px;
        gap: 12px;
    }
    
    .lightbox-dot {
        width: 10px;
        height: 10px;
        touch-action: manipulation;
    }
}

/* Móviles pequeños */
@media (max-width: 480px) {
    .lightbox-content {
        padding: 40px 15px 60px;
    }
    
    .lightbox-close {
        top: 10px;
        right: 10px;
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .lightbox-counter {
        top: 10px;
        font-size: 12px;
        padding: 5px 10px;
    }
    
    .lightbox-indicators {
        bottom: 15px;
    }
}

/* Animaciones */
@keyframes lightboxFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes lightboxFadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.9);
    }
}

/* Estados de carga */
.lightbox-image,
.lightbox-video {
    opacity: 0;
    animation: fadeInMedia 0.3s ease forwards;
}

@keyframes fadeInMedia {
    to {
        opacity: 1;
    }
}

/* Mejoras de accesibilidad */
.lightbox-close:focus,
.lightbox-nav:focus,
.lightbox-dot:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Modo oscuro mejorado */
@media (prefers-color-scheme: dark) {
    .content-lightbox {
        background: rgba(0, 0, 0, 0.98);
    }
    
    .lightbox-counter {
        background: rgba(0, 0, 0, 0.8);
    }
}

/* Soporte para dispositivos con notch */
@supports (padding: max(0px)) {
    .lightbox-close {
        top: max(20px, env(safe-area-inset-top));
        right: max(20px, env(safe-area-inset-right));
    }
    
    .lightbox-counter {
        top: max(20px, env(safe-area-inset-top));
    }
    
    .lightbox-prev {
        left: max(20px, env(safe-area-inset-left));
    }
    
    .lightbox-next {
        right: max(20px, env(safe-area-inset-right));
    }
    
    .lightbox-indicators {
        bottom: max(30px, env(safe-area-inset-bottom));
    }
}

/* Optimizaciones de rendimiento */
.content-lightbox * {
    will-change: transform, opacity;
}

.lightbox-image,
.lightbox-video {
    transform: translateZ(0); /* Forzar aceleración por hardware */
}

/* Prevenir selección de texto */
.content-lightbox {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Cursor personalizado para navegación */
.lightbox-media-container {
    cursor: grab;
}

.lightbox-media-container:active {
    cursor: grabbing;
}