/* ============================================
   Video Gallery Widget - Base Styles
   ============================================ */

.unlockafe-video-gallery-wrapper {
    display: grid;
    width: 100%;
    gap: 20px;
}

/* Grid Layout */
.unlockafe-video-gallery-wrapper.unlockafe-gallery-grid {
    display: grid !important;
}

.unlockafe-video-gallery-wrapper.unlockafe-gallery-grid.unlockafe-gallery-cols-1 {
    grid-template-columns: repeat(1, 1fr) !important;
}

.unlockafe-video-gallery-wrapper.unlockafe-gallery-grid.unlockafe-gallery-cols-2 {
    grid-template-columns: repeat(2, 1fr) !important;
}

.unlockafe-video-gallery-wrapper.unlockafe-gallery-grid.unlockafe-gallery-cols-3 {
    grid-template-columns: repeat(3, 1fr) !important;
}

.unlockafe-video-gallery-wrapper.unlockafe-gallery-grid.unlockafe-gallery-cols-4 {
    grid-template-columns: repeat(4, 1fr) !important;
}

.unlockafe-video-gallery-wrapper.unlockafe-gallery-grid.unlockafe-gallery-cols-5 {
    grid-template-columns: repeat(5, 1fr) !important;
}

.unlockafe-video-gallery-wrapper.unlockafe-gallery-grid.unlockafe-gallery-cols-6 {
    grid-template-columns: repeat(6, 1fr) !important;
}

/* Masonry Layout */
.unlockafe-gallery-masonry {
    column-count: 3;
    column-gap: 20px;
}

.unlockafe-gallery-masonry.unlockafe-gallery-cols-1 {
    column-count: 1;
}

.unlockafe-gallery-masonry.unlockafe-gallery-cols-2 {
    column-count: 2;
}

.unlockafe-gallery-masonry.unlockafe-gallery-cols-3 {
    column-count: 3;
}

.unlockafe-gallery-masonry.unlockafe-gallery-cols-4 {
    column-count: 4;
}

.unlockafe-gallery-masonry.unlockafe-gallery-cols-5 {
    column-count: 5;
}

.unlockafe-gallery-masonry.unlockafe-gallery-cols-6 {
    column-count: 6;
}

.unlockafe-gallery-masonry .unlockafe-video-item {
    break-inside: avoid;
    margin-bottom: 20px;
    display: inline-block;
    width: 100%;
}

/* Carousel Layout */
.unlockafe-video-gallery-wrapper.unlockafe-gallery-carousel {
    position: relative;
    width: 100%;
    display: flex !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
    gap: 0;
}

.unlockafe-video-gallery-wrapper.unlockafe-gallery-carousel::-webkit-scrollbar {
    display: none;
}

.unlockafe-video-gallery-wrapper.unlockafe-gallery-carousel .unlockafe-video-item {
    flex: 0 0 auto;
    scroll-snap-align: start;
    margin-right: 20px;
    /* Width is set dynamically by JavaScript based on items per view */
}

/* Carousel Navigation - Position relative to widget wrapper */
.elementor-widget-unlockafe-video-gallery {
    position: relative !important;
}

