/* ================ V2 VIDEO CAROUSEL STYLES ================ */

/* Main carousel wrapper */
.v2-carousel-wrapper {
    width: 100vw;
    max-width: 100vw;
    overflow-x: hidden;
    margin-left: calc(-50vw + 50%);
    position: relative;
}

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

.v2-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 */
.v2-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 */
.v2-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    cursor: pointer;
    pointer-events: none;
}

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

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

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

/* Video wrapper */
.video-wrapper {
    /* position: absolute; */
    position: relative;
    /* 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);
}

/* Ensure Plyr container maintains aspect ratio */
.js-player {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
}

/* Force Plyr video to fill container properly */
.plyr {
  width: 100% !important;
  height: 100% !important;
}

.plyr__video-wrapper {
  width: 100% !important;
  height: 100% !important;
}

.plyr iframe {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important ; /* This will ensure full width but might crop top/bottom */
}

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

.v2-card.v2-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;
}

.v2-card.v2-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 */
.v2-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 */
.v2-card.v2-expanded .v2-card-title {
    opacity: 1;
    transform: translateX(0);
}

/* Plus button */
.v2-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 */
.v2-card.v2-expanded .v2-plus-btn {
    opacity: 0;
    transform: translateX(2rem);
    pointer-events: none;
}


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

/* 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;
}

.v2-card.v2-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 */
.v2-person-info {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2rem !important;
    padding: 0 2rem;
    gap: 3rem;
    margin-left: 10rem;
}

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

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

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

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

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

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

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

    /* 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 .v2-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 */
    .v2-carousel-nav {
        margin-top: 15px;
        padding: 0 15px;
        margin-left: 0;
    }

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

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

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

@media (max-width: 560px) {
    .v2-card-title {
        font-size: 2.7vw;
    }
    
    .v2-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;
    }

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



.v2-carousel-wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    margin-left: 0; /* Remove the negative margin calculation */
    position: relative;
    padding: 0 5%; /* Add consistent padding to match your content */
}

/* Ensure button container aligns properly */
.button-container {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
    padding: 0 5%; /* Match the wrapper padding */
    width: 100%;
    box-sizing: border-box;
}

/* Alternative solution if you want to keep the full-width carousel */
.v2-carousel {
    max-width: 90vw;
    margin: 0 auto;
}

.button-container.alternative {
    max-width: 90vw;
    margin: 20px auto 0;
    padding: 0 1rem;
}



  /* New CSS */
    
      /* Hide YouTube's default play button */
.plyr__control--overlaid {
  display: none !important;
}

/* Ensure Plyr fills container */
.plyr {
  height: 100%;
}

.plyr__video-wrapper {
  height: 100%;
}

/* SHOW custom video controls again */
.video-controls {
  display: flex !important;
  position: absolute !important;
  bottom: 50px !important;  /* Above the progress bar */
  right: 20px !important;
  gap: 10px !important;
  z-index: 25 !important;
}

/* Hide YouTube's native controls completely */
.plyr--youtube .plyr__video-wrapper iframe {
  pointer-events: none !important;
}

/* Hide any vertical progress bars */
/* .plyr__progress[style*="writing-mode"],
.plyr__progress[style*="transform: rotate"],
*[style*="writing-mode: vertical"],
*[style*="transform: rotate(90deg)"],
*[style*="transform: rotate(-90deg)"] {
  display: none !important;
} */

/* Show only horizontal Plyr progress bar at bottom */
.plyr__controls {
  display: flex !important;
  flex-direction: row !important;
  position: absolute !important;
  bottom: 40px !important;
  left: 20px !important;
  right: 20px !important;
  background: transparent !important;
  padding: 0 !important;
  z-index: 20 !important;
  width: calc(100% - 40px) !important;
  box-sizing: border-box !important;
}

/* Force horizontal progress bar only */
.plyr__progress {
  display: block !important;
  position: relative !important;
  width: 100% !important;
  height: 8px !important;
  margin: 0 !important;
  padding: 0 !important;
  flex: 1 !important;
  writing-mode: horizontal-tb !important;
  transform: none !important;
}

/* Style the horizontal progress input */
.plyr__progress input[type="range"] {
  width: 100% !important;
  height: 8px !important;
  background: rgba(255, 255, 255, 0.3) !important;
  border-radius: 4px !important;
  border: none !important;
  outline: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  cursor: pointer !important;
  /* margin: 0 !important; */
  padding: 0 !important;
  writing-mode: horizontal-tb !important;
  transform: none !important;
  margin-bottom: 5rem !important;
}

/* Hide all OTHER Plyr controls (but keep progress) */
.plyr__control:not(.plyr__progress) {
  display: none !important;
}

.plyr__time {
  display: none !important;
}

/* Style your custom controls */
.control-btn {
  width: 45px;
  height: 45px;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: white;
  font-size: 18px;
}

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

.control-btn.active {
  background: rgba(255, 255, 255, 0.9);
  color: #1a1a1a;
}

/* Track styling for horizontal only */
.plyr__progress input[type="range"]::-webkit-slider-track {
  width: 100% !important;
  height: 8px !important;
  background: rgba(255, 255, 255, 0.3) !important;
  border-radius: 4px !important;
}

/* Thumb styling for horizontal only */
.plyr__progress input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none !important;
  width: 16px !important;
  height: 16px !important;
  background: #007bff !important;
  border-radius: 50% !important;
  cursor: pointer !important;
  margin-top: 0px !important;
}

/* Firefox styles for horizontal only */
.plyr__progress input[type="range"]::-moz-range-track {
  width: 100% !important;
  height: 8px !important;
  background: rgba(255, 255, 255, 0.3) !important;
  border-radius: 4px !important;
}

.plyr__progress input[type="range"]::-moz-range-thumb {
  width: 16px !important;
  height: 16px !important;
  background: #007bff !important;
  border-radius: 50% !important;
  border: none !important;
  cursor: pointer !important;
}

/* Keep custom thumbnails visible */
/* .custom-thumbnail {
  
} */

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

/* .thumbnail-play-button {
  
} */