/**
 * Lightbox styles for YT Playlist plugin
 * Contains all lightbox/modal functionality styles
 */

/* Main Lightbox Container */
.yt-lightbox,
.yt-lightbox-overlay {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(var(--yt-playlist-lightbox-bg-color-rgb), var(--yt-playlist-lightbox-transparency));
    backdrop-filter: blur(var(--yt-playlist-lightbox-backdrop-filter));
    -webkit-backdrop-filter: blur(var(--yt-playlist-lightbox-backdrop-filter));
}

.yt-lightbox-overlay.yt-lightbox-active {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

/* Lightbox Content Container */
.yt-lightbox-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    animation: lightboxZoom 0.3s ease;
}

@keyframes lightboxZoom {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Close Button - Square Rounded and Right Aligned */
.yt-lightbox-close {
    margin-top: -10px;
    padding-bottom: 13px;
    margin-bottom: 20px;
    background-color: rgba(149,14,124, 0.8) !important;
    color: #fff !important;
    border-radius: 8px !important;
    width: 3rem !important;
    height: 3rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    transition: all 0.3s ease !important;
    position: absolute !important;
    top: -50px !important;
    right: 0 !important;
    font-size: 24px !important;
    line-height: 1 !important;
    text-align: center !important;
    font-weight: bold !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5) !important;
}

.yt-lightbox-close:hover,
.yt-lightbox-close:focus {
    background: var(--yt-primary-color, #2271b1);
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.5);
    outline: none;
}

/* Navigation Arrows */
.yt-lightbox-nav,
.yt-lightbox-prev,
.yt-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(var(--yt-primary-rgb, 34, 113, 177), 0.7);
    color: #fff;
    font-size: 30px;
    padding: 20px 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 5;
    border: 2px solid rgba(255, 255, 255, 0.2);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.yt-lightbox-nav:hover,
.yt-lightbox-prev:hover,
.yt-lightbox-next:hover {
    background: rgba(var(--yt-primary-rgb, 34, 113, 177), 0.9);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-50%) scale(1.05);
}

.yt-lightbox-nav:focus,
.yt-lightbox-prev:focus,
.yt-lightbox-next:focus {
    outline: 2px solid var(--yt-primary-color, #2271b1);
    outline-offset: 2px;
}

.yt-lightbox-nav.prev,
.yt-lightbox-prev {
    left: 20px;
    border-radius: 0 8px 8px 0;
}

.yt-lightbox-nav.next,
.yt-lightbox-next {
    right: 20px;
    border-radius: 8px 0 0 8px;
}

.yt-lightbox-nav.disabled,
.yt-lightbox-prev:disabled,
.yt-lightbox-next:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* Video Container */
.yt-lightbox-video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    background-color: #000;
    border-radius: 12px;
    border: var(--yt-playlist-video-frame-thickness) solid var(--yt-playlist-video-frame-color);
    box-shadow: 0 0 30px rgba(var(--yt-playlist-video-frame-color-rgb), var(--yt-playlist-video-frame-glow));
}

.yt-lightbox-video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    background-color: #000;
    border-radius: 8px;
}

.yt-lightbox-video-wrapper iframe,
.yt-lightbox-video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px;
}

/* Lightbox Info Panel */
.yt-lightbox-info {
    margin-top: 1.5rem;
    color: #fff;
    text-align: center;
}

.yt-lightbox-info h3,
.yt-lightbox-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: normal;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    padding: 0 1rem;
    color: var(--yt-playlist-lightbox-title-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1.4;
}

/* Video Counter */
.yt-lightbox-counter {
    color: #bbb;
    font-size: 1.1rem; /* Aumentado de 0.9rem a 1.1rem */
    margin-top: 0.5rem;
    opacity: 0.9;
    font-weight: 500; /* Agregar peso para mejor visibilidad */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Responsive: aún más grande en pantallas grandes */
@media (min-width: 768px) {
    .yt-lightbox-counter {
        font-size: 1.2rem;
    }
}

.yt-current-index,
.yt-total-videos {
    font-weight: bold;
}

/* Prevent body scroll when lightbox is open */
body.yt-lightbox-open {
    overflow: hidden;
}

/* Loading state */
.yt-lightbox-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 16px;
}

/* Responsive Lightbox */
@media (max-width: 768px) {
    .yt-lightbox-content {
        width: 95%;
        max-width: 95%;
        margin: 20px;
    }
    
    .yt-lightbox-close {
        top: -50px;
        right: 0;
        font-size: 20px;
        width: 40px;
        height: 40px;
        border-radius: 10px;
        background: rgba(var(--yt-primary-rgb, 34, 113, 177), 0.8);
        border: 2px solid rgba(255, 255, 255, 0.3);
    }
    
    .yt-lightbox-close:hover,
    .yt-lightbox-close:focus {
        transform: scale(1.1);
    }
    
    .yt-lightbox-nav,
    .yt-lightbox-prev,
    .yt-lightbox-next {
        font-size: 24px;
        padding: 15px 10px;
    }
    
    .yt-lightbox-nav.prev,
    .yt-lightbox-prev {
        left: 5px;
    }
    
    .yt-lightbox-nav.next,
    .yt-lightbox-next {
        right: 5px;
    }
    
    .yt-lightbox-video-wrapper {
        border-width: 3px;
    }
    
    .yt-lightbox-info h3,
    .yt-lightbox-title {
        font-size: 1rem;
        padding: 0 0.5rem;
        text-transform: none;
        letter-spacing: normal;
    }
    
    .yt-lightbox-counter {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .yt-lightbox-content {
        width: 98%;
        margin: 10px;
    }
    
    .yt-lightbox-close {
        font-size: 18px;
        top: -45px;
        right: 0;
        width: 36px;
        height: 36px;
        border-radius: 8px;
    }
    
    .yt-lightbox-nav,
    .yt-lightbox-prev,
    .yt-lightbox-next {
        font-size: 20px;
        padding: 12px 8px;
    }
    
    .yt-lightbox-video-wrapper {
        border-width: 2px;
        border-radius: 8px;
    }
    
    .yt-lightbox-info {
        margin-top: 1rem;
    }
    
    .yt-lightbox-info h3,
    .yt-lightbox-title {
        font-size: 0.9rem;
        padding: 0 0.25rem;
    }
}

/* Animation states */
.yt-lightbox-overlay {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.yt-lightbox-overlay.yt-lightbox-active {
    opacity: 1;
}

.yt-lightbox-content {
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.yt-lightbox-overlay.yt-lightbox-active .yt-lightbox-content {
    transform: scale(1);
}