* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    background: #111827;
    color: #f9fafb;
}

.app {
    max-width: 1500px;
    margin: auto;
    padding: 24px;
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 22px;
}

header h1 {
    margin: 0;
    font-size: 26px;
}

.video-count {
    background: #1f2937;

    padding: 7px 12px;

    border-radius: 20px;

    color: #9ca3af;

    font-size: 14px;
}

main {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        380px;

    gap: 24px;
}


/* PLAYER */

.player-section {
    min-width: 0;
}

.video-wrapper {
    position: relative;

    background: #000;

    width: 100%;

    aspect-ratio: 16 / 9;

    overflow: hidden;

    border-radius: 12px;
}

video {
    width: 100%;
    height: 100%;

    background: #000;

    display: none;
}

.empty-player {
    position: absolute;

    inset: 0;

    display: flex;

    justify-content: center;
    align-items: center;

    color: #6b7280;

    font-size: 18px;
}

.video-info {
    margin-top: 16px;
}

.video-info h2 {
    margin:
        0
        0
        14px;

    font-size: 21px;
}

.player-buttons {
    display: flex;
    gap: 10px;
}

.player-buttons button {
    border: 0;

    padding: 9px 14px;

    border-radius: 7px;

    cursor: pointer;

    color: white;
    background: #374151;
}

.player-buttons button:hover:not(:disabled) {
    background: #4b5563;
}

.player-buttons button:disabled {
    opacity: .35;
    cursor: default;
}


/* PLAYLIST */

.playlist {
    height: calc(100vh - 110px);

    min-height: 500px;

    display: flex;
    flex-direction: column;

    background: #1f2937;

    border-radius: 12px;

    overflow: hidden;
}

.playlist-header {
    padding: 18px;

    border-bottom:
        1px solid #374151;
}

.playlist-header h2 {
    margin:
        0
        0
        13px;

    font-size: 18px;
}

#search {
    width: 100%;

    padding: 10px 12px;

    border-radius: 7px;

    border:
        1px solid #4b5563;

    background: #111827;

    color: white;

    outline: none;
}

#search:focus {
    border-color: #3b82f6;
}

#videoList {
    flex: 1;

    overflow-y: auto;
}

.video-item {
    appearance: none;

    width: 100%;

    display: flex;

    align-items: center;

    text-align: left;

    gap: 12px;

    padding: 13px 16px;

    border: 0;
    border-bottom:
        1px solid #374151;

    background: transparent;

    color: white;

    cursor: pointer;
}

.video-item:hover {
    background: #374151;
}

.video-item.active {
    background: #2563eb;
}

.play-icon {
    width: 31px;
    height: 31px;

    flex-shrink: 0;

    display: flex;

    justify-content: center;
    align-items: center;

    border-radius: 50%;

    background: rgba(
        255,
        255,
        255,
        .12
    );

    font-size: 12px;
}

.video-description {
    display: flex;
    flex-direction: column;

    min-width: 0;

    gap: 4px;
}

.video-description strong {
    overflow: hidden;

    white-space: nowrap;

    text-overflow: ellipsis;
}

.video-description small {
    color: #9ca3af;
}

.video-item.active small {
    color: #dbeafe;
}

.no-videos {
    padding: 30px;

    color: #9ca3af;

    text-align: center;
}


/* RESPONSIVE */

@media (max-width: 900px) {

    .app {
        padding: 14px;
    }

    main {
        grid-template-columns: 1fr;
    }

    .playlist {
        height: 500px;
    }

}