/**
 * LexStreamCMS — Player & Supplementary UI CSS
 * Loaded with main theme stylesheet.
 */

/* ── Spinner ─────────────────────────────────────────────────────────────── */
.lx-spinner {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-top-color: var(--clr-accent);
    animation: lx-spin 0.75s linear infinite;
    display: inline-block;
}

@keyframes lx-spin {
    to { transform: rotate(360deg); }
}

/* ── Player loading state ────────────────────────────────────────────────── */
.lx-player__loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    z-index: 3;
    border-radius: var(--radius-lg);
}

/* ── Breadcrumb ──────────────────────────────────────────────────────────── */
.lx-breadcrumb {
    margin-bottom: var(--space-4);
}

.lx-breadcrumb__list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--clr-text-muted);
    list-style: none;
    padding: 0;
    margin: 0;
}

.lx-breadcrumb__list a {
    color: var(--clr-text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.lx-breadcrumb__list a:hover {
    color: var(--clr-accent);
}

.lx-breadcrumb__list [aria-current="page"] {
    color: var(--clr-text-primary);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 280px;
}

/* ── Pills wrap with fade gradient ──────────────────────────────────────── */
.lx-pills-wrap {
    position: relative;
    margin-bottom: var(--space-6);
}

.lx-pills-fade {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 60px;
    background: linear-gradient(
        to right,
        transparent,
        var(--clr-bg-primary)
    );
    pointer-events: none;
    border-radius: 0 var(--radius-full) var(--radius-full) 0;
}

[data-theme="light"] .lx-pills-fade {
    background: linear-gradient(to right, transparent, var(--clr-bg-primary));
}

/* ── Share section ────────────────────────────────────────────────────────── */
.lx-share {
    padding-top: var(--space-6);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
}

/* ── Video info description ──────────────────────────────────────────────── */
.lx-video-info__desc p {
    margin: 0 0 var(--space-3);
}

.lx-video-info__desc p:last-child {
    margin-bottom: 0;
}

/* ── Load more wrapper ────────────────────────────────────────────────────── */
.lx-load-more-wrap {
    text-align: center;
    padding-top: var(--space-10);
}

/* ── Search form (search.php) ────────────────────────────────────────────── */
.lx-search-form {
    margin-bottom: var(--space-8);
}

.lxcms-input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    background: var(--clr-bg-card);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-md);
    color: var(--clr-text-primary);
    font-size: var(--text-base);
    font-family: var(--font-body);
    transition: border-color var(--transition-fast);
}

.lxcms-input:focus {
    border-color: var(--clr-accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.15);
}

/* ── Video grid role="list" card fix ─────────────────────────────────────── */
#lx-video-grid .lx-card {
    display: flex;
    flex-direction: column;
}

/* ── Skeleton loading placeholders ───────────────────────────────────────── */
.lx-grid--loading .lx-skeleton--card {
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-lg);
    height: unset;
}

/* ── Watch page — sticky sidebar on desktop ──────────────────────────────── */
@media (min-width: 1025px) {
    .lx-watch__sidebar {
        position: sticky;
        top: calc(var(--header-height) + var(--space-4));
        max-height: calc(100vh - var(--header-height) - var(--space-8));
        overflow-y: auto;
        scrollbar-width: thin;
        scrollbar-color: var(--clr-border) transparent;
        padding-right: var(--space-2);
    }

    .lx-watch__sidebar::-webkit-scrollbar {
        width: 4px;
    }

    .lx-watch__sidebar::-webkit-scrollbar-track {
        background: transparent;
    }

    .lx-watch__sidebar::-webkit-scrollbar-thumb {
        background: var(--clr-border);
        border-radius: var(--radius-full);
    }
}

/* ── Compact card hover ───────────────────────────────────────────────────── */
.lx-card--compact:hover {
    transform: none;
    box-shadow: var(--shadow-md);
}

/* ── Admin notice override (keep WP notices readable in our pages) ─────────── */
.lxcms-admin .notice {
    border-left-color: var(--clr-accent);
    background: rgba(108, 99, 255, 0.08);
    color: var(--clr-text-primary);
    border-radius: var(--radius-md);
    padding: 10px 16px;
}

/* ── Responsive watch grid fix ───────────────────────────────────────────── */
@media (max-width: 768px) {
    .lx-watch {
        padding-block: var(--space-4);
    }

    .lx-video-info__meta {
        gap: var(--space-3);
    }

    .lx-video-info__title {
        font-size: var(--text-xl);
    }

    .lx-breadcrumb__list [aria-current="page"] {
        max-width: 160px;
    }

    .lx-share {
        justify-content: flex-start;
    }
}
