/* YouTube Mini Player */

#yt-mini-player {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 320px;
    z-index: 9997;
    background: var(--color-bg-base, #fff);
    border: 1px solid var(--color-border, #ddd);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: inherit;
}

/* Header (draggable) */
.yt-player-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    background: var(--color-bg-light, #f5f5f5);
    border-bottom: 1px solid var(--color-border, #ddd);
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}
.yt-player-header:active {
    cursor: grabbing;
}

.yt-player-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-primary, #333);
    display: flex;
    align-items: center;
    gap: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.yt-header-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-secondary, #666);
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1;
    flex-shrink: 0;
}
.yt-header-btn:hover {
    background: var(--color-bg-hover, rgba(0,0,0,0.08));
    color: var(--color-text-primary, #333);
}

/* Video frame */
.yt-player-video {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}
.yt-player-video iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Controls */
.yt-player-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 10px;
    background: var(--color-bg-light, #f5f5f5);
    border-top: 1px solid var(--color-border, #ddd);
}

.yt-ctrl-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-secondary, #666);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1;
    transition: background 0.15s, color 0.15s;
}
.yt-ctrl-btn:hover {
    background: var(--color-bg-hover, rgba(0,0,0,0.08));
    color: var(--color-text-primary, #333);
}
.yt-ctrl-btn.yt-active {
    color: #ff0000;
    background: rgba(255, 0, 0, 0.08);
}

/* Playlist panel */
.yt-playlist-panel {
    max-height: 180px;
    overflow-y: auto;
    border-top: 1px solid var(--color-border, #ddd);
    background: var(--color-bg-base, #fff);
}

.yt-playlist-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 12px;
    color: var(--color-text-secondary, #666);
    transition: background 0.15s;
}
.yt-playlist-item:hover {
    background: var(--color-bg-hover, rgba(0,0,0,0.04));
}
.yt-playlist-item.yt-playlist-active {
    background: rgba(255, 0, 0, 0.06);
    color: var(--color-text-primary, #333);
    font-weight: 600;
}

.yt-playlist-thumb {
    width: 48px;
    height: 36px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.yt-playlist-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Play icon (YouTube logo as play button) in record notes */
.yt-play-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    vertical-align: middle;
    min-width: 32px;
    min-height: 32px;
    padding: 4px;
    border-radius: 3px;
    transition: background 0.15s;
}
.yt-play-btn:hover {
    background: rgba(255, 0, 0, 0.12);
}
.yt-play-btn i {
    font-size: 16px;
}

/* Play-all button in date column */
.yt-play-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: rgba(255, 0, 0, 0.08);
    border: 1px solid rgba(255, 0, 0, 0.2);
    border-radius: 4px;
    padding: 2px 8px;
    color: #cc0000;
    font-size: 12px;
    line-height: 1.4;
}
.yt-play-all-btn:hover {
    background: rgba(255, 0, 0, 0.15);
    border-color: rgba(255, 0, 0, 0.4);
}
.yt-play-all-btn i {
    font-size: 11px;
}

/* Expand playlist button in record notes */
.yt-expand-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: rgba(0, 100, 200, 0.08);
    border: 1px solid rgba(0, 100, 200, 0.2);
    border-radius: 4px;
    padding: 2px 8px;
    cursor: pointer;
    color: #0064c8;
    font-size: 12px;
    line-height: 1.4;
    margin-left: 6px;
    vertical-align: middle;
    transition: background 0.15s, border-color 0.15s;
}
.yt-expand-btn:hover {
    background: rgba(0, 100, 200, 0.15);
    border-color: rgba(0, 100, 200, 0.4);
}
.yt-expand-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}
.yt-expand-btn i {
    font-size: 11px;
}

/* Responsive: mobile */
@media (max-width: 600px) {
    #yt-mini-player {
        width: calc(100vw - 20px);
        right: 10px;
        bottom: 10px;
    }
    .yt-header-btn {
        padding: 8px 10px;
        font-size: 18px;
    }
    .yt-ctrl-btn {
        padding: 10px 14px;
        font-size: 16px;
    }
}
