/* ═══════════════════════════════════════════════════════════════════
   VideoYoutube — Gallery frontend styles
   Tags: white page area | Sections: dark wrapper
   ═══════════════════════════════════════════════════════════════════ */

:root {
    --vg-red:        #e50914;
    --vg-dark:       #141414;
    --vg-border:     rgba(255, 255, 255, 0.07);
    --vg-text:       #f0f0f0;
    --vg-muted:      #888;
    --vg-radius:     14px;
}

/* ── Filter pill bar — у білій зоні сторінки (поза темним блоком) ── */
.vg-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.vg-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #f4f4f4;
    border: 1px solid #ddd;
    color: #444;
    padding: 8px 20px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.22s ease;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.vg-pill-img {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    object-fit: cover;
}

.vg-pill:hover {
    background: #e6e6e6;
    border-color: #bbb;
    color: #111;
}

.vg-pill.active {
    background: #111;
    color: #fff;
    border-color: #111;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

.vg-wrapper {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #000;
    background: #fff;
    padding: 32px 28px;
    border-radius: 20px;
    box-shadow: none;
    margin: 0;
}


/* ── Section (one per tag) ──────────────────────────────────────── */
.vg-section {
    margin-bottom: 48px;
}

.vg-section:last-of-type {
    margin-bottom: 0;
}

.vg-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 800;
    color: #0077b6;
    margin: 0 0 20px 0;
    letter-spacing: -0.3px;
}

.vg-section-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    object-fit: cover;
}

/* ── Player + Playlist grid ─────────────────────────────────────── */
.vg-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
    transition: grid-template-columns 0.35s ease;
}

.vg-grid.expanded {
    grid-template-columns: 1fr 0;
}

.vg-grid.expanded .vg-playlist-col {
    overflow: hidden;
    padding: 0;
    border: 0;
}

@media (max-width: 900px) {
    .vg-grid {
        grid-template-columns: 1fr;
    }
    .vg-wrapper {
        padding: 20px 16px;
    }
}

/* ── Left: player ───────────────────────────────────────────────── */
.vg-player-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.vg-player-ratio {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: #000;
    border-radius: var(--vg-radius);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

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

.vg-meta {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--vg-border);
    border-radius: var(--vg-radius);
    padding: 18px 20px;
}

.vg-active-title {
    font-size: 17px;
    font-weight: 700;
    color: #000;
    margin: 0 0 12px;
    line-height: 1.35;
}

.vg-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.vg-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--vg-text);
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 1;
    font-family: inherit;
}

.vg-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    color: #fff;
}

.vg-btn--yt {
    background: rgba(229, 9, 20, 0.12);
    border-color: rgba(229, 9, 20, 0.25);
    color: #ff3b30;
}

.vg-btn--yt:hover {
    background: rgba(229, 9, 20, 0.22);
    color: #fff;
}

.vg-active-desc {
    font-size: 13px;
    color: var(--vg-muted);
    line-height: 1.6;
    margin: 0;
    border-top: 1px solid var(--vg-border);
    padding-top: 12px;
}

/* ── Right: playlist ────────────────────────────────────────────── */
.vg-playlist-col {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--vg-border);
    border-radius: var(--vg-radius);
    display: flex;
    flex-direction: column;
    max-height: 560px;
    overflow: hidden;
    transition: all 0.35s ease;
}

.vg-playlist-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px;
    border-bottom: 1px solid var(--vg-border);
    font-size: 14px;
    font-weight: 700;
    color: #000;
    flex-shrink: 0;
}

.vg-playlist-count {
    color: var(--vg-muted);
    font-weight: 400;
    font-size: 13px;
}

.vg-playlist-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.vg-playlist-scroll::-webkit-scrollbar        { width: 5px; }
.vg-playlist-scroll::-webkit-scrollbar-track  { background: transparent; }
.vg-playlist-scroll::-webkit-scrollbar-thumb  { background: rgba(255,255,255,0.12); border-radius: 3px; }
.vg-playlist-scroll::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

/* ── Playlist card ──────────────────────────────────────────────── */
.vg-card {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 10px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    padding: 7px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.vg-card:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateX(3px);
}

.vg-card.active {
    background: rgba(255, 255, 255, 0.1);
    border-color: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.vg-card-thumb {
    position: relative;
    width: 110px;
    height: 62px;
    border-radius: 6px;
    overflow: hidden;
    background: #000;
    flex-shrink: 0;
}

.vg-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.vg-card:hover .vg-card-thumb img {
    transform: scale(1.06);
}

.vg-play-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.38);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.vg-card:hover .vg-play-overlay,
.vg-card.active .vg-play-overlay {
    opacity: 1;
}

.vg-play-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--vg-red);
    color: #fff;
    font-size: 13px;
    padding-left: 2px;
    box-shadow: 0 4px 10px rgba(229, 9, 20, 0.5);
}

.vg-card-body {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 2px 0;
}

.vg-card-num {
    font-size: 12px;
    font-weight: 700;
    color: var(--vg-muted);
    min-width: 16px;
    padding-top: 1px;
    flex-shrink: 0;
}

.vg-card-title {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    color: #222;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.vg-card.active .vg-card-title { color: #fff; }

/* ── Empty state ────────────────────────────────────────────────── */
.vg-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--vg-muted);
    font-size: 16px;
}

/* ── Share popup ────────────────────────────────────────────────── */
.vg-share-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.vg-share-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.vg-share-card {
    background: rgba(30, 30, 30, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    padding: 30px;
    width: 440px;
    max-width: 92%;
    position: relative;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
    transform: translateY(18px);
    transition: transform 0.3s ease;
}

.vg-share-overlay.show .vg-share-card { transform: translateY(0); }

.vg-share-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: transparent;
    border: 0;
    color: var(--vg-muted);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.vg-share-close:hover { color: #fff; }

.vg-share-card h3 {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    font-family: 'Inter', sans-serif;
}

.vg-share-card p {
    font-size: 13px;
    color: var(--vg-muted);
    margin: 0 0 18px;
}

.vg-share-row {
    display: flex;
    gap: 8px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 5px;
}

.vg-share-row input {
    flex: 1;
    background: transparent;
    border: 0;
    color: #fff;
    padding: 8px 10px;
    font-size: 13px;
    outline: none;
}

.vg-share-row button {
    background: #fff;
    color: #000;
    border: 0;
    padding: 8px 18px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.vg-share-row button:hover { background: rgba(255, 255, 255, 0.85); }

.vg-share-toast {
    margin-top: 14px;
    text-align: center;
    color: #34c759;
    font-size: 13px;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.vg-share-toast.show { opacity: 1; }
