/*
 * Đèo Cả - YouTube Playlist
 * Giao diện mô phỏng bố cục playlist của YouTube.
 */

.deoca-youtube-playlist {
    width: 100%;
    max-width: 1100px;
    margin: 24px auto;
    display: grid;
    grid-template-columns: minmax(0, 13fr) minmax(280px, 7fr);
    height: var(--deoca-embed-height, 315px);
    max-height: var(--deoca-embed-height, 315px);
    background: #0f0f0f;
    border-radius: 8px;
    overflow: hidden;
    box-sizing: border-box;
    min-height: 0;
}

.deoca-youtube-playlist *,
.deoca-youtube-playlist *::before,
.deoca-youtube-playlist *::after {
    box-sizing: border-box;
}

.deoca-youtube-player {
    position: relative;
    width: 100%;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    background: #000;
}

.deoca-youtube-player > div {
    width: 100% !important;
    height: 100% !important;
}

.deoca-youtube-player iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.deoca-youtube-list {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    color: #fff;
    background: #0f0f0f;
    overflow: hidden;
}

.deoca-youtube-list-header {
    height: 56px;
    flex: 0 0 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-bottom: 1px solid #303030;
    font: 600 15px/1.2 Arial, sans-serif;
    text-transform: none;
}

.deoca-youtube-count {
    color: #aaa;
    font-size: 12px;
    font-weight: 400;
}

.deoca-youtube-items {
    flex: 1 1 auto;
    min-height: 0;
    height: 0;
    max-height: none;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
}

.deoca-youtube-item {
    width: 100%;
    min-height: 82px;
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid #242424;
    background: transparent;
    color: #fff;
    display: grid;
    grid-template-columns: 24px 80px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    text-align: left;
    cursor: pointer;
    font-family: Arial, sans-serif;
}

.deoca-youtube-item:hover {
    background: #272727;
}

.deoca-youtube-item.is-active {
    background: #303030;
}

.deoca-youtube-index {
    color: #aaa;
    font-size: 12px;
    text-align: center;
}

.deoca-youtube-item.is-active .deoca-youtube-index {
    color: #fff;
    font-weight: 700;
}

.deoca-youtube-thumb {
    position: relative;
    display: block;
    width: 80px;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #222;
    border-radius: 3px;
}

.deoca-youtube-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    max-width: none !important;
}

.deoca-youtube-play-icon {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 30px;
    height: 30px;
    transform: translate(-50%, -50%);
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0,0,0,.75);
    color: #fff;
    font-size: 13px;
}

.deoca-youtube-item:hover .deoca-youtube-play-icon,
.deoca-youtube-item.is-active .deoca-youtube-play-icon {
    display: flex;
}

.deoca-youtube-item-title {
    min-width: 0;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    color: #f1f1f1;
    font-size: 13px;
    line-height: 1.35;
    font-weight: 500;
    text-align: left;
}

.deoca-youtube-loading,
.deoca-youtube-error {
    padding: 24px 16px;
    color: #aaa;
    font: 13px/1.5 Arial, sans-serif;
    text-align: center;
}

.deoca-youtube-error {
    color: #f1f1f1;
}

@media (max-width: 900px) {
    .deoca-youtube-playlist {
        grid-template-columns: 1fr;
        height: auto;
        max-height: none;
        overflow: visible;
    }

    .deoca-youtube-player {
        height: auto;
        aspect-ratio: 16 / 9;
    }

    .deoca-youtube-list {
        height: 360px;
        max-height: 360px;
    }

    .deoca-youtube-items {
        max-height: none;
    }
}

@media (max-width: 600px) {
    .deoca-youtube-playlist {
        margin: 16px 0;
        border-radius: 0;
    }

    .deoca-youtube-item {
        grid-template-columns: 24px 100px minmax(0, 1fr);
        min-height: 76px;
        padding: 8px 10px;
    }

    .deoca-youtube-thumb {
        width: 100px;
    }
}
