/* ============================================================
   Premium Business Automation - Playlist Styles
   Adaptiert von der kilinux.com / buildingaicompany.com-Lösung.
   Alle Regeln auf .pba-playlist begrenzt (scoped), damit das
   Styling der bestehenden Seite unangetastet bleibt.
   ============================================================ */

/* Reset NUR innerhalb des Players (kein globales *-Reset) */
.pba-playlist,
.pba-playlist * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Layout: Video + Playlist auf Desktop nebeneinander,
   auf schmalen Viewports untereinander (flex-wrap + Media Query) */
.pba-playlist {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-start;
    width: 100%;
    margin-bottom: 30px;
}

.pba-playlist .video-player {
    flex: 2 1 480px;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* Responsives 16:9-Video: skaliert mit der Containerbreite */
.pba-playlist .video-player video {
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: contain;
    background-color: #000;
    border-radius: 8px 8px 0 0;
    display: block;
}

.pba-playlist .video-description {
    padding: 10px 15px;
    background-color: #f8f9fa;
    font-size: 16px;
    line-height: 1.3;
    color: #333;
}

.pba-playlist .video-description a {
    color: #ff00ff;
    text-decoration: none;
    font-weight: 500;
}

.pba-playlist .video-description a:hover {
    text-decoration: underline;
}

/* Playlist-Spalte
   max-height wird per JS (adjustPlaylistHeight) auf die Höhe des
   Videos gesetzt, damit die Playlist nie höher als das Video wird
   und bei vielen Einträgen einen Scrollbalken zeigt. */
.pba-playlist .video-list {
    flex: 1 1 260px;
    min-width: 0;
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.pba-playlist .video-list h2 {
    margin-bottom: 20px;
    color: #000;
    font-size: 24px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
    flex-shrink: 0;
}

/* Scrollbarer Playlist-Body: nur hier wird gescrollt */
.pba-playlist .playlist-items {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #ff00ff #f0f0f0;
}

.pba-playlist .playlist-items::-webkit-scrollbar {
    width: 8px;
}

.pba-playlist .playlist-items::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 4px;
}

.pba-playlist .playlist-items::-webkit-scrollbar-thumb {
    background: #ff00ff;
    border-radius: 4px;
}

.pba-playlist .playlist-item {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    background-color: #f8f8f8;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.pba-playlist .playlist-item:hover {
    background-color: #e8e8e8;
    transform: translateX(5px);
}

.pba-playlist .playlist-item.active {
    background-color: #fff0ff;
    border-color: #ff00ff;
}

.pba-playlist .playlist-item .item-number {
    width: 40px;
    height: 40px;
    background-color: #ff00ff;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    margin-right: 12px;
    flex-shrink: 0;
}

.pba-playlist .playlist-item.active .item-number {
    background-color: #ff00ff;
    box-shadow: 0 0 0 3px #ff00ff;
}

.pba-playlist .playlist-item .item-thumbnail {
    width: 80px;
    height: 60px;
    object-fit: contain;
    border-radius: 4px;
    margin-right: 12px;
    background-color: #f5f5f5;
    flex-shrink: 0;
    border: 1px solid #e0e0e0;
}

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

.pba-playlist .playlist-item .item-title {
    font-weight: 500;
    font-size: 14px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Globale Beschreibungen (standardmäßig ausgeblendet,
   nur sichtbar wenn in videos.txt vorhanden) */
.pba-playlist .global-descriptions {
    background-color: #f8f9fa;
    border-radius: 0 0 8px 8px;
    padding: 15px;
    border-top: 1px solid #e0e0e0;
}

.pba-playlist .global-descriptions h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 20px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.pba-playlist .global-description-item {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 16px;
}

.pba-playlist .global-description-item:last-child {
    border-bottom: none;
}

/* Titel über jeder Playlist-Sektion */
.pba-playlist-section-title {
    margin: 40px 0 15px 0;
    font-size: 28px;
    font-weight: bold;
    color: #2d2d2d;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

/* Schmale Viewports: Playlist unter dem Video, Scroll-Limit */
@media (max-width: 768px) {
    .pba-playlist {
        flex-direction: column;
    }

    .pba-playlist .video-list {
        width: 100%;
        max-height: 360px;
    }
}
