/* LawTV Video Manager - Frontend Styles */

/* ── Reset for plugin containers ────────────────── */
.lawtvvm-video-detail,
.lawtvvm-channel-detail,
.lawtvvm-featured-slider,
.lawtvvm-channel-listing {
    box-sizing: border-box;
}

.lawtvvm-video-detail *,
.lawtvvm-channel-detail *,
.lawtvvm-featured-slider *,
.lawtvvm-channel-listing * {
    box-sizing: inherit;
}

/* ── Theme overrides — neutralize .post h3, a styles ── */
.post .lawtvvm-channel-detail h3,
.post .lawtvvm-video-detail h3,
.post .lawtvvm-channel-listing h3,
.post .lawtvvm-featured-slider h3,
.entry-content .lawtvvm-channel-detail h3,
.entry-content .lawtvvm-video-detail h3,
.entry-content .lawtvvm-channel-listing h3,
.entry-content .lawtvvm-featured-slider h3 {
    font-size: 15px !important;
    color: inherit !important;
    border: none !important;
    background: none !important;
    padding: 0 !important;
    margin: 8px 0 0 !important;
    padding: 0 12px !important;
    line-height: 1.3;
    font-weight: 600;
}

.post .lawtvvm-list-title,
.entry-content .lawtvvm-list-title {
    font-size: 16px !important;
    color: inherit !important;
    border: none !important;
    background: none !important;
    padding: 0 !important;
    margin: 0 0 6px !important;
}

.post .lawtvvm-channel-detail a:not(.lawtvvm-tab):not(.lawtvvm-view-btn),
.post .lawtvvm-video-detail a,
.post .lawtvvm-featured-slider a,
.post .lawtvvm-channel-listing a,
.entry-content .lawtvvm-channel-detail a:not(.lawtvvm-tab):not(.lawtvvm-view-btn),
.entry-content .lawtvvm-video-detail a,
.entry-content .lawtvvm-featured-slider a,
.entry-content .lawtvvm-channel-listing a,
.post .lawtvvm-channel-detail a:not(.lawtvvm-tab):not(.lawtvvm-view-btn):hover,
.post .lawtvvm-video-detail a:hover,
.post .lawtvvm-featured-slider a:hover,
.post .lawtvvm-channel-listing a:hover,
.entry-content .lawtvvm-channel-detail a:not(.lawtvvm-tab):not(.lawtvvm-view-btn):hover,
.entry-content .lawtvvm-video-detail a:hover,
.entry-content .lawtvvm-featured-slider a:hover,
.entry-content .lawtvvm-channel-listing a:hover {
    border-bottom: none !important;
    text-decoration: none !important;
}

.post .lawtvvm-list-excerpt,
.entry-content .lawtvvm-list-excerpt {
    margin-bottom: 0 !important;
    line-height: 1.5 !important;
    font-size: 13px !important;
}

/* ── Video Detail ───────────────────────────────── */
.lawtvvm-video-detail {
    margin-bottom: 20px;
}

.lawtvvm-video-branding {
    margin-bottom: 15px;
}

.lawtvvm-video-branding img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Video player with thumbnail overlay */
.lawtvvm-video-player {
    position: relative;
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
}

.lawtvvm-video-overlay {
    position: relative;
    cursor: pointer;
    line-height: 0;
}

.lawtvvm-video-overlay img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.lawtvvm-video-overlay .lawtvvm-play-icon {
    opacity: 1;
}

.lawtvvm-video-overlay:hover .lawtvvm-play-icon svg circle {
    fill: rgba(0, 0, 0, 0.8);
}

.lawtvvm-video-embed {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.lawtvvm-video-player .lawtvvm-video-embed {
    margin-bottom: 0;
    border-radius: 0;
}

.lawtvvm-video-embed iframe,
.lawtvvm-video-embed object,
.lawtvvm-video-embed embed,
.lawtvvm-video-embed video {
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
}

.lawtvvm-video-thumbnail img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 15px;
}

.lawtvvm-video-channels {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.lawtvvm-channel-link {
    display: inline-block;
    padding: 4px 12px;
    background: #f0f0f0;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
}

.lawtvvm-channel-link:hover {
    background: #e0e0e0;
    color: #000;
}

/* ── Channel Detail ─────────────────────────────── */
.lawtvvm-channel-banner {
    width: 100%;
    height: auto;
    border-radius: 10px;
    margin-bottom: 15px;
}

/* Filter bar */
.lawtvvm-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
}

.lawtvvm-filter-tabs {
    display: flex;
    gap: 4px;
}

.lawtvvm-tab {
    display: inline-block;
    padding: 8px 16px;
    text-decoration: none;
    color: #555;
    border: 1px solid #ddd !important;
    border-radius: 4px;
    font-size: 14px;
    transition: background 0.2s, color 0.2s;
}

.lawtvvm-tab:hover {
    background: #f0f0f0;
    color: #000;
}

.lawtvvm-tab.active {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa !important;
}

.lawtvvm-view-toggle {
    display: flex;
    gap: 4px;
}

.lawtvvm-view-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #ddd !important;
    border-radius: 4px;
    text-decoration: none;
    color: #777;
    transition: background 0.2s, color 0.2s;
}

.lawtvvm-view-btn:hover {
    background: #f0f0f0;
    color: #333;
}

.lawtvvm-view-btn.active {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa !important;
}

