/* ADPLAY - Video Player Styles */

/* Base Styles */
* {
    box-sizing: border-box;
}

body {
    background-color: #1a1a1a;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

/* Wrapper */
.abplay-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Main Player Container */
/* Disable text selection and context menu */
.abplay,
.abplay * {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.abplay {
    position: relative;
    width: 100%;
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Video Screen */
.abplay-screen {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #000;
}

.abplay-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Poster overlay for reliable display */
.abplay-poster-overlay,
.abplay-poster {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.abplay-poster-overlay.hidden,
.abplay-poster.hidden {
    opacity: 0;
}

/* Overlay */
.abplay-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        transparent 60%,
        rgba(0, 0, 0, 0.7) 100%
    );
    opacity: 0;
    transition: opacity 0.3s ease, cursor 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 15px 20px;
    pointer-events: none;
    cursor: default;
    overflow: visible;
}

.abplay:hover .abplay-overlay,
.abplay.has-overlay .abplay-overlay {
    opacity: 1;
}

/* Enable pointer events only for controls inside overlay */
.abplay-overlay .abplay-control,
.abplay-overlay .abplay-upoverlay,
.abplay-overlay .abplay-playbutton,
.abplay-overlay .abplay-pausebutton,
.abplay-overlay .abplay-nextbutton,
.abplay-overlay .abplay-fullscreen,
.abplay-overlay .abplay-volumeplay,
.abplay-overlay .abplay-volumemute,
.abplay-overlay .abplay-pvolime,
.abplay-overlay .abplay-progress {
    pointer-events: auto;
}

/* Enable pointer events for dropdown toggles */
.abplay-overlay .abplay-subtitles-dropdown,
.abplay-overlay .abplay-quality-dropdown {
    pointer-events: auto;
}

/* Cursor hiding when controls are hidden */
.abplay:not(:hover):not(.has-overlay) .abplay-overlay {
    cursor: none;
}

/* Navigation Buttons (Prev/Next on screen edges) */
.abplay-nav-prev,
.abplay-nav-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 80px;
    background: rgba(0, 0, 0, 0.3);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.3;
    transition: all 0.3s ease;
    z-index: 100;
    pointer-events: auto;
}

.abplay-nav-prev {
    left: 15px;
}

.abplay-nav-next {
    right: 15px;
}

.abplay-nav-prev i,
.abplay-nav-next i {
    color: #ffffff;
    font-size: 24px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.abplay-nav-prev:hover,
.abplay-nav-next:hover {
    opacity: 0.5;
    background: rgba(0, 0, 0, 0.5);
}

.abplay-nav-prev:hover i,
.abplay-nav-next:hover i {
    transform: scale(1.1);
}

.abplay-nav-prev:active,
.abplay-nav-next:active {
    transform: translateY(-50%) scale(0.95);
}

/* Hide navigation buttons on mobile */
@media (max-width: 767.98px) {
    .abplay-nav-prev,
    .abplay-nav-next {
        width: 40px;
        height: 60px;
    }
    
    .abplay-nav-prev i,
    .abplay-nav-next i {
        font-size: 20px;
    }
}

/* Upper Overlay - Title and Logo */
.abplay-upoverlay {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
}

.abplay-title {
    padding: 5px 10px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
}

.abplay-clipname {
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.abplay-logo-holder {
    background: #000000;
    border-radius: 4px;
    padding: 4px 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hide logo holder on mobile - no logo displayed */
@media (max-width: 767.98px) {
    .abplay-logo-holder {
        display: none !important;
    }
}

.abplay-logo {
    display: inline-block;
    font-weight: bold;
    font-size: 14px;
    letter-spacing: 1px;
}

.abplay-logo a {
    font-weight: bold;
    font-size: 14px;
    letter-spacing: 1px;
    text-decoration: none;
    color: #ffffff;
    display: inline-block;
    transition: color 0.2s ease;
    padding: 4px 8px;
    background: transparent;
}

.abplay-logo a:hover {
    color: #0d6efd !important;
}

/* Custom Logo Image (150x150px, contain method) */
.abplay-logo-img {
    width: 150px;
    height: 150px;
    object-fit: contain;
    display: block;
    background: transparent;
}

/* When using custom logo, remove padding from holder */
.abplay-logo-holder.has-custom-logo {
    padding: 0;
    border: none;
    background: transparent;
}

/* Ensure link wraps image properly */
.abplay-logo a {
    display: block;
    padding: 0;
    background: transparent;
}

/* Series Name Display in Player Header */
.abplay-serialname {
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 400px;
    margin-bottom: 6px;
}

/* Series Name in Context Playlist (above thumbnail) */
.abplay-context-serialname {
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
    padding: 0 2px;
}

.abplay-context-item.active .abplay-context-serialname {
    color: #0d6efd;
}

/* Control Section */
.abplay-control {
    width: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 6px;
    padding: 10px 15px;
}

/* Progress Bar */
.abplay-progress {
    height: 6px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    cursor: pointer;
    margin-bottom: 10px;
    transition: height 0.2s ease;
    overflow: visible;
    position: relative;
}

.abplay-progress:hover {
    height: 10px;
}

.abplay-progress .progress-bar {
    background: linear-gradient(90deg, #0d6efd, #0a58ca);
    border-radius: 3px;
    transition: width 0.1s linear;
    cursor: pointer;
    position: relative;
    z-index: 1;
}

.abplay-progress:hover .progress-bar {
    background: linear-gradient(90deg, #0d6efd, #0a58ca);
}

/* Progress Bar Markers - Intro/Outro markers */
.abplay-progress-markers {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
}

.abplay-progress-marker {
    position: absolute;
    top: 0;
    width: 1px;
    height: 6px;
    z-index: 4;
    transition: all 0.2s ease;
}

.abplay-progress-marker-open-start {
    background-color: #ffffff;
    box-shadow: 0 0 3px rgba(255, 255, 255, 0.8);
}

.abplay-progress-marker-open {
    background-color: #ffffff;
    box-shadow: 0 0 3px rgba(255, 255, 255, 0.8);
}

.abplay-progress-marker-close {
    background-color: #dc3545;
    box-shadow: 0 0 3px rgba(220, 53, 69, 0.8);
}

.abplay-progress-marker-close-end {
    background-color: #dc3545;
    box-shadow: 0 0 3px rgba(220, 53, 69, 0.8);
}

/* Увеличиваем высоту маркеров при наведении на прогресс бар */
.abplay-progress:hover .abplay-progress-marker {
    height: 14px;
    top: -4px;
}

/* Progress Bar Tooltip - Floating timestamp on hover */
.abplay-progress-tooltip {
    position: absolute;
    bottom: 100%;
    left: 0;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.95);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-family: 'Courier New', monospace;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease, bottom 0.15s ease;
    z-index: 1000;
    margin-bottom: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.abplay-progress-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.95);
}

.abplay-progress:hover .abplay-progress-tooltip {
    opacity: 1;
    visibility: visible;
    bottom: 100%;
}

.abplay-tooltip-time {
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Controls Row - adplay-right and adplay-left in 1 row */
.abplay-controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    flex-wrap: nowrap;
}

.abplay-right,
.abplay-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
}

/* Play Button Area */
.abplay-playbutton-area {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.abplay-playbutton,
.abplay-pausebutton {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    cursor: pointer;
    color: #fff;
}

.abplay-playbutton:hover,
.abplay-pausebutton:hover,
.abplay-fullscreen:hover,
.abplay-nextbutton:hover,
.abplay-volumeplay:hover,
.abplay-volumemute:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.abplay-playbutton i,
.abplay-pausebutton i {
    font-size: 16px;
}

/* Timer */
.abplay-timer {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #fff;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    flex-shrink: 0;
}

.abplay-currenttime,
.abplay-duration {
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.abplay-divider {
    color: rgba(255, 255, 255, 0.6);
}

/* Left Controls */
.abplay-left {
    display: flex;
    align-items: center;
}

/* Next Button */
.abplay-nextbutton {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    cursor: pointer;
    color: #fff;
    flex-shrink: 0;
}

.abplay-nextbutton i {
    font-size: 14px;
}

.abplay-nextbutton:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.abplay-nextbutton.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.abplay-nextbutton.disabled:hover {
    transform: none;
    background-color: transparent;
}

/* Fullscreen Button */
.abplay-fullscreen {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    cursor: pointer;
    color: #fff;
    flex-shrink: 0;
}

.abplay-fullscreen i {
    font-size: 14px;
}

/* Subtitles Dropdown */
.abplay-subtitles-dropdown {
    position: relative;
    flex-shrink: 0;
}

.abplay-subtitles {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    cursor: pointer;
    color: #fff;
    flex-shrink: 0;
}

.abplay-subtitles::after {
    display: none !important;
}

.abplay-subtitles i {
    font-size: 14px;
}

.abplay-subtitles:hover {
    background: rgba(255, 255, 255, 0.1);
}

.abplay-subtitles.active,
.abplay-subtitles-dropdown.show .abplay-subtitles {
    color: #0d6efd;
}

.abplay-subtitles:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* Subtitles Menu */
.abplay-subtitles-menu {
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 120px;
}

.abplay-subtitles-menu .dropdown-item {
    color: #fff;
    padding: 8px 16px;
    font-size: 13px;
}

.abplay-subtitles-menu .dropdown-item:hover,
.abplay-subtitles-menu .dropdown-item:focus {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.abplay-subtitles-menu .dropdown-item.active {
    background: #0d6efd;
    color: #fff;
}

/* Quality Dropdown */
.abplay-quality-dropdown {
    position: relative;
    display: flex;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.abplay-quality-dropdown > .abplay-quality {
    position: relative;
    top: 0px;
    right: 0px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    cursor: pointer;
    color: #fff;
    flex-shrink: 0;
}

.abplay-quality::after {
    display: none !important;
}

.abplay-quality i {
    font-size: 14px;
}

.abplay-quality:hover {
    background: rgba(255, 255, 255, 0.1);
}

.abplay-quality.active,
.abplay-quality-dropdown.show .abplay-quality {
    color: #0d6efd;
}

.abplay-quality:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* Quality Menu */
.abplay-quality-menu {
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 100px;
}

.abplay-quality-menu .dropdown-item {
    color: #fff;
    padding: 8px 16px;
    font-size: 13px;
}

.abplay-quality-menu .dropdown-item:hover,
.abplay-quality-menu .dropdown-item:focus {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.abplay-quality-menu .dropdown-item.active {
    background: #0d6efd;
    color: #fff;
}

.abplay-quality-menu .dropdown-item.disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* Dropdown positioning - ensure menus are visible and clickable */
.abplay-subtitles-dropdown .dropdown-menu,
.abplay-quality-dropdown .dropdown-menu {
    position: absolute;
    z-index: 1000;
    /* Принудительно показываем меню */
    display: none;
}

.abplay-subtitles-dropdown .dropdown-menu.show,
.abplay-quality-dropdown .dropdown-menu.show {
    display: block;
}

/* Ensure dropdown toggle buttons receive clicks */
.abplay-subtitles-dropdown .abplay-subtitles,
.abplay-quality-dropdown .abplay-quality {
    pointer-events: auto;
}

/* Ensure dropdown menus receive clicks */
.abplay-subtitles-dropdown .dropdown-menu,
.abplay-quality-dropdown .dropdown-menu {
    pointer-events: auto;
}

/* Force captions to bottom */
.abplay-video::-webkit-media-text-track-container {
    position: absolute !important;
    top: 85% !important;
    bottom: 60px !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}

.abplay-video::-webkit-media-text-track-display {
    position: static !important;
    display: block !important;
    margin: 0 auto !important;
    text-align: center !important;
}

.abplay-video::cue {
    background-color: rgba(0, 0, 0, 0.75) !important;
    color: #fff !important;
    font-size: 24px !important;
    padding: 4px 12px !important;
    border-radius: 4px !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8) !important;
}
    white-space: pre-wrap !important;
    max-width: 90% !important;
    margin: 0 auto !important;
}

/* Firefox captions */
.abplay-screen video::cue {
    background-color: rgba(0, 0, 0, 0.8) !important;
    color: #fff !important;
}
    background-color: rgba(0, 0, 0, 0.75) !important;
    color: #fff !important;
    font-size: 18px !important;
    padding: 4px 12px !important;
    border-radius: 4px !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8) !important;
}
}

/* Volume Area */
.abplay-volume-area {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.abplay-volumeplay,
.abplay-volumemute {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    cursor: pointer;
    color: #fff;
    flex-shrink: 0;
}

.abplay-volumeplay i,
.abplay-volumemute i {
    font-size: 14px;
}

/* Volume Progress */
.abplay-pvolime {
    width: 80px;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    cursor: pointer;
    transition: height 0.2s ease;
    flex-shrink: 0;
}

.abplay-pvolime:hover {
    height: 6px;
}

.abplay-pvolime .progress-bar {
    background: linear-gradient(90deg, #0d6efd, #0a58ca);
    border-radius: 2px;
    cursor: pointer;
    transition: width 0.1s linear;
}

/* Next Episode Popup - Bottom Left Corner */
.abplay-nextpopup {
    position: absolute;
    bottom: 80px;
    left: 20px;
    width: 35%;
    max-width: 400px;
    background: rgba(0, 0, 0, 0.9);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: none;
    z-index: 100;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

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

.abplay-nextpopup.show {
    display: block;
}

.abplay-nextpopup-content {
    padding: 12px;
}

.abplay-nextpopup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.abplay-nextpopup-title {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.abplay-nextpopup-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.abplay-nextpopup-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.abplay-nextpopup-body {
    display: flex;
    gap: 12px;
}

.abplay-nextpopup-image {
    width: 120px;
    height: 68px;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden;
}

.abplay-nextpopup-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.abplay-nextpopup-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.abplay-nextpopup-info h5 {
    color: #fff;
    font-size: 14px;
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.abplay-nextpopup-info p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    margin: 0;
}

.abplay-nextpopup-progress {
    margin-top: 10px;
}

.abplay-nextpopup-progress .progress {
    background-color: rgba(255, 255, 255, 0.1);
}

.abplay-nextpopup-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 10px;
}

.abplay-nextpopup-actions .btn {
    padding: 6px 12px;
    font-size: 12px;
}

/* Options Section */
.abplay-options {
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
}

.abplay-options .btn-check {
    position: absolute;
    clip: rect(0, 0, 0, 0);
    pointer-events: none;
}

.abplay-options .btn {
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.abplay-options .btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.abplay-options .btn:focus {
    box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.25);
}

/* Active state for button-style checkboxes */
.abplay-options .btn-check:checked + .btn {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
}

.abplay-options .btn-check:checked + .btn:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

.abplay-options .btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.abplay-options .btn:focus {
    box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.25);
}

/* Context Playlist Strip - Quick Navigation Module */
.abplay-context-strip {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    padding: 10px 15px;
    overflow: hidden;
}

.abplay-context-grid {
    display: flex;
    gap: 10px;
}

.abplay-context-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s ease;
    min-width: 0;
}

.abplay-context-item:hover {
    opacity: 0.8;
}

.abplay-context-item.active {
    cursor: default;
    opacity: 1;
    border: 2px solid #0d6efd;
    border-radius: 6px;
    padding: 2px;
}

.abplay-context-item.active .abplay-context-thumb {
    border-radius: 4px;
}

.abplay-context-item.disabled {
    opacity: 0.4;
    pointer-events: none;
    cursor: not-allowed;
}

.abplay-context-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #000;
    border-radius: 4px;
}

.abplay-context-season-episode {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 4px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.abplay-context-item.active .abplay-context-season-episode {
    color: #0d6efd;
}

.abplay-context-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.abplay-context-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    padding: 4px 0;
}

.abplay-context-number {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.6);
}

.abplay-context-title {
    font-size: 12px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.abplay-context-item.active .abplay-context-number,
.abplay-context-item.active .abplay-context-title {
    color: #0d6efd;
    font-weight: 600;
}

/* Placeholder for missing episodes */
.abplay-context-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16 / 9;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
    width: 100%;
}

/* Notification items (start/end) */
.abplay-notification .abplay-context-placeholder {
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(255, 255, 255, 0.2);
}

/* Responsive for context strip */
@media (max-width: 768px) {
    .abplay-context-grid {
        gap: 8px;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 5px;
    }
    
    .abplay-context-item {
        flex-shrink: 0;
        width: 120px;
        scroll-snap-align: start;
    }
    
    .abplay-context-title {
        font-size: 10px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .abplay-context-number {
        font-size: 9px;
    }
    
    .abplay-context-season-episode {
        font-size: 9px;
        margin-bottom: 2px;
    }
    
    .abplay-context-serialname {
        font-size: 9px;
        margin-bottom: 2px;
    }
}

/* Stats Section (Views and Likes) */
.abplay-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.abplay-views {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.abplay-views i {
    color: rgba(255, 255, 255, 0.6);
}

/* Like Button in Options */
.abplay-options .abplay-like-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    padding: 4px 8px;
}

.abplay-options .abplay-like-btn:hover {
    background: rgba(220, 53, 69, 0.1);
}

.abplay-options .abplay-like-btn.liked i {
    color: #dc3545;
}

.abplay-options .abplay-like-btn i {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

.abplay-options .abplay-like-count {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

/* Player Like Button (inside player overlay) */
.abplay-like-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    cursor: pointer;
    background: transparent;
    border: none;
}

.abplay-like-btn:hover {
    background: rgba(220, 53, 69, 0.1);
}

.abplay-like-btn.liked i {
    color: #dc3545;
}

.abplay-like-btn i {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.6);
    transition: color 0.2s ease;
}

.abplay-like-btn:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* Loading Spinner */
.abplay-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
}

.abplay-loading.show {
    display: block;
}

.abplay-loading .spinner-border {
    width: 50px;
    height: 50px;
    border-width: 3px;
}

/* Playlist Section */
.abplay-playlist {
    margin-top: 20px;
    background: #2a2a2a;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Left playlist (sidebar version) */
.abplay-left-playlist {
    margin-top: 0;
    height: 100%;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    position: sticky;
    top: 20px;
}

.abplay-left-playlist .abplay-playlist-title {
    font-size: 16px;
    margin-bottom: 10px;
}

.abplay-left-playlist .abplay-playlist-container {
    max-height: none;
}

/* Scrollbar styles for left playlist */
.abplay-left-playlist .abplay-playlist-container::-webkit-scrollbar {
    width: 6px;
}

.abplay-left-playlist .abplay-playlist-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.abplay-left-playlist .abplay-playlist-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.abplay-left-playlist .abplay-playlist-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.abplay-playlist-title {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.abplay-playlist-container {
    max-height: 400px;
    overflow-y: auto;
}

.abplay-playlist-container::-webkit-scrollbar {
    width: 8px;
}

.abplay-playlist-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.abplay-playlist-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.abplay-playlist-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Playlist Item */
.abplay-playlist-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
}

.abplay-playlist-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.1);
}

.abplay-playlist-item.active {
    background: rgba(13, 110, 253, 0.2);
    border-color: #0d6efd;
}

/* Left playlist compact items */
.abplay-left-playlist .abplay-playlist-item {
    padding: 8px;
    gap: 8px;
    margin-bottom: 6px;
}

.abplay-left-playlist .abplay-playlist-item .abplay-item-thumb {
    width: 60px;
    height: 34px;
}

.abplay-left-playlist .abplay-playlist-item .abplay-item-name {
    font-size: 12px;
}

.abplay-playlist-item .abplay-item-thumb {
    width: 80px;
    height: 45px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
    background: #000;
}

.abplay-playlist-item .abplay-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.abplay-playlist-item .abplay-item-info {
    flex: 1;
    min-width: 0;
}

.abplay-playlist-item .abplay-item-name {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.abplay-playlist-item .abplay-item-meta {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    display: flex;
    gap: 10px;
}

.abplay-playlist-item .abplay-item-duration {
    font-family: 'Courier New', monospace;
}

/* Responsive Design */
@media (max-width: 768px) {
    .abplay-wrapper {
        padding: 10px;
    }
    
    .abplay-overlay {
        padding: 10px 15px;
    }
    
    .abplay-clipname {
        font-size: 14px;
    }
    
    .abplay-logo a {
        font-size: 12px;
    }
    
    .abplay-playbutton,
    .abplay-pausebutton {
        width: 36px;
        height: 36px;
    }
    
    .abplay-timer {
        font-size: 12px;
    }
    
    .abplay-fullscreen,
    .abplay-nextbutton {
        width: 32px;
        height: 32px;
    }
    
    .abplay-pvolime {
        width: 60px;
    }
    
    .abplay-playlist-item .abplay-item-thumb {
        width: 60px;
        height: 34px;
    }
    
    .abplay-playlist-item .abplay-item-name {
        font-size: 12px;
    }
    
    .abplay-playlist-container {
        max-height: 300px;
    }
    
    .abplay-nextpopup {
        width: 45%;
        bottom: 70px;
        left: 15px;
    }
    
    .abplay-nextpopup-image {
        width: 80px;
        height: 45px;
    }
    
    .abplay-nextpopup-info h5 {
        font-size: 12px;
    }
    
    .abplay-nextpopup-info p {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .abplay-controls-row {
        gap: 10px;
        align-items: stretch;
    }
    
    .abplay-right,
    .abplay-left {
        justify-content: center;
    }
    
    .abplay-timer {
        display: none;
    }
    
    .abplay-pvolime {
        display: none;
    }
    
    /* Hide all logos on mobile */
    .abplay-logo,
    .abplay-logo-img {
        display: none !important;
    }
    
    .abplay-nextpopup {
        width: 90%;
        bottom: 60px;
        left: 5%;
    }
    
    .abplay-nextpopup-body {
        flex-direction: column;
    }
    
    .abplay-nextpopup-image {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }
}

/* Fullscreen Styles */
.abplay:fullscreen {
    border-radius: 0;
}

.abplay:fullscreen .abplay-screen {
    aspect-ratio: unset;
    height: 100vh;
}

.abplay:fullscreen .abplay-overlay {
    padding: 20px 30px;
}

.abplay:fullscreen .abplay-nextpopup {
    bottom: 90px;
    left: 30px;
    width: 30%;
    max-width: 450px;
}

/* Animation Classes */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.abplay-loading.show {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Focus States for Accessibility */
.abplay-playbutton:focus,
.abplay-pausebutton:focus,
.abplay-fullscreen:focus,
.abplay-nextbutton:focus,
.abplay-volumeplay:focus,
.abplay-volumemute:focus,
.abplay-progress:focus,
.abplay-pvolime:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* Hover Effects */
.abplay:hover .abplay-playbutton,
.abplay:hover .abplay-pausebutton {
    transform: scale(1.05);
}

/* Buffering State */
.abplay-video.waiting {
    cursor: wait;
}

/* Quality Indicator */
.abplay-quality {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

/* Error State */
.abplay-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #fff;
    padding: 20px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 8px;
    display: none;
}

.abplay-error.show {
    display: block;
}

.abplay-error i {
    font-size: 48px;
    margin-bottom: 15px;
    color: #dc3545;
}

.abplay-error p {
    margin: 0;
    font-size: 14px;
}

/* Episode Description Section */
.abplay-episode-description {
    margin-top: 20px;
    background: #2a2a2a;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.abplay-episode-title {
    color: #fff;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.abplay-episode-content {
    color: #e0e0e0;
}

.abplay-episode-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.abplay-episode-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.abplay-episode-meta-item i {
    color: #0d6efd;
}

/* Full Description Section */
.abplay-full-description {
    margin-top: 20px;
    background: #2a2a2a;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.abplay-full-description-h1 {
    color: #fff;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.abplay-full-description-content {
    color: #e0e0e0;
    font-size: 16px;
    line-height: 1.8;
}

.abplay-full-description-content p {
    margin-bottom: 15px;
}

.abplay-full-description-content p:last-child {
    margin-bottom: 0;
}

/* Responsive for Full Description Section */
@media (max-width: 768px) {
    .abplay-full-description {
        padding: 15px;
    }
    
    .abplay-full-description-h1 {
        font-size: 20px;
    }
    
    .abplay-full-description-content {
        font-size: 14px;
    }
}

/* Responsive for left playlist */
@media (max-width: 991.98px) {
    .abplay-left-playlist {
        display: none !important;
    }
}
