/* ====================================================
   1. ГАРНІ КНОПКИ ПЕРЕМИКАННЯ ПЛЕЄРІВ (Вкладки)
   ==================================================== */
.tabs-block__select {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 0 !important; /* Прибираємо відступ до плеєра */
    padding: 15px;
    background: #1f1f27;
    border-radius: 8px 8px 0 0;
}

.tabs-block__select span {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 10px 24px;
    background: #0d0d0f;
    border-radius: 6px;
    cursor: pointer;
    color: #8c8c9e;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.25s ease;
    border: 1px solid #2b2b35;
}

.tabs-block__select span:hover {
    background: #2b2b35;
    color: #ffffff;
    border-color: #444455;
}

.tabs-block__select span.active {
    background: #91b6c9 !important;
    color: #fff !important;
    border-color: #91b6c9 !important;
    box-shadow: 0 4px 12px rgba(145, 182, 201, 0.25);
}

/* ====================================================
   2. ГОЛОВНИЙ КОНТЕЙНЕР SMART PLAYLIST (Дизайн Anitube)
   ==================================================== */
.playlists-player {
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
}

#smart_player_ajax {
    display: flex !important;
    flex-direction: column !important;
    background: #111111 !important;
    padding: 12px !important;
    border-radius: 0 0 8px 8px !important;
}

/* Порядок блоків: 1.Озвучка, 2.Сезони, 3.Плеєр, 4.Серії */
#smart_player_ajax #translators-list { order: 1 !important; margin: 0 0 12px 0 !important; }
#smart_player_ajax #simple-seasons-tabs { order: 2 !important; margin: 0 0 12px 0 !important; }
#smart_player_ajax iframe { order: 3 !important; margin: 0 0 15px 0 !important; }
#smart_player_ajax #simple-episodes-list { order: 4 !important; margin: 0 !important; }

/* ====================================================
   3. ПЛЕЄР ТА ТЕХНІЧНІ ЕЛЕМЕНТИ
   ==================================================== */
#smart_player_ajax iframe {
    width: 100% !important;
    height: 420px !important;
    min-height: 420px !important;
    border-radius: 4px !important;
    display: block !important;
    align-self: stretch !important;
}

/* Ховаємо технічне сміття модуля */
#smart_player_ajax iframe[src=""], 
#smart_player_ajax iframe:not([src]) {
    display: none !important;
    height: 0 !important;
}
#les, #ln, .translator-title, .b-translator__title, .b-simple_season__title, #smart_player_ajax:empty, #smart_player_ajax > div:first-child {
    display: none !important;
}

/* ====================================================
   4. КНОПКИ ОЗВУЧКИ ТА СЕЗОНІВ
   ==================================================== */
#smart_player_ajax #translators-list, 
#smart_player_ajax #simple-seasons-tabs {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    padding: 0 !important;
    list-style: none !important;
}

#smart_player_ajax .b-translator__item,
#smart_player_ajax .b-simple_season__item {
    background: #222225 !important;
    color: #8c8c9e !important;
    border: none !important;
    border-radius: 4px !important;
    padding: 8px 16px !important;
    font-size: 12px !important;
    font-weight: bold !important;
    text-transform: uppercase !important;
    cursor: pointer !important;
}

#smart_player_ajax .b-translator__item.active,
#smart_player_ajax .b-simple_season__item.active {
    background: #5b90b1 !important;
    color: #fff !important;
}

/* ====================================================
   5. КНОПКИ СЕРІЙ
   ==================================================== */
#smart_player_ajax #simple-episodes-list {
    order: 4 !important;
    display: flex !important;           /* Включаємо горизонтальний ряд */
    flex-wrap: nowrap !important;       /* Забороняємо переносити кнопки на новий рядок */
    overflow-x: auto !important;        /* Додаємо смугу прокрутки, якщо серій багато */
    gap: 8px !important;                /* Відстань між кнопками */
    padding: 10px 5px !important;       /* Трохи простору для скролу */
    list-style: none !important;
    
    /* Оформлення скроллбару (щоб було красиво) */
    scrollbar-width: thin;
    scrollbar-color: #5b90b1 #111111;
}

/* Налаштування скроллбару для Chrome/Edge */
#smart_player_ajax #simple-episodes-list::-webkit-scrollbar {
    height: 6px;
}
#smart_player_ajax #simple-episodes-list::-webkit-scrollbar-thumb {
    background-color: #5b90b1;
    border-radius: 3px;
}

/* Фіксуємо ширину кожної кнопки, щоб вони були однаковими */
#smart_player_ajax .b-simple_episode__item {
    flex: 0 0 auto !important;        /* Не дозволяємо кнопці стискатися */
    min-width: 70px !important;       /* Мінімальна ширина кнопки */
    height: 36px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    background: #222225 !important;
    color: #8c8c9e !important;
    border: none !important;
    border-radius: 3px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    padding: 0 5px !important;
}

/* Ефекти наведення та активна серія залишаються як були */
#smart_player_ajax .b-simple_episode__item:hover {
    background: #333338 !important;
    color: #ffffff !important;
}

#smart_player_ajax .b-simple_episode__item.active {
    background: #5b90b1 !important;
    color: #ffffff !important;
}

/* ====================================================
   6. ПРИБИРАННЯ ЗАЙВИХ ВІДСТУПІВ МІЖ БЛОКАМИ
   ==================================================== */
.pmovie__player-controls, .tabs-block__content, .pmovie__player {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}
.pmovie__player-bottom {
    margin-top: 0 !important;
    border-top: none !important;
}