/* =======================================================
   DLE PLAYLISTS PLUGIN - MAIN STYLES (v4.1)
   ======================================================= */

/* --- 1. ОСНОВНОЙ КОНТЕЙНЕР --- */
.playlists-player {
    position: relative;
    background: #000;
    color: #fff;
    width: 100%;
    margin-bottom: 20px;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* --- 2. ОБЛАСТЬ ВИДЕО (IFRAME) --- */
.playlists-iframe {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* Соотношение 16:9 */
    background: #000;
}

.playlists-iframe iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    z-index: 1;
}

/* Скелетон-загрузка (Спиннер) */
.playlists-iframe.loading {
    background: #0a0a0a;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.playlists-iframe.loading::before {
    content: "";
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: #446995; /* Акцентный цвет */
    border-radius: 50%;
    animation: pl-spin 1s linear infinite;
}

@keyframes pl-spin {
    to { transform: rotate(360deg); }
}

/* --- 3. ПАНЕЛИ СПИСКОВ (СЕЗОНЫ И СЕРИИ) --- */
.playlists-lists, 
.playlists-videos {
    background: #1a1a1a;
    border-top: 1px solid #2a2a2a;
    position: relative;
    height: 50px;
    overflow: hidden;
    user-select: none;
}

/* Контейнер Swiper */
.playlists-items {
    height: 50px;
    padding: 0 40px; /* Отступы для стрелок */
    position: relative;
}

.swiper-container {
    width: 100%;
    height: 100%;
}

.swiper-wrapper {
    align-items: center;
}

/* --- 4. ЭЛЕМЕНТЫ СПИСКА (СЛАЙДЫ) --- */
.playlists-items li.swiper-slide {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: auto;
    padding: 0 20px;
    cursor: pointer;
    color: #aaa;
    font-size: 14px;
    font-weight: 500;
    border-right: 1px solid #2a2a2a;
    transition: all 0.2s ease;
    background: transparent;
    box-sizing: border-box;
    white-space: nowrap;
}

/* Специфика для серий (нужен отступ под глазик) */
.playlists-videos li.swiper-slide {
    padding-right: 30px !important; /* Больше места справа для иконки */
}

/* Состояния: Hover и Active */
.playlists-items li:hover {
    color: #fff;
    background: #252525;
}

.playlists-items li.active {
    color: #fff;
    background: #333;
    font-weight: 700;
    box-shadow: inset 0 -3px 0 #446995; /* Синяя полоска снизу */
}

/* --- 5. ГЛАЗИК (ПРОСМОТРЕНО) --- */
.playlists-view {
    position: absolute;
    right: 8px; /* Прижат к правому краю ячейки */
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 576 512'%3E%3Cpath fill='%23ffffff' d='M288 144a110.94 110.94 0 0 0-31.24 5 55.4 55.4 0 0 1 7.24 27 56 56 0 0 1-56 56 55.4 55.4 0 0 1-27-7.24A111.71 111.71 0 1 0 288 144zm284.52 97.4C518.29 135.59 410.93 64 288 64S57.68 135.64 3.48 241.41a32.35 32.35 0 0 0 0 29.19C57.71 376.41 165.07 448 288 448s230.32-71.64 284.52-177.41a32.35 32.35 0 0 0 0-29.19zM288 400a144 144 0 1 1 144-144 143.93 143.93 0 0 1-144 144z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.2;
    cursor: pointer;
    z-index: 10;
    transition: opacity 0.2s;
}

.playlists-view:hover {
    opacity: 0.7;
}

.playlists-view.watched {
    opacity: 1;
    filter: sepia(100%) hue-rotate(90deg) saturate(500%); /* Делает иконку золотисто-зеленой */
}

/* --- 6. НАВИГАЦИЯ (СТРЕЛКИ SWIPER) --- */
.playlists-items .swiper-button-prev, 
.playlists-items .swiper-button-next {
    position: absolute;
    top: 0;
    margin-top: 0;
    width: 40px;
    height: 100%;
    background-color: #1a1a1a;
    color: #fff;
    z-index: 20;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.playlists-items .swiper-button-prev {
    left: 0;
    border-right: 1px solid #2a2a2a;
}

.playlists-items .swiper-button-next {
    right: 0;
    border-left: 1px solid #2a2a2a;
}

.playlists-items .swiper-button-prev::after, 
.playlists-items .swiper-button-next::after {
    font-size: 16px !important;
    font-weight: 900;
}

/* Ховер на стрелки */
.playlists-items .swiper-button-prev:hover, 
.playlists-items .swiper-button-next:hover {
    background-color: #446995;
    color: #fff;
    border-color: #446995;
}

.playlists-items .swiper-button-disabled {
    opacity: 0.3;
    cursor: default;
    pointer-events: none;
    background-color: #151515 !important;
    color: #555 !important;
}

/* --- 7. СКРОЛЛБАР SWIPER (ТОНКИЙ) --- */
.playlists-items .swiper-scrollbar {
    background: rgba(255,255,255,0.05);
    height: 3px !important;
    bottom: 0 !important;
    left: 0;
    width: 100%;
    z-index: 15;
}

.playlists-items .swiper-scrollbar-drag {
    background: #446995;
    border-radius: 0;
}

/* --- 8. НИЖНЯЯ ПАНЕЛЬ УПРАВЛЕНИЯ --- */
.playlists-controls {
    background: #151515;
    padding: 8px 15px;
    border-top: 1px solid #2a2a2a;
    display: flex;
    justify-content: flex-end; /* Кнопки справа */
    align-items: center;
    min-height: 40px;
}

/* Кнопка "Следующая серия" */
.pl-next-episode {
    background: #27ae60; /* Зеленый Netflix-style */
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s, background-color 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.pl-next-episode:hover {
    background: #2ecc71;
    transform: translateX(3px); /* Легкий сдвиг вправо */
}

.pl-next-episode span {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}