/* ============================================================
   Building AI Company Video Player Styles
   Adaptiert von SUPER_videoplayerwebsite/styles.css.
   Alle Regeln sind auf .playlist-container begrenzt (scoped),
   damit das Styling der buildingaicompany-Hostseite unangetastet bleibt.
   ============================================================ */

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

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

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

/* Responsives 16:9-Video: skaliert mit der Containerbreite */
.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;
}

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

.video-description a {
    color: #00AA00;
    text-decoration: none;
    font-weight: 500;
}

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

/* Playlist-Spalte
   max-height wird per JS (script.js -> adjustPlaylistHeight) auf die
   Hoehe des Videos gesetzt, damit die Playlist nie hoeher als das Video
   wird und bei vielen Eintraegen einen Scrollbalken zeigt.
   #playlistItems ist der scrollbare Bereich (Header bleibt stehen). */
.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;
    /* max-height: via JS gesetzt (= Hoehe des <video>-Elements) */
}

.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 */
.video-list #playlistItems {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    /* Schmaler, dezenter Scrollbalken (WebKit) */
    scrollbar-width: thin;
    scrollbar-color: #00AA00 #f0f0f0;
}

.video-list #playlistItems::-webkit-scrollbar {
    width: 8px;
}

.video-list #playlistItems::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 4px;
}

.video-list #playlistItems::-webkit-scrollbar-thumb {
    background: #00AA00;
    border-radius: 4px;
}

.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;
}

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

.playlist-item.active {
    background-color: #f5f5f5;
    border-color: #00AA00;
}

.playlist-item .item-number {
    width: 40px;
    height: 40px;
    background-color: #2d2d2d;
    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;
}

.playlist-item.active .item-number {
    background-color: #00AA00;
    box-shadow: 0 0 0 2px #f5f5f5;
}

.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;
}

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

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

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

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

.global-description-item {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
}

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

.global-description-item a {
    color: #00AA00;
    text-decoration: none;
    font-weight: 500;
}

.global-description-item a:hover {
    text-decoration: underline;
}

/* Responsive: Playlist rutscht auf schmalen Screens unter das Video */
@media (max-width: 768px) {
    .playlist-container {
        flex-direction: column;
    }

    .video-player,
    .video-list {
        flex: 1 1 100%;
        width: 100%;
    }

    .video-list {
        max-height: 360px;
        overflow-y: auto;
    }
}
