/* Video Carousel Styles */
.video-carousel-container {
    position: relative;
    max-width: 100%;
    margin: 20px 0;
}

/* Thumbnail Carousel */
.video-carousel-thumbnails {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: #f8f9fa;
    padding: 0;
}

.carousel-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    width: 100%;
}

.carousel-track {
    display: flex;
    transition: transform 0.3s ease-in-out;
    gap: 0;
    width: 100%;
}

.carousel-slide {
    flex: 0 0 100%;
    width: 100%;
    min-width: 100%;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.carousel-slide:hover {
    transform: translateY(-5px);
}

.video-container {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
    width: 100%;
    height: 100%;
}

.video-container:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.video-wrapper {
    width: 100%;
    height: 650px;
    position: relative;
    background: linear-gradient(135deg, #0D3C56 0%, #176D87 100%);
    min-height: 650px;
}

.video-wrapper iframe,
.video-wrapper video {
    width: 100%;
    height: 100%;
    border: none;
    object-fit: cover;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
}

.play-pause-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    pointer-events: all;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
    opacity: 0;
    z-index: 5;
}

.video-container:hover .play-pause-button {
    opacity: 1;
}

.play-pause-button:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translate(-50%, -50%) scale(1.1);
}

.play-pause-button svg {
    width: 32px;
    height: 32px;
}

.play-pause-button.paused svg {
    margin-left: 4px;
    /* Slight adjustment for play icon centering */
}

.unmute-button {
    position: absolute;
    bottom: 15px;
    right: 15px;
    width: 70px;
    height: 70px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    pointer-events: all;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
    z-index: 6;
}

.unmute-button:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

/* Default muted state - show slash */
.unmute-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 20px;
    background: #fff;
    transform: translate(-50%, -50%) rotate(45deg);
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Unmuted state - hide slash */
.unmute-button.unmuted::after {
    opacity: 0;
}

.unmute-button.unmuted {
    background: rgba(13, 60, 86, 0.8);
}

.unmute-button.unmuted:hover {
    background: rgba(13, 60, 86, 1);
}


/* Navigation Arrows */
.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: #0D3C56;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    z-index: 10;
}

.carousel-nav:hover {
    background: #0a2f42;
    color: #fff;
    box-shadow: 0 4px 12px rgba(13, 60, 86, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.carousel-prev {
    left: 10px;
}

.carousel-next {
    right: 10px;
}

.carousel-nav:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}


/* Mobile Video Carousel Styles */
.mobile-video-carousel-container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    position: relative;
    touch-action: pan-y;
    /* Allow vertical scrolling but prevent horizontal browser gestures */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.mobile-video-carousel-thumbnails {
    width: 100%;
    position: relative;
    padding: 0;
}

.mobile-carousel-wrapper {
    width: 100%;
    overflow: hidden;
    position: relative;
}

.mobile-carousel-track {
    display: flex;
    width: 100%;
    transition: transform 0.3s ease;
    touch-action: pan-y;
    /* Allow vertical scrolling but prevent horizontal browser gestures */
}

.mobile-carousel-slide {
    flex: 0 0 100%;
    width: 100%;
    min-width: 100%;
    position: relative;
}

.mobile-video-container {
    width: 100%;
    height: 100%;
    position: relative;
    border-radius: 0;
    overflow: hidden;
    background: #000;
    transition: all 0.3s ease;
}

.mobile-video-container:hover {
    box-shadow: none;
}

/* No tap to start overlay - videos should autoplay immediately */

.mobile-video-wrapper {
    width: 100%;
    height: 80vh;
    /* Reel-like height - 80% of viewport height */
    max-height: 600px;
    min-height: 400px;
    position: relative;
    background: linear-gradient(135deg, #0D3C56 0%, #176D87 100%);
    aspect-ratio: 9/16;
    /* Reel-like aspect ratio */
}

.mobile-video-wrapper iframe,
.mobile-video-wrapper video {
    width: 100%;
    height: 100%;
    border: none;
    object-fit: cover;
}

.mobile-video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
}

.mobile-play-pause-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    pointer-events: all;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
    opacity: 0;
    z-index: 5;
    visibility: hidden;
}

.mobile-video-container:hover .mobile-play-pause-button,
.mobile-video-container:active .mobile-play-pause-button {
    opacity: 1;
    visibility: visible;
}

/* Show button briefly on touch for mobile devices */
.mobile-video-container.touch-active .mobile-play-pause-button {
    opacity: 1;
    visibility: visible;
}

.mobile-play-pause-button:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translate(-50%, -50%) scale(1.1);
}

.mobile-play-pause-button svg {
    width: 28px;
    height: 28px;
}

.mobile-play-pause-button.paused svg {
    margin-left: 4px;
}

.mobile-unmute-button {
    position: absolute;
    bottom: 15px;
    right: 15px;
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    pointer-events: all;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
    z-index: 6;
}

.mobile-unmute-button:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

/* Default muted state - show slash */
.mobile-unmute-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 28px;
    background: #fff;
    transform: translate(-50%, -50%) rotate(45deg);
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Unmuted state - hide slash */
.mobile-unmute-button.unmuted::after {
    opacity: 0;
}

.mobile-unmute-button.unmuted {
    background: rgba(13, 60, 86, 0.8);
}

/* Dots Navigation */
.mobile-dots-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 15px 0;
    background: rgba(0, 0, 0, 0.1);
}

.mobile-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.mobile-dot:hover {
    background: rgba(255, 255, 255, 0.6);
    transform: scale(1.2);
}

.mobile-dot.active {
    background: #0073aa;
    transform: scale(1.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .carousel-slide {
        flex: 0 0 100%;
        width: 100%;
        min-width: 100%;
    }

    .video-wrapper {
        height: 500px;
        min-height: 500px;
    }

    .play-pause-button {
        width: 70px;
        height: 70px;
    }

    .play-pause-button svg {
        width: 28px;
        height: 28px;
    }

    .unmute-button {
        width: 35px;
        height: 35px;
    }

    .carousel-nav {
        width: 35px;
        height: 35px;
    }

    .carousel-prev {
        left: 5px;
    }

    .carousel-next {
        right: 5px;
    }
}

@media (max-width: 480px) {
    .video-carousel-thumbnails {
        padding: 0;
    }

    .carousel-slide {
        flex: 0 0 100%;
        width: 100%;
        min-width: 100%;
    }

    .video-wrapper {
        height: 400px;
        min-height: 400px;
    }

    .play-pause-button {
        width: 60px;
        height: 60px;
    }

    .play-pause-button svg {
        width: 24px;
        height: 24px;
    }

    .unmute-button {
        width: 30px;
        height: 30px;
    }

    .video-overlay {
        padding: 10px;
    }
}

/* Loading States */
.video-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #fff;
    background: linear-gradient(135deg, #0D3C56 0%, #176D87 100%);
    font-size: 16px;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.video-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 2s infinite;
}

.video-loading::after {
    content: '';
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 12px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes shimmer {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

/* Accessibility */
.carousel-nav:focus,
.modal-close:focus,
.suggested-thumbnail:focus {
    outline: 2px solid #0D3C56;
    outline-offset: 2px;
}

/* Smooth scrolling for suggested videos */
.suggested-thumbnails {
    scrollbar-width: thin;
    scrollbar-color: #ccc #f1f1f1;
}

.suggested-thumbnails::-webkit-scrollbar {
    height: 6px;
}

.suggested-thumbnails::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.suggested-thumbnails::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.suggested-thumbnails::-webkit-scrollbar-thumb:hover {
    background: #999;
}