/**
 * Dopek Video Player Styles - player.dopek.eu standalone
 * Same design as dopekvideo extension
 */
/* Dopek Video Player */
.dopek-video-player {
    position: relative;
    width: 100%;
    max-width: 100%;
    background: #000;
    margin: 20px 0;
    border-radius: 4px;
    overflow: hidden;
    /* border: 2px solid #fff; */
    box-sizing: border-box;
}

.dopek-video-player video {
    width: 100%;
    height: auto;
    display: block;
    cursor: pointer;
    background: #000;
}

.dopek-video-player video::-webkit-media-controls,
.dopek-video-player video::-webkit-media-controls-enclosure,
.dopek-video-player video::-webkit-media-controls-panel {
    display: none !important;
}

.dopek-video-player video[poster] {
    object-fit: contain;
}

.dopek-top-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(to bottom, rgba(0,0,0,0.75) 0%, transparent 100%);
    padding: 8px 12px;
    z-index: 2;
    pointer-events: auto;
}

.dopek-top-bar .dopek-video-title {
    flex: 1;
    min-width: 0;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    line-height: 1.3;
    margin: 0;
    padding-right: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dopek-top-bar .dopek-fullscreen-top {
    flex-shrink: 0;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 6px;
}

.dopek-video-title {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.8) 0%, transparent 100%);
    color: #fff;
    padding: 8px 12px;
    font-size: 18px;
    font-weight: bold;
    z-index: 2;
}

.dopek-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: rgba(0,0,0,0.7);
    border-radius: 50%;
    border: 3px solid #fff;
    cursor: pointer;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
    transition: all 0.3s;
}

.dopek-play-btn:hover {
    background: rgba(18,163,235,0.8);
    transform: translate(-50%, -50%) scale(1.1);
}

.dopek-play-btn::before {
    content: '▶';
    margin-left: 5px;
}

.dopek-video-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    width: 40px;
    height: 40px;
    display: none;
    pointer-events: none;
}

.dopek-video-loader:before {
    content: "";
    display: block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: dopek-spin 0.8s linear infinite;
}

@keyframes dopek-spin {
    to { transform: rotate(360deg); }
}

.dopek-video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
    padding: 0;
    display: none;
    z-index: 3;
    flex-direction: column;
    pointer-events: auto;
}

.dopek-video-player.playing .dopek-video-controls,
.dopek-video-controls.show {
    display: flex;
}

.dopek-controls-row {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    gap: 0px;
    flex-wrap: nowrap;
    min-height: 44px;
    min-width: 0;
}

.dopek-seekbar {
    flex: 1 1 auto;
    min-width: 75px;
    height: 40px;
    position: relative;
    display: block;
    cursor: pointer;
    margin: 0 8px;
}

.dopek-seekbar-track {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    margin-top: -3px;
    height: 6px;
    background: rgba(255,255,255,0.4);
    border-radius: 3px;
    pointer-events: none;
}

.dopek-seekbar-buffer {
    position: absolute;
    left: 0;
    top: 50%;
    margin-top: -3px;
    height: 6px;
    background: rgba(255,255,255,0.25);
    border-radius: 3px;
    transition: width 0.1s;
    pointer-events: none;
}

.dopek-seekbar-played {
    position: absolute;
    left: 0;
    top: 50%;
    margin-top: -3px;
    height: 6px;
    background: #12A3EB;
    border-radius: 3px;
    transition: width 0.1s;
    pointer-events: none;
}

.dopek-seek-thumb {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #12A3EB;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.15);
    z-index: 20;
    cursor: pointer;
}

.dopek-seek-slider {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    width: 100%;
    height: 40px;
    margin: 0;
    padding: 0;
    opacity: 0.01;
    cursor: pointer;
    z-index: 3;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
}

.dopek-seek-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: #12A3EB;
    border-radius: 50%;
    cursor: pointer;
}

.dopek-seek-slider::-moz-range-thumb {
    width: 13px;
    height: 13px;
    background: #12A3EB;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.dopek-time-current, .dopek-time-remaining {
    color: rgba(255,255,255,0.95);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
    min-width: 2.5em;
}

.dopek-play-pause-btn { min-width: 30px; }

.dopek-video-controls button {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 6px;
}

.dopek-video-controls button:hover { opacity: 0.7; }

.dopek-copy-wrapper {
    display: inline-flex;
    gap: 0px;
    align-items: center;
}

.dopek-quality-container {
    display: flex !important;
    align-items: center !important;
    flex-shrink: 0 !important;
}

.dopek-quality-container:empty { display: none !important; }

.dopek-quality-btn {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 15px !important;
    padding: 5px 8px !important;
    cursor: pointer;
}

.dopek-quality-menu {
    display: none;
    position: absolute;
    bottom: 100%;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 8px 0;
    margin-bottom: 4px;
    min-width: 100px;
    z-index: 10001;
}

.dopek-quality-menu.show { display: block; }

.dopek-quality-option {
    padding: 8px 16px;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
}

.dopek-quality-option:hover { background: rgba(255, 255, 255, 0.1); }

.dopek-quality-option.active { background: rgba(255, 255, 255, 0.2); }

.dopek-volume-control {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-shrink: 0;
    position: relative;
}

.dopek-volume-slider-wrap {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 4px;
    width: 12px;
    height: 44px;
    background: rgba(0, 0, 0, 0.65);
    border-radius: 4px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 100;
    transition: opacity 0.15s, visibility 0.15s;
}

.dopek-volume-control:hover .dopek-volume-slider-wrap {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.dopek-volume-track {
    position: absolute;
    left: 3px;
    right: 3px;
    bottom: 0;
    top: 0;
    border-radius: 2px;
    overflow: hidden;
}

.dopek-volume-fill {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 100%;
    background: #12A3EB;
    border-radius: 2px;
    transition: height 0.05s;
}

.dopek-volume-thumb {
    position: absolute;
    left: 50%;
    bottom: 100%;
    width: 10px;
    height: 10px;
    margin-left: -5px;
    margin-bottom: -5px;
    background: #12A3EB;
    border-radius: 50%;
    pointer-events: none;
}

/* Playlist Styles - height matches main player (260px) */
.dopek-playlist {
    margin: 0;
    display: flex;
    gap: 12px;
    flex-wrap: nowrap;
    align-items: stretch;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    height: 246px;
    max-height: 246px;
    border: 2px solid #fff;
    border-radius: 4px;
    box-sizing: border-box;
    overflow: hidden;
}

.dopek-playlist-main {
    flex: 1 1 0;
    min-width: 240px;
    max-width: none;
    aspect-ratio: 16 / 9;
    max-height: 100%;
    min-height: 0;
}

.dopek-playlist-main .dopek-video-player {
    margin: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #000;
    position: relative;
}

.dopek-playlist-main .dopek-video-player video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    min-height: 0;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
}

.dopek-playlist-sidebar {
    flex: 0 0 200px;
    min-width: 200px;
    max-width: 200px;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.dopek-playlist-container .dopek-playlist .dopek-playlist-item {
    flex-direction: column;
    box-sizing: border-box;
}

.dopek-playlist-item {
    display: flex;
    gap: 4px;
    margin-bottom: 0;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: background 0.2s;
    background: transparent;
    box-sizing: border-box;
    flex-shrink: 0;
    border-left: 3px solid transparent;
}

.dopek-playlist-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.dopek-playlist-item.active {
    background: rgba(18, 163, 235, 0.1);
    border-left: 3px solid #12A3EB;
}

.dopek-playlist-item-thumb {
    flex: 0 0 auto !important;
    width: 100%;
    min-height: 0;
    aspect-ratio: 16 / 9;
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    background: #000;
}

.dopek-playlist-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.dopek-playlist-item-thumb .dopek-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    opacity: 0;
    transition: opacity 0.2s;
}

.dopek-playlist-item:hover .dopek-play-overlay,
.dopek-playlist-item.active .dopek-play-overlay {
    opacity: 1;
}

.dopek-playlist-item.active .dopek-play-overlay {
    background: rgba(18, 163, 235, 0.8);
}

.dopek-playlist-item-title {
    font-size: 12.3px;
    font-weight: 400;
    color: #fff;
    line-height: 1.3;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}

.dopek-playlist-item.hover .dopek-playlist-item-title,.dopek-playlist-item.active .dopek-playlist-item-title {
    color: #12A3EB;
    font-weight: 600 !important;
}

.dopek-playlist-container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
}
.dopek-quality-label {
    font-size: 9px !important;
    font-weight: 600;
    opacity: 0.9;
}
.dopek-playlist-container .dopek-playlist, .dopek-video-container .dopek-video-player, .content .dopek-video-embed .dopek-video-player, .content .dopek-playlist, .mchat-text .dopek-playlist, .mchat-text .dopek-video-embed .dopek-video-player {
    border: 2px solid #fff;
    border-radius: 4px;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    body { padding: 12px; }
    .dopek-playlist { flex-direction: column; align-items: flex-start; }
    .dopek-playlist-container .dopek-playlist-main { flex: 0 0 auto; min-width: 100%; aspect-ratio: 16 / 9;}
    .dopek-playlist-sidebar {
        flex: 0 0 auto;
        width: 100%;
        min-width: 100%;
        max-width: 100%;
        height: auto;
        max-height: 320px;
        flex-direction: row;
        flex-wrap: wrap;
    }
    /* .dopek-playlist-item { flex: 0 0 50%; min-width: 140px; } */
    .dopek-playlist-item-thumb { max-width: 120px; }
}