.elementor-widget-unlockafe-video-gallery .unlockafe-carousel-nav {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 100;
    width: 100%;
    height: 100%;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.unlockafe-carousel-prev,
.unlockafe-carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #333;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    pointer-events: all;
    z-index: 11;
    outline: none;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Ensure icon is visible inside arrow buttons */
.unlockafe-carousel-prev i,
.unlockafe-carousel-next i,
.elementor-widget-unlockafe-video-gallery .unlockafe-carousel-prev i,
.elementor-widget-unlockafe-video-gallery .unlockafe-carousel-next i {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: #333 !important;
    font-size: 18px !important;
    line-height: 1 !important;
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", "Font Awesome 5 Free", "Font Awesome 5 Pro", "FontAwesome" !important;
    font-weight: 900 !important;
    pointer-events: none !important;
}

.unlockafe-carousel-prev {
    left: 15px;
}

.unlockafe-carousel-next {
    right: 15px;
    left: auto;
}

/* Arrow margins will be customized via Elementor controls */
.elementor-widget-unlockafe-video-gallery .unlockafe-carousel-prev {
    /* Default margin, can be overridden by Elementor controls */
}

.elementor-widget-unlockafe-video-gallery .unlockafe-carousel-next {
    /* Default margin, can be overridden by Elementor controls */
}

.unlockafe-carousel-prev:hover,
.unlockafe-carousel-next:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.unlockafe-carousel-prev:active,
.unlockafe-carousel-next:active {
    transform: translateY(-50%) scale(0.95);
}

.unlockafe-carousel-prev:active i,
.unlockafe-carousel-next:active i,
.unlockafe-carousel-prev:focus i,
.unlockafe-carousel-next:focus i {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: #333 !important;
}

.unlockafe-carousel-prev.disabled,
.unlockafe-carousel-next.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* With infinite loop, buttons are never disabled - but keep style for compatibility */
.elementor-widget-unlockafe-video-gallery .unlockafe-carousel-prev.disabled,
.elementor-widget-unlockafe-video-gallery .unlockafe-carousel-next.disabled {
    opacity: 1;
    cursor: pointer;
    pointer-events: all;
}

/* Responsive Carousel - Item widths are handled dynamically by JavaScript */

/* Ensure arrows are always visible on all devices */
.elementor-widget-unlockafe-video-gallery .unlockafe-carousel-nav,
.elementor-widget-unlockafe-video-gallery .unlockafe-carousel-nav.unlockafe-nav-visible {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.elementor-widget-unlockafe-video-gallery .unlockafe-carousel-prev,
.elementor-widget-unlockafe-video-gallery .unlockafe-carousel-next,
.elementor-widget-unlockafe-video-gallery .unlockafe-carousel-prev.unlockafe-arrow-visible,
.elementor-widget-unlockafe-video-gallery .unlockafe-carousel-next.unlockafe-arrow-visible {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Tablet and Mobile Arrow Styling */
@media (max-width: 1024px) {
    .elementor-widget-unlockafe-video-gallery .unlockafe-carousel-prev,
    .elementor-widget-unlockafe-video-gallery .unlockafe-carousel-next {
        width: 45px;
        height: 45px;
        font-size: 16px;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        background: rgba(255, 255, 255, 0.95) !important;
    }
    
    .elementor-widget-unlockafe-video-gallery .unlockafe-carousel-prev i,
    .elementor-widget-unlockafe-video-gallery .unlockafe-carousel-next i {
        display: inline-block !important;
        visibility: visible !important;
        opacity: 1 !important;
        color: #333 !important;
        font-size: 16px !important;
    }
}

/* Mobile Arrow Styling */
@media (max-width: 768px) {
    .elementor-widget-unlockafe-video-gallery .unlockafe-carousel-prev,
    .elementor-widget-unlockafe-video-gallery .unlockafe-carousel-next {
        width: 40px;
        height: 40px;
        font-size: 14px;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        background: rgba(255, 255, 255, 0.95) !important;
    }
    
    .elementor-widget-unlockafe-video-gallery .unlockafe-carousel-prev i,
    .elementor-widget-unlockafe-video-gallery .unlockafe-carousel-next i,
    .elementor-widget-unlockafe-video-gallery .unlockafe-carousel-prev:active i,
    .elementor-widget-unlockafe-video-gallery .unlockafe-carousel-next:active i,
    .elementor-widget-unlockafe-video-gallery .unlockafe-carousel-prev:focus i,
    .elementor-widget-unlockafe-video-gallery .unlockafe-carousel-next:focus i {
        display: inline-block !important;
        visibility: visible !important;
        opacity: 1 !important;
        color: #333 !important;
        font-size: 14px !important;
        font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", "Font Awesome 5 Free", "Font Awesome 5 Pro", "FontAwesome" !important;
        font-weight: 900 !important;
    }
    
    .elementor-widget-unlockafe-video-gallery .unlockafe-carousel-prev {
        left: 10px !important;
    }
    
    .elementor-widget-unlockafe-video-gallery .unlockafe-carousel-next {
        right: 10px !important;
    }
}

@media (max-width: 480px) {
    .elementor-widget-unlockafe-video-gallery .unlockafe-carousel-prev,
    .elementor-widget-unlockafe-video-gallery .unlockafe-carousel-next {
        width: 35px;
        height: 35px;
        font-size: 12px;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        background: rgba(255, 255, 255, 0.95) !important;
    }
    
    .elementor-widget-unlockafe-video-gallery .unlockafe-carousel-prev i,
    .elementor-widget-unlockafe-video-gallery .unlockafe-carousel-next i {
        display: inline-block !important;
        visibility: visible !important;
        opacity: 1 !important;
        color: #333 !important;
        font-size: 12px !important;
    }
    
    .elementor-widget-unlockafe-video-gallery .unlockafe-carousel-prev {
        left: 5px !important;
    }
    
    .elementor-widget-unlockafe-video-gallery .unlockafe-carousel-next {
        right: 5px !important;
    }
}

/* Video Item */
.unlockafe-video-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.unlockafe-video-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Thumbnail Wrapper */
.unlockafe-video-thumbnail-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    overflow: hidden;
    background: #000;
}

.unlockafe-video-thumbnail,
.unlockafe-video-thumbnail-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.unlockafe-video-item:hover .unlockafe-video-thumbnail {
    transform: scale(1.1);
}

.unlockafe-video-thumbnail-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    font-size: 48px;
}

/* Video Overlay */
.unlockafe-video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s ease, background 0.3s ease;
}

