/* ═══════════════════════════════════════════════════════════════════════════
   Nexus Video Library — Frontend Widget Styles  v1.1.0
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Root Variables ──────────────────────────────────────────────────────── */
:root {
    --nvl-pink:      #D63384;
    --nvl-pink-dark: #b8276e;
    --nvl-anim:      300ms ease;
}

/* ── Widget Wrapper ──────────────────────────────────────────────────────── */
.nvl-widget-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #fff;
    padding: 2rem;
    box-sizing: border-box;
}

/* ── Section Divider ─────────────────────────────────────────────────────── */
.nvl-section-divider {
    border: none;
    border-top: 1px solid #f0f0f0;
    margin: 0; /* folder-section top-padding provides the gap below */
}

/* ── Folder Section ──────────────────────────────────────────────────────── */
.nvl-folder-section {
    margin-bottom: 2rem;
    padding-top: 1.75rem;     /* gap between the divider above and folder heading */
    border-left: 3px solid transparent;
    padding-left: 12px;
    margin-left: -15px;           /* compensate padding so content aligns */
    border-radius: 0 6px 6px 0;
    transition: background var(--nvl-anim), border-left-color var(--nvl-anim);
}
/* First section has no divider above it, so no top padding needed */
.nvl-folder-section:first-of-type {
    padding-top: 0;
}


/* Active state — subtle pink tint + left border */
.nvl-folder-section.nvl-is-active {
    background: rgba(214, 51, 132, 0.04);
    border-left-color: var(--nvl-pink);
}

/* ── Folder Heading ──────────────────────────────────────────────────────── */
.nvl-folder-heading {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 14px;
}
.nvl-folder-name {
    font-size: 18px;
    font-weight: 600;
    color: #060606;
    margin: 0;
    padding: 0;
    line-height: 1.3;
}
.nvl-folder-name em {
    font-style: normal;
    color: var(--nvl-pink);
}
.nvl-folder-count {
    font-size: 13px;
    color: #aaa;
    white-space: nowrap;
}

/* ── Video Grids ─────────────────────────────────────────────────────────── */
.nvl-video-grid-fe {
    display: grid;
    grid-template-columns: repeat(var(--nvl-cols, 5), minmax(0, 1fr));
    gap: var(--nvl-gap, 12px);
}

/* The extras grid needs a top gap matching the main gap */
.nvl-extras-grid {
    padding-top: var(--nvl-gap, 12px);
}

/* ── Extras Collapsible Wrap ─────────────────────────────────────────────── */
.nvl-extras-wrap {
    overflow: hidden;
    /* max-height is set inline by PHP (0) and driven by JS */
    transition: max-height var(--nvl-anim);
}

/* ── Chunk-hidden cards (within extras) ──────────────────────────────────── */
.nvl-chunk-hidden {
    display: none !important;
}

/* ── Video Card ──────────────────────────────────────────────────────────── */
.nvl-fe-card {
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    cursor: pointer;
    position: relative;
}
.nvl-fe-thumb {
    width: 100%;
    height: 100%;
    background: #111827;
    background-size: cover;
    background-position: center;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

/* Duration badge */
.nvl-fe-duration {
    position: absolute;
    bottom: 7px;
    right: 8px;
    background: rgba(0, 0, 0, 0.72);
    color: #fff;
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 4px;
    z-index: 2;
    line-height: 1.6;
}

/* Hover overlay */
.nvl-fe-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.28);
    opacity: 0;
    transition: opacity 0.18s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}
.nvl-fe-card:hover .nvl-fe-overlay {
    opacity: 1;
}

/* Play icon circle */
.nvl-fe-play {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.15s ease;
}
.nvl-fe-card:hover .nvl-fe-play {
    transform: scale(1.08);
}
.nvl-fe-play svg {
    transform: translateX(1px);
}

/* ── Show More / Less button ─────────────────────────────────────────────── */
.nvl-show-more-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    margin-top: 18px;
}
.nvl-show-more-line {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: #e8e8e8;
}
.nvl-show-more-btn {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    border-radius: 999px;
    background: var(--nvl-pink);
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    padding: 10px 28px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    font-family: inherit;
    white-space: nowrap;
}
.nvl-show-more-btn:hover {
    background: var(--nvl-pink-dark);
    transform: translateY(-1px);
}
.nvl-show-more-btn:active {
    transform: translateY(0);
}

/* Chevron rotation: points down normally, up when expanded */
.nvl-btn-chevron {
    transition: transform var(--nvl-anim);
    flex-shrink: 0;
}
.nvl-show-more-btn.nvl-is-expanded .nvl-btn-chevron {
    transform: rotate(180deg);
}

.nvl-more-count {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
}

/* ── Lightbox ────────────────────────────────────────────────────────────── */
.nvl-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: nvlLbIn 0.2s ease;
}
@keyframes nvlLbIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.nvl-lightbox-inner {
    position: relative;
    width: min(1280px, 90vw);
    animation: nvlLbScale 0.2s ease;
}
@keyframes nvlLbScale {
    from { transform: scale(0.94); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}
.nvl-lightbox iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: none;
    border-radius: 8px;
    display: block;
}
.nvl-lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.15s;
    padding: 0;
    font-weight: 300;
}
.nvl-lightbox-close:hover { opacity: 1; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .nvl-video-grid-fe { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .nvl-widget-wrap { padding: 1.25rem; }
    .nvl-video-grid-fe { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .nvl-video-grid-fe { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