/* ── Video Grid ─────────────────────────────────── */
.lawtvvm-video-listing.lawtvvm-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

@media (max-width: 768px) {
    .lawtvvm-video-listing.lawtvvm-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .lawtvvm-video-listing.lawtvvm-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Video Card ─────────────────────────────────── */
.lawtvvm-video-card {
    margin-bottom: 0;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    padding-bottom: 10px;
}

.lawtvvm-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.lawtvvm-card-link:hover {
    color: inherit;
}

.lawtvvm-card-thumb {
    position: relative;
    overflow: hidden;
    border-radius: 0;
    aspect-ratio: 16 / 9;
    background: #eee;
}

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

.lawtvvm-card-link:hover .lawtvvm-card-thumb img {
    transform: scale(1.05);
}

.lawtvvm-card-placeholder {
    width: 100%;
    height: 100%;
    background: #ddd;
}

.lawtvvm-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.lawtvvm-card-link:hover .lawtvvm-play-icon,
.lawtvvm-list-thumb:hover .lawtvvm-play-icon {
    opacity: 1;
}

.lawtvvm-card-title {
    margin: 8px 0 0;
    padding: 0 12px;
    font-size: 15px;
    line-height: 1.3;
    font-weight: 600;
}

/* ── Video List ─────────────────────────────────── */
.lawtvvm-video-listing.lawtvvm-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lawtvvm-list-item {
    display: flex;
    gap: 15px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    align-items: flex-start;
}

.lawtvvm-list-thumb {
    flex: 0 0 200px;
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    aspect-ratio: 16 / 9;
    display: block;
}

.lawtvvm-list-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.lawtvvm-list-info {
    flex: 1;
    min-width: 0;
}

.lawtvvm-list-info a {
    text-decoration: none;
    color: inherit;
}

.lawtvvm-list-title {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 600;
}

.lawtvvm-list-excerpt {
    margin: 0;
    font-size: 13px;
    color: #6e6e6e;
    line-height: 1.5;
}

@media (max-width: 600px) {
    .lawtvvm-list-thumb {
        flex: 0 0 120px;
    }
}

/* ── Pagination / Load More ─────────────────────── */
.lawtvvm-pagination {
    text-align: center;
    margin: 30px 0;
}

.lawtvvm-load-more {
    display: inline-block;
    padding: 12px 30px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s;
}

.lawtvvm-load-more:hover {
    background: #005a87;
}

.lawtvvm-load-more:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.lawtvvm-load-more.loading::after {
    content: '...';
}

.lawtvvm-no-videos {
    grid-column: 1 / -1;
    text-align: center;
    color: #999;
    padding: 40px 0;
}

/* ── Featured Slider (CSS scroll-snap) ──────────── */
.lawtvvm-featured-slider,
.lawtvvm-channel-slider {
    position: relative;
    overflow: hidden;
    margin-bottom: 25px;
}

.lawtvvm-slider-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    gap: 8px;
    padding: 4px 0;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.lawtvvm-slider-track::-webkit-scrollbar {
    display: none;
}

.lawtvvm-slider-slide {
    flex: 0 0 calc(33.333% - 6px);
    scroll-snap-align: start;
}

@media (max-width: 768px) {
    .lawtvvm-slider-slide {
        flex: 0 0 calc(50% - 4px);
    }
}

@media (max-width: 480px) {
    .lawtvvm-slider-slide {
        flex: 0 0 100%;
    }
}

.lawtvvm-slider-slide a {
    display: block;
    text-decoration: none;
}

.lawtvvm-slider-slide img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Slider nav buttons */
.lawtvvm-slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s;
}

.lawtvvm-featured-slider:hover .lawtvvm-slider-btn,
.lawtvvm-channel-slider:hover .lawtvvm-slider-btn {
    opacity: 1;
}

.lawtvvm-slider-prev {
    left: 8px;
}

.lawtvvm-slider-next {
    right: 8px;
}

.lawtvvm-slider-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* ── Home Header Video ──────────────────────────── */
.lawtvvm-home-header {
    margin: 10px 0 20px;
    position: relative;
}

.lawtvvm-header-thumb {
    position: relative;
    display: block;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.lawtvvm-header-thumb img {
    width: 100%;
    height: auto;
    display: block;
}

.lawtvvm-play-large {
    opacity: 1;
}

.lawtvvm-header-play {
    display: block;
    text-decoration: none;
}

.lawtvvm-header-embed {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.lawtvvm-header-embed .lawtvvm-video-embed {
    margin-bottom: 0;
}

/* ── Channel Listing ────────────────────────────── */
.lawtvvm-channel-listing {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.lawtvvm-channel-card {
    overflow: hidden;
}

.lawtvvm-channel-card-img {
    width: 100%;
    height: auto;
    border-radius: 10px 10px 0 0;
    display: block;
}

.lawtvvm-channel-card-slider {
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 10px 10px;
    padding: 10px;
}

/* ── Server-side pagination nav ─────────────────── */
.lawtvvm-pagination-nav .page-numbers {
    list-style: none;
    display: flex;
    gap: 4px;
    justify-content: center;
    padding: 0;
    margin: 30px 0;
}

.lawtvvm-pagination-nav .page-numbers li a,
.lawtvvm-pagination-nav .page-numbers li span {
    display: inline-block;
    padding: 8px 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
}

.lawtvvm-pagination-nav .page-numbers li span.current {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}
