/**
 * GBP Video Carousel Widget Styles
 */

.gbp-video-carousel {
    position: relative;
    width: 100%;
}

/* Header with title and arrows */
.gbp-video-carousel__header {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

/* Arrow position: Top Left — arrows left, title right */
.gbp-video-carousel__header--top-left {
    justify-content: flex-start;
    flex-direction: row-reverse;
}

.gbp-video-carousel__header--top-left .gbp-video-carousel__title {
    flex: 1;
    margin-left: 16px;
}

/* Arrow position: Top Center — title full-width above, arrows centered below */
.gbp-video-carousel__header--top-center {
    justify-content: center;
    flex-wrap: wrap;
}

.gbp-video-carousel__header--top-center .gbp-video-carousel__title {
    width: 100%;
    text-align: center;
    margin-bottom: 16px;
}

/* Arrow position: Top Right — title left, arrows right */
.gbp-video-carousel__header--top-right {
    justify-content: space-between;
}

.gbp-video-carousel__header--top-right .gbp-video-carousel__title {
    flex: 1;
}

/* Arrow position: Beside Title (Left) — [◄][►] Title, grouped */
.gbp-video-carousel__header--beside-left {
    justify-content: flex-start;
    flex-direction: row-reverse;
    gap: 12px;
}

/* Arrow position: Beside Title (Right) — Title [◄][►], grouped */
.gbp-video-carousel__header--beside-right {
    justify-content: flex-start;
    gap: 12px;
}

.gbp-video-carousel__title {
    margin: 0;
}

.gbp-video-carousel__arrows--header {
    display: flex;
    flex-shrink: 0;
}

/* Arrow position: Middle (Sides) — absolute positioned on sides of track */
.gbp-video-carousel__arrow--middle {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
}

.gbp-video-carousel__arrow--middle.gbp-video-carousel__arrow--prev {
    left: -20px;
}

.gbp-video-carousel__arrow--middle.gbp-video-carousel__arrow--next {
    right: -20px;
}

/* Arrow position: Bottom Left */
.gbp-video-carousel__arrows--bottom-left {
    margin-top: 16px;
    justify-content: flex-start;
}

/* Arrow position: Bottom Center */
.gbp-video-carousel__arrows--bottom-center {
    margin-top: 16px;
    justify-content: center;
}

/* Arrow position: Bottom Right */
.gbp-video-carousel__arrows--bottom-right {
    margin-top: 16px;
    justify-content: flex-end;
}

/* Track and slides container */
.gbp-video-carousel__track {
    overflow: hidden;
    width: 100%;
}

.gbp-video-carousel__slides {
    display: flex;
    transition: transform 0.5s ease;
}

.gbp-video-carousel__slide {
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    background-color: #1a1a2e;
}

.gbp-video-carousel__slide:hover .gbp-video-carousel__play,
.gbp-video-carousel__slide:focus-within .gbp-video-carousel__play {
    transform: translate(-50%, -50%) scale(1.1);
}

/* Thumbnail image */
.gbp-video-carousel__thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
}

/* Thumbnail placeholder (when no thumbnail available) */
.gbp-video-carousel__thumbnail-placeholder {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
}

/* Play button overlay */
.gbp-video-carousel__play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.6);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, background-color 0.2s ease;
    z-index: 5;
    padding: 0;
    opacity: 0.9;
}

.gbp-video-carousel__play:hover,
.gbp-video-carousel__play:focus-visible {
    background-color: rgba(0, 0, 0, 0.8);
}

.gbp-video-carousel__play svg {
    width: 40%;
    height: 40%;
    fill: #ffffff;
    margin-left: 3px; /* Optical centering for play triangle */
}

/* Custom play icon images */
.gbp-video-carousel__play-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.gbp-video-carousel__play-icon--hover {
    display: none;
}

/* Show hover icon on slide hover (swap normal/hover) */
.gbp-video-carousel__slide:hover .gbp-video-carousel__play-icon--normal,
.gbp-video-carousel__slide:focus-within .gbp-video-carousel__play-icon--normal {
    display: none;
}

.gbp-video-carousel__slide:hover .gbp-video-carousel__play-icon--hover,
.gbp-video-carousel__slide:focus-within .gbp-video-carousel__play-icon--hover {
    display: block;
}

/* When only normal icon exists (no hover), keep it visible on hover */
.gbp-video-carousel__play-icon--normal:only-child {
    display: block;
}

.gbp-video-carousel__slide:hover .gbp-video-carousel__play-icon--normal:only-child,
.gbp-video-carousel__slide:focus-within .gbp-video-carousel__play-icon--normal:only-child {
    display: block;
}

/* Inline player (play in place) */
.gbp-video-carousel__inline-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    z-index: 6;
}

/* Arrow navigation */
.gbp-video-carousel__arrows {
    display: flex;
    z-index: 10;
}

.gbp-video-carousel__arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid #d0d5dd;
    border-radius: 50%;
    background-color: #ffffff;
    color: #0073e6;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    outline: none;
}

.gbp-video-carousel__arrow:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.gbp-video-carousel__arrow:hover,
.gbp-video-carousel__arrow:focus-visible {
    background-color: #f5f5f5;
}

.gbp-video-carousel__arrow:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.gbp-video-carousel__arrow svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
}

.gbp-video-carousel__arrow img {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

/* Dots navigation */
.gbp-video-carousel__dots {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 16px;
}

.gbp-video-carousel__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #cccccc;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.gbp-video-carousel__dot:hover,
.gbp-video-carousel__dot:focus-visible {
    background-color: #999999;
}

.gbp-video-carousel__dot.active {
    background-color: #333333;
}

/* ==========================================================================
   Lightbox
   ========================================================================== */

.gbp-video-carousel__lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gbp-video-carousel__lightbox[hidden] {
    display: none;
}

.gbp-video-carousel__lightbox-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
}

.gbp-video-carousel__lightbox-content {
    position: relative;
    width: 90%;
    max-width: 960px;
    z-index: 1;
}

.gbp-video-carousel__lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    color: #ffffff;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
    padding: 0;
    line-height: 1;
}

.gbp-video-carousel__lightbox-close:hover,
.gbp-video-carousel__lightbox-close:focus-visible {
    opacity: 0.7;
}

.gbp-video-carousel__lightbox-player {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    background-color: #000;
    border-radius: 4px;
    overflow: hidden;
}

.gbp-video-carousel__lightbox-player iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
    .gbp-video-carousel__arrow--middle.gbp-video-carousel__arrow--prev {
        left: 10px;
    }

    .gbp-video-carousel__arrow--middle.gbp-video-carousel__arrow--next {
        right: 10px;
    }
}

@media (max-width: 767px) {
    .gbp-video-carousel__arrow {
        width: 36px;
        height: 36px;
    }

    .gbp-video-carousel__arrow svg,
    .gbp-video-carousel__arrow img {
        width: 14px;
        height: 14px;
    }

    .gbp-video-carousel__play {
        width: 44px;
        height: 44px;
    }

    .gbp-video-carousel__lightbox-content {
        width: 95%;
    }

    .gbp-video-carousel__lightbox-close {
        top: -36px;
        right: 0;
    }
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .gbp-video-carousel__slides {
        transition: none;
    }

    .gbp-video-carousel__play {
        transition: none;
    }

    .gbp-video-carousel__arrow {
        transition: none;
    }

    .gbp-video-carousel__dot {
        transition: none;
    }
}
