/* Prevent double tooltips - videojs handles its own tooltip system */
.vjs-control[title] {
    pointer-events: auto; /* Keep interaction */
}

/* Hide native browser tooltips for videojs controls */
.vjs-control::after {
    content: attr(title);
    display: none !important;
}

.backButtonIcon {
    font-size: 40px;
    position: absolute;
    padding: 0px !important;
    top: 10px; 
    left: 10px;
}
.backButton {
    background: none !important;
}

.episodes-list {
    position: fixed;
    right: 0;
    bottom: 30px; /* The height of your progress bar */
    width: 40%;
    height: calc(100% - 50px); /* Subtract the height of your progress bar and some additional space if needed */
    background-color: #000;
    color: #fff;
    padding: 20px;
    z-index: 1;
    overflow: hidden;
}
.episodes-container {
    overflow-y: auto;
    height: calc(100% - 50px); /* Adjust as needed */
    padding: 10px;
}

.img-container {
    width: 40%;
    padding-bottom: 22%; 
    position: relative;
    height: 0;
    overflow: hidden;
    padding-bottom: 25%; 
}

.episode-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    object-fit: cover;
}

.episodes-container .progress {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.episodes-container .progress-bar {
    background-color: var(--play-progress, #E50914);
}

.episodes-container::-webkit-scrollbar {
    width: 5px;
}

.episodes-container::-webkit-scrollbar-track {
    background: transparent;
}

.episodes-container::-webkit-scrollbar-thumb {
    background: black;
}

    /* CSS for smaller screens (e.g., mobile devices) */
@media screen and (max-width: 768px) { /* Adjust 768px to the desired breakpoint */
    .episodes-list {
        width: 100%; /* Take up full width on smaller screens */
        height: calc(100% - 20px); /* Adjust as needed */
    }

    .img-container {
        width: 100%; /* Images take up full width on smaller screens */
        padding-bottom: 56.25%; /* Maintain a 16:9 aspect ratio */
    }
}

.audio-only .vjs-tech {
    visibility: hidden; /* Hide the video element */
    height: 0; /* Collapse the height */
}

.audio-only .vjs-poster {
    display: block; /* Ensure the poster is still displayed */
}

.audio-only .vjs-control-bar {
    display: flex; /* Ensure the control bar is visible */
}

/* Netflix-style title overlay */
.video-title-overlay {
    position: absolute;
    top: 70px;
    left: 60px;
    right: 60px;
    z-index: 2;
    max-width: 50%;
    pointer-events: none;
    animation: fadeIn 0.5s ease-in;
}

.video-title-overlay.fade-out {
    animation: fadeOut 0.5s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

.video-title-overlay h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    color: #fff;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.9);
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.video-title-overlay .metadata-line {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    font-size: 1.1rem;
    font-weight: 500;
    color: #fff;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.8);
}

.video-title-overlay .metadata-item {
    display: flex;
    align-items: center;
}

.video-title-overlay .metadata-separator {
    width: 4px;
    height: 4px;
    background: #fff;
    border-radius: 50%;
    opacity: 0.7;
}

.video-title-overlay .series-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
    margin: 0 0 8px 0;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.8);
}

@media screen and (max-width: 1024px) {
    .video-title-overlay {
        top: 60px;
        left: 40px;
        right: 40px;
        max-width: 60%;
    }
    
    .video-title-overlay h2 {
        font-size: 2rem;
    }
    
    .video-title-overlay .metadata-line {
        font-size: 1rem;
        gap: 10px;
    }
    
    .video-title-overlay .series-name {
        font-size: 1.1rem;
    }
}

@media screen and (max-width: 768px) {
    .video-title-overlay {
        top: 50px;
        left: 20px;
        right: 20px;
        max-width: 75%;
    }
    
    .video-title-overlay h2 {
        font-size: 1.5rem;
    }
    
    .video-title-overlay .metadata-line {
        font-size: 0.9rem;
        gap: 8px;
    }
    
    .video-title-overlay .series-name {
        font-size: 1rem;
    }
}

/* ===== CHAPTERS UI STYLES ===== */

/* Floating skip button - bottom right (Netflix-style) */
.skip-chapter-button {
    position: absolute;
    bottom: 80px;
    right: 20px;
    z-index: 3;
    animation: fadeInUp 0.3s ease-in;
}

.skip-chapter-button button {
    background: rgba(42, 42, 42, 0.85);
    color: white;
    padding: 12px 24px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    text-transform: capitalize;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.skip-chapter-button button:hover {
    background: rgba(255, 255, 255, 0.95);
    color: #000;
    border-color: white;
    transform: scale(1.05);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Control bar Chapters Menu button */
.vjs-chapters-menu-button {
    cursor: pointer;
    font-size: 1em;
    transition: all 0.2s ease;
    width: 3em;
    height: 3em;
}

.vjs-chapters-menu-button:before {
    content: "";
    display: inline-block;
    width: 1.8em;
    height: 1.8em;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M3 3h8v8H3V3zm10 0h8v8h-8V3zM3 13h8v8H3v-8zm15 0h-2v3h-3v2h3v3h2v-3h3v-2h-3v-3z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.vjs-chapters-menu-button:hover {
    opacity: 0.8;
    transform: scale(1.1);
}

/* Control bar Next Chapter button */
.vjs-next-chapter-button {
    cursor: pointer;
    font-size: 1em;
    transition: all 0.2s ease;
    width: 3em;
    height: 3em;
}

.vjs-next-chapter-button:before {
    content: "";
    display: inline-block;
    width: 1.8em;
    height: 1.8em;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M7.58 16.89l5.77-4.07c.56-.4.56-1.24 0-1.63L7.58 7.11C6.91 6.65 6 7.12 6 7.93v8.14c0 .81.91 1.28 1.58.82zM16 7v10c0 .55.45 1 1 1s1-.45 1-1V7c0-.55-.45-1-1-1s-1 .45-1 1z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.vjs-next-chapter-button:hover {
    opacity: 0.8;
    transform: scale(1.1);
}

/* Legacy button classes (if needed) */
.vjs-skip-chapter {
    height: 36px;
    background-size: 18px;
    cursor: pointer;
}

.vjs-skip-chapter:hover {
    opacity: 0.8;
}

/* Chapters menu panel */
.chapters-list {
    position: fixed;
    right: 0;
    bottom: 30px;
    width: 30%;
    height: calc(100% - 50px);
    background-color: rgba(0, 0, 0, 0.95);
    color: #fff;
    padding: 0;
    z-index: 2;
    overflow: hidden;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.chapters-container {
    overflow-y: auto;
    height: calc(100% - 60px);
    padding: 10px 15px;
}

.chapter-item {
    padding: 12px 16px;
    cursor: pointer;
    border-radius: 6px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.05);
    border-left: 3px solid transparent;
}

.chapter-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(-4px);
}

.chapter-item.active {
    background: rgba(255, 255, 255, 0.1);
    border-left-color: var(--play-progress, #E50914);
}

.chapter-item .badge {
    font-size: 10px;
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.2);
}

/* Ensure progress bar maintains color */
.video-js .vjs-play-progress {
    background-color: var(--play-progress, #E50914) !important;
}

.video-js .vjs-load-progress {
    background: rgba(255, 255, 255, 0.3);
}

.video-js .vjs-progress-holder {
    background: rgba(255, 255, 255, 0.2);
}

/* Chapter markers on progress bar */
.vjs-marker.chapter-marker {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    transition: all 0.2s ease;
    pointer-events: none;
    z-index: 1;
}

.vjs-marker.chapter-marker:hover {
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.8);
}

/* .vjs-marker.skippable-marker {
    background: var(--play-progress, #E50914);
    box-shadow: 0 0 6px rgba(229, 9, 20, 0.6);
}

.vjs-marker.skippable-marker:hover {
    background: var(--play-progress, #E50914);
    box-shadow: 0 0 10px rgba(229, 9, 20, 0.8);
} */

/* Scrollbar styling for chapters container */
.chapters-container::-webkit-scrollbar {
    width: 6px;
}

.chapters-container::-webkit-scrollbar-track {
    background: transparent;
}

.chapters-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.chapters-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Responsive adjustments for chapters UI */
@media screen and (max-width: 1024px) {
    .chapters-list {
        width: 40%;
    }
}

@media screen and (max-width: 768px) {
    .chapters-list {
        width: 100%;
        height: calc(100% - 30px);
        bottom: 0;
    }
    
    .skip-chapter-button {
        bottom: 70px;
        right: 15px;
    }
    
    .skip-chapter-button button {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .vjs-marker.chapter-marker {
        width: 6px;
        height: 6px;
    }
    
    .vjs-marker.chapter-marker:hover {
        width: 8px;
        height: 8px;
    }
}

@media screen and (max-width: 480px) {
    .skip-chapter-button {
        bottom: 60px;
        right: 10px;
    }
    
    .skip-chapter-button button {
        padding: 8px 16px;
        font-size: 13px;
    }
}