/* ================ V3 VIDEO CAROUSEL STYLES ================ */

/* Main carousel wrapper */


.v3-carousel-wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    margin-left: 0; /* Remove the negative margin calculation */
    position: relative;
}


.v3-carousel {
    background: transparent;
    padding: 40px 5rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.v3-carousel-track {
    display: flex;
    height: 75vh;
    min-height: 45rem;
    width: 100%;
    padding: 0rem 0;
    gap: 0.8rem;
    scroll-snap-type: x mandatory;
    padding-bottom: 10px;
    overflow-x: hidden;
    justify-content: center;
    max-width: 100vw;
}

/* Base card styles */
.v3-card {
    background: #000;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 0.875rem;
    cursor: pointer;
    flex: 2;
    overflow: hidden;
    position: relative;
    transition: all 0.5s cubic-bezier(0.05, 0.6, 0.39, 0.94);
    width: auto;
    height: 100%;
    z-index: 1;
    color: white;
    scroll-snap-align: start;
    flex: 0 0 auto;
}

/* Card overlay for click handling */
.v3-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    cursor: pointer;
    pointer-events: none;
}

/* Expanded state */
.v3-card.v3-expanded {
    border-radius: 0.875rem;
    flex: 16;
    z-index: 2;
    width: 60vw;
    height: auto;
    writing-mode: vertical-rl;
}

/* Collapsed state */
.v3-card.v3-collapsed {
    flex: 1;
    filter: brightness(0.7);
    width: 9vw;
    height: auto;
    writing-mode: vertical-lr !important;
    text-orientation: mixed;
}

.v3-card.v3-collapsed:hover {
    transform: none !important;
    box-shadow: none !important;
    background: inherit !important;
}

/* Video wrapper */
.video-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

/* Video player styles */
.js-player,
.plyr,
.video-wrapper iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    min-width: 100%;
    min-height: 100%;
    border: none;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Scale video for better framing */
.v3-card.v3-expanded .video-wrapper iframe {
    width: 130%;
    height: 130%;
}

.v3-card.v3-collapsed .video-wrapper iframe {
    width: 200%;
    height: 200%;
    pointer-events: none;
}

/* Custom thumbnail */
.custom-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 4;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.custom-thumbnail.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Thumbnail play button */
.thumbnail-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    opacity: 0;
}

.v3-card.v3-expanded .thumbnail-play-button {
    opacity: 1;
}

.thumbnail-play-button:hover {
    transform: translate(-50%, -50%) scale(1.1);
    background: rgba(255, 255, 255, 1);
}

.thumbnail-play-button i {
    font-size: 30px;
    color: #333;
    margin-left: 5px;
}

/* Card title */
.v3-card-title {
    position: absolute;
    color: #fff;
    font-size: 1.25vw;
    top: 2rem;
    right: 1rem;
    width: auto;
    text-align: center;
    pointer-events: none;
    z-index: 5;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: top right;
    writing-mode: vertical-rl !important;
}

/* Show title only on expanded cards */
.v3-card.v3-expanded .v3-card-title {
    opacity: 1;
    transform: translateX(0);
}

/* Plus button */
.v3-plus-btn {
    position: absolute;
    bottom: 2.5rem;
    right: 10%;
    font-size: 2.5vw;
    pointer-events: all;
    cursor: pointer;
    transition: opacity 0.3s ease;
    z-index: 5;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    transform: scale(1);
}

/* Hide plus on expanded */
.v3-card.v3-expanded .v3-plus-btn {
    opacity: 0;
    transform: translateX(2rem);
    pointer-events: none;
}

/* Video overlay */
.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 4;
}

/* Video controls */
.video-controls {
    position: absolute;
    bottom: 2rem;
    right: 1.5rem;
    display: flex;
    gap: 10px;
    opacity: 0;
    transform: translateY(2rem);
    transition: 290ms cubic-bezier(0.05, 0.62, 0.4, 0.95) 300ms;
    transition-property: opacity, transform;
    pointer-events: all;
    z-index: 5;
}

.v3-card.v3-expanded .video-controls {
    opacity: 1;
    transform: translateY(0);
}

/* Control buttons */
.control-btn {
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
}

.control-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.1);
}

.control-btn i {
    font-size: 16px;
}

/* Person info section */
.v3-person-info {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2rem !important;
    padding: 0 2rem;
    gap: 3rem;
    margin-left: 10rem;
}

/* Navigation dots */
.v3-carousel-nav {
    display: flex;
    justify-content: start;
    gap: 10px;
    align-items: start;
    margin-left: 10rem;
    margin-bottom: 10px;
}

.v3-nav-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #a5b3c5;
    cursor: pointer;
    transition: all 0.3s ease;
}

.v3-nav-dot.v3-active {
    background-color: #1c61be;
}

/* Mobile specific elements - hidden on desktop */
.mobile-main-video,
.mobile-thumbnail-gallery {
    display: none;
}

/* ================ RESPONSIVE STYLES ================ */

@media (max-width: 992px) {
    .v3-card-title {
        font-size: 2.2vw;
        right: 1.2rem;
    }
    
    .v3-plus-btn {
        right: 1.2rem;
    }
}

@media (max-width: 768px) {
    /* Hide desktop carousel on mobile */
    .v3-carousel {
        display: none;
    }

    .v3-person-info {
    gap: 1rem;
    margin-left: 2rem;
}

    /* Show mobile elements */
    .mobile-main-video,
    .mobile-thumbnail-gallery {
        display: block;
    }

    /* Main video container */
    .mobile-main-video {
        position: relative;
        width: 100%;
        height: 60vh;
        max-height: 400px;
        background: #000;
        overflow: hidden;
        margin-bottom: 20px;
    }

    .mobile-main-video .video-wrapper {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }

    .mobile-main-video .custom-thumbnail {
        z-index: 3;
    }

    .mobile-main-video .thumbnail-play-button {
        opacity: 1;
        width: 60px;
        height: 60px;
    }

    .mobile-main-video .thumbnail-play-button i {
        font-size: 24px;
    }

    .mobile-main-video .v3-card-title {
        font-size: 18px;
        top: 1rem;
        right: 1rem;
        opacity: 1;
        transform: none;
    }

    .mobile-main-video .video-controls {
        opacity: 1;
        transform: none;
        bottom: 1rem;
        right: 1rem;
    }

    .mobile-main-video .control-btn {
        width: 35px;
        height: 35px;
    }

    .mobile-main-video .control-btn i {
        font-size: 14px;
    }

    /* Thumbnail gallery */
    .mobile-thumbnail-gallery {
        position: relative;
        width: 100%;
        padding: 0 15px;
        overflow: hidden;
    }

    .mobile-thumbnail-scroll {
        display: flex;
        gap: 10px;
        overflow-x: auto;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding-bottom: 10px;
    }

    .mobile-thumbnail-scroll::-webkit-scrollbar {
        display: none;
    }

    .mobile-thumbnail-item {
        flex: 0 0 120px;
        height: 90px;
        position: relative;
        border-radius: 8px;
        overflow: hidden;
        cursor: pointer;
        transition: all 0.3s ease;
        border: 2px solid transparent;
    }

    .mobile-thumbnail-item.active {
        border-color: #1C61BE;
        transform: scale(1.05);
    }

    .mobile-thumbnail-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .mobile-thumbnail-item .thumbnail-title {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
        color: white;
        padding: 5px 8px;
        font-size: 11px;
        text-align: center;
    }

    /* Navigation dots for mobile */
    .v3-carousel-nav {
        margin-top: 15px;
        padding: 0 15px;
        margin-left: 0;
    }

    .v3-nav-dot {
        width: 8px;
        height: 8px;
    }

    .v3-carousel-track {
        height: 400px;
    }
    
    .v3-card {
        height: 400px !important;
    }
    
    .v3-card.v3-expanded {
        flex: 8;
    }
    
    .v3-card.v3-collapsed {
        flex: 1;
    }
    
    .v3-card-title {
        font-size: 2.5vw;
    }
}

@media (max-width: 640px) {
    .video-controls {
        left: 80px !important;
    }
}

@media (max-width: 560px) {
    .v3-card-title {
        font-size: 2.7vw;
    }
    
    .v3-carousel-nav {
        margin-left: -90px;
    }
}

@media (max-width: 415px) {
    .mobile-main-video {
        height: 50vh;
        max-height: 300px;
    }

    .mobile-thumbnail-item {
        flex: 0 0 100px;
        height: 75px;
    }

    .mobile-thumbnail-item .thumbnail-title {
        font-size: 10px;
        padding: 3px 5px;
    }

    .v3-carousel-track {
        height: 350px;
    }
    
    .v3-card {
        height: 350px !important;
    }
    
    .v3-card-title {
        font-size: 3.5vw;
        right: 0.5rem;
    }
    
    .v3-plus-btn {
        right: 0.5rem;
    }
    
    .v3-carousel-nav {
        margin-left: -130px;
    }
}


.v3-carousel-wrapper .mobile-main-video {
    contain: layout;
    overflow: hidden;
}