/* WP YouTube Pro — Frontend CSS */

:root {
    --yt-accent: #ff0000;
    --yt-radius: 12px;
    --yt-shadow: 0 6px 20px rgba(0,0,0,.1);
}

/* ── Single-video container ────────────────────────────── */
.yt-pro-container {
    position: relative;
    width: 100%;
    background: #000;
    border-radius: var(--yt-radius);
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: var(--yt-shadow);
}

.yt-pro-aspect-16-9  { padding-bottom: 56.25%; }
.yt-pro-aspect-4-3   { padding-bottom: 75%; }
.yt-pro-aspect-shorts{ padding-bottom: 177.78%; max-width: 340px; margin-inline: auto; }

.yt-pro-facade {
    position: absolute; inset: 0;
    background-size: cover;
    background-position: center;
    cursor: pointer;
}

.yt-pro-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(180deg,rgba(0,0,0,.2) 0%,rgba(0,0,0,.65) 100%);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 12px;
}

/* Play button — YouTube-style red on hover */
.yt-pro-play-btn {
    background: none; border: none; cursor: pointer; padding: 0;
    transition: transform .2s cubic-bezier(.175,.885,.32,1.275);
}
.yt-pro-facade:hover .yt-pro-play-btn { transform: scale(1.12); }
.yt-pro-facade:hover .yt-pro-btn-bg   { fill: var(--yt-accent) !important; fill-opacity: 1 !important; }

.yt-pro-video-title {
    color: #fff;
    font-size: 1rem; font-weight: 600;
    text-shadow: 0 1px 4px rgba(0,0,0,.7);
    text-align: center; padding: 0 16px;
}

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

/* Chapters */
.yt-pro-chapters {
    background: #f7f7f7;
    border: 1px solid #e4e4e4;
    border-radius: var(--yt-radius);
    padding: 14px 18px;
    margin-bottom: 1.5rem;
}
.yt-pro-chapters-heading {
    margin: 0 0 10px; font-size: .95rem; color: #333;
}
.yt-pro-chapters-list {
    list-style: none; padding: 0; margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px,1fr));
    gap: 6px;
}
.yt-pro-chapter {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 10px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.yt-pro-chapter:hover {
    background: #fff8f8; border-color: var(--yt-accent);
}
.yt-pro-chapter-ts {
    font-size: .8rem; font-weight: 700;
    color: var(--yt-accent);
    background: rgba(255,0,0,.08);
    padding: 2px 5px; border-radius: 3px;
    white-space: nowrap;
}
.yt-pro-chapter-name {
    font-size: .85rem; color: #444;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── Gallery wrapper & arrows ──────────────────────────── */
.yt-pro-gallery-wrap {
    position: relative;
    margin-bottom: 2rem;
}

.yt-pro-arrow {
    position: absolute; top: 38%; z-index: 10;
    background: rgba(0,0,0,.6); color: #fff;
    border: none; border-radius: 50%;
    width: 38px; height: 38px;
    font-size: 22px; line-height: 1;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .2s, transform .2s;
}
.yt-pro-arrow:hover { background: var(--yt-accent); transform: scale(1.08); }
.yt-pro-arrow-prev { left: -14px; }
.yt-pro-arrow-next { right: -14px; }

/* ── Gallery grid ──────────────────────────────────────── */
.yt-pro-gallery {
    display: grid;
    gap: 18px;
}
.yt-pro-grid-cols-1 { grid-template-columns: 1fr; }
.yt-pro-grid-cols-2 { grid-template-columns: repeat(2,1fr); }
.yt-pro-grid-cols-3 { grid-template-columns: repeat(3,1fr); }
.yt-pro-grid-cols-4 { grid-template-columns: repeat(4,1fr); }

/* ── Carousel (horizontal scroll) ─────────────────────── */
.yt-pro-carousel {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    gap: 18px;
    padding-bottom: 8px;
    cursor: grab;
    -webkit-overflow-scrolling: touch;
}
.yt-pro-carousel:active { cursor: grabbing; }
.yt-pro-carousel::-webkit-scrollbar { height: 5px; }
.yt-pro-carousel::-webkit-scrollbar-thumb { background: rgba(0,0,0,.18); border-radius: 4px; }
.yt-pro-carousel .yt-pro-card-video {
    flex: 0 0 280px;
    scroll-snap-align: start;
}

@media (max-width: 700px) {
    .yt-pro-grid-cols-2,
    .yt-pro-grid-cols-3,
    .yt-pro-grid-cols-4 { grid-template-columns: 1fr; }
    .yt-pro-carousel .yt-pro-card-video { flex-basis: 240px; }
}

/* ── Card ──────────────────────────────────────────────── */
.yt-pro-card-video {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: var(--yt-radius);
    overflow: hidden;
    box-shadow: var(--yt-shadow);
    transition: transform .25s ease, box-shadow .25s ease;
    display: flex; flex-direction: column;
}
.yt-pro-card-video:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0,0,0,.14);
}

/* Thumbnail area */
.yt-pro-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #000;
    cursor: pointer;
}
.yt-pro-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
    display: block;
}
.yt-pro-card-video:hover .yt-pro-thumb img { transform: scale(1.05); }

.yt-pro-thumb-overlay {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,.2);
    opacity: 0;
    transition: opacity .2s;
}
.yt-pro-thumb:hover .yt-pro-thumb-overlay { opacity: 1; }

.yt-pro-play-circle { filter: drop-shadow(0 2px 6px rgba(0,0,0,.5)); }

/* Inline player holder */
.yt-pro-inline-player {
    position: absolute; inset: 0; z-index: 5;
}
.yt-pro-inline-player iframe { width: 100%; height: 100%; border: 0; }

/* Meta below thumb */
.yt-pro-card-meta {
    padding: 12px 14px;
    flex: 1;
    display: flex; flex-direction: column; gap: 4px;
}
.yt-pro-card-title {
    font-size: .92rem; font-weight: 600;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.yt-pro-card-channel {
    font-size: .78rem; color: #777;
}

/* ── Modal ─────────────────────────────────────────────── */
.yt-pro-modal {
    position: fixed; inset: 0; z-index: 99999;
    background: rgba(0,0,0,.82);
    backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    animation: ytFadeIn .2s ease-out;
}
.yt-pro-modal-inner {
    position: relative;
    width: 100%; max-width: 880px;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: var(--yt-radius);
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0,0,0,.6);
}
.yt-pro-modal-inner iframe {
    width: 100%; height: 100%; border: 0;
}
.yt-pro-modal-close {
    position: absolute; top: -42px; right: 0;
    background: none; border: none;
    color: #fff; font-size: 28px; cursor: pointer;
    line-height: 1;
}
@keyframes ytFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── Misc ──────────────────────────────────────────────── */
.yt-pro-error-box {
    padding: 12px 16px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    color: #6b5000;
    font-size: .9rem;
    margin-bottom: 1rem;
}