.unlockafe-video-item:hover .unlockafe-video-overlay {
    background: rgba(0, 0, 0, 0.5);
}

/* Play Button */
.unlockafe-video-play-button {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
    padding: 0;
    margin: 0;
}

.unlockafe-video-play-button i {
    font-size: 30px;
    margin-left: 4px; /* Slight offset for visual balance */
}

.unlockafe-video-play-button:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

.unlockafe-video-play-button:active {
    transform: scale(0.95);
}

/* Video Duration */
.unlockafe-video-duration {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: #ffffff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    z-index: 3;
}

/* Video Title */
.unlockafe-video-title {
    margin: 15px 0 0 0;
    font-size: 16px;
    font-weight: 600;
    color: #333333;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.unlockafe-video-item:hover .unlockafe-video-title {
    color: #667eea;
}

/* Video Lightbox */
.unlockafe-video-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.unlockafe-video-lightbox.active {
    display: flex;
    opacity: 1;
}

.unlockafe-video-lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.unlockafe-video-lightbox-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    z-index: 1;
    padding: 40px;
}

.unlockafe-video-lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s ease;
    z-index: 2;
}

.unlockafe-video-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.unlockafe-video-lightbox-player {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.unlockafe-video-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ============================================
   Responsive Styles
   ============================================ */

@media (max-width: 1024px) {
    .unlockafe-video-gallery-wrapper.unlockafe-gallery-grid.unlockafe-gallery-cols-4,
    .unlockafe-video-gallery-wrapper.unlockafe-gallery-grid.unlockafe-gallery-cols-5,
    .unlockafe-video-gallery-wrapper.unlockafe-gallery-grid.unlockafe-gallery-cols-6 {
        grid-template-columns: repeat(3, 1fr) !important;
    }
    
    .unlockafe-gallery-masonry.unlockafe-gallery-cols-4,
    .unlockafe-gallery-masonry.unlockafe-gallery-cols-5,
    .unlockafe-gallery-masonry.unlockafe-gallery-cols-6 {
        column-count: 3;
    }
    
    .unlockafe-gallery-carousel .unlockafe-video-item {
        width: calc(50% - 10px);
    }
}

@media (max-width: 768px) {
    .unlockafe-video-gallery-wrapper.unlockafe-gallery-grid.unlockafe-gallery-cols-3,
    .unlockafe-video-gallery-wrapper.unlockafe-gallery-grid.unlockafe-gallery-cols-4,
    .unlockafe-video-gallery-wrapper.unlockafe-gallery-grid.unlockafe-gallery-cols-5,
    .unlockafe-video-gallery-wrapper.unlockafe-gallery-grid.unlockafe-gallery-cols-6 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .unlockafe-gallery-masonry.unlockafe-gallery-cols-3,
    .unlockafe-gallery-masonry.unlockafe-gallery-cols-4,
    .unlockafe-gallery-masonry.unlockafe-gallery-cols-5,
    .unlockafe-gallery-masonry.unlockafe-gallery-cols-6 {
        column-count: 2;
    }
    
    .unlockafe-gallery-carousel .unlockafe-video-item {
        width: calc(66.666% - 10px);
    }
    
    .unlockafe-video-lightbox-content {
        padding: 20px;
    }
    
    .unlockafe-video-lightbox-close {
        top: -30px;
        width: 35px;
        height: 35px;
    }
}

@media (max-width: 480px) {
    .unlockafe-video-gallery-wrapper.unlockafe-gallery-grid.unlockafe-gallery-cols-2,
    .unlockafe-video-gallery-wrapper.unlockafe-gallery-grid.unlockafe-gallery-cols-3,
    .unlockafe-video-gallery-wrapper.unlockafe-gallery-grid.unlockafe-gallery-cols-4,
    .unlockafe-video-gallery-wrapper.unlockafe-gallery-grid.unlockafe-gallery-cols-5,
    .unlockafe-video-gallery-wrapper.unlockafe-gallery-grid.unlockafe-gallery-cols-6 {
        grid-template-columns: 1fr !important;
    }
    
    .unlockafe-gallery-masonry.unlockafe-gallery-cols-2,
    .unlockafe-gallery-masonry.unlockafe-gallery-cols-3,
    .unlockafe-gallery-masonry.unlockafe-gallery-cols-4,
    .unlockafe-gallery-masonry.unlockafe-gallery-cols-5,
    .unlockafe-gallery-masonry.unlockafe-gallery-cols-6 {
        column-count: 1;
    }
    
    .unlockafe-gallery-carousel .unlockafe-video-item {
        width: calc(100% - 10px);
    }
    
    .unlockafe-video-play-button {
        width: 60px;
        height: 60px;
    }
    
    .unlockafe-video-play-button i {
        font-size: 24px;
    }
    
    .unlockafe-video-title {
        font-size: 14px;
    }
}


