/* ================================================
   RESET I ZMIENNE — dostosuj do stylu strony
   ================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --color-bg:          #ffffff;
    --color-text:        #1a1a1a;
    --color-text-muted:  #666666;
    --color-border:      #e0e0e0;
    --color-accent:      #009fe3;
    --color-hover:       #f5f5f5;
    --color-duration-bg: rgba(0,0,0,0.75);
    --color-duration-fg: #ffffff;
    --font-family:       system-ui, sans-serif;
    --radius:            4px;
}

body {
    font-family: var(--font-family);
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 15px;
    line-height: 1.5;
}

/* ================================================
   LAYOUT
   ================================================ */
.yt-wrapper {
    max-width: 960px;
    margin: 0 auto;
    padding: 0;
}

/* ================================================
   PLAYER
   ================================================ */
.yt-player {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 24px;
}

.yt-player iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ================================================
   LISTA
   ================================================ */
.yt-list {
    list-style: none;
}

.yt-item {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 10px;
    padding: 10px 8px;
    border-bottom: 1px solid var(--color-border);
    cursor: pointer;
    transition: background 0.15s;
}

.yt-item:hover {
    background: var(--color-hover);
}

.yt-item.is-active {
    background: var(--color-hover);
    box-sizing: border-box;
    box-shadow: inset 0 0 0 1px var(--color-accent);
}

/* Miniaturka */
.yt-thumb {
    position: relative;
    width: 120px;
    aspect-ratio: 12/9;
    flex-shrink: 0;
    border-radius: var(--radius);
    overflow: hidden;
    background: #000;
}

.yt-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.yt-duration {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: var(--color-duration-bg);
    color: var(--color-duration-fg);
    font-size: 12px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 2px;
    letter-spacing: 0.02em;
}

/* Treść */
.yt-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.yt-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.yt-date {
    font-size: 13px;
    color: var(--color-text-muted);
}

.yt-play-icon {
    color: var(--color-accent);
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
}

.yt-title {
    font-weight: 600;
    font-size: 15px;
    line-height: 1.35;
}

.yt-desc {
    font-size: 13px;
    color: var(--color-text-muted);
}

.yt-desc-short {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.yt-desc-full {
    display: none;
}

.yt-more {
    display: inline-block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--color-accent);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
}

/* Stan ładowania i błąd */
.yt-status {
    padding: 24px;
    text-align: center;
    color: var(--color-text-muted);
}

/* Przycisk wczytaj więcej */
.yt-load-more {
    list-style: none;
    padding: 16px 8px;
    text-align: center;
}

.yt-load-more button {
    background: none;
    border: 1px solid var(--color-accent);
    color: var(--color-accent);
    font-family: inherit;
    font-size: 13px;
    padding: 6px 16px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.yt-load-more button:hover {
    background: var(--color-accent);
    color: #fff;
}

/* Scrollowana lista */
.yt-list-wrapper {
    overflow-y: auto;
    height: calc(100vh - var(--player-bottom, 0px) - 24px);
}

/* ================================================
   RESPONSYWNOŚĆ
   ================================================ */
@media (max-width: 520px) {
    .yt-item {
        grid-template-columns: 90px 1fr;
    }
    .yt-thumb {
        width: 90px;
    }
}