/* Mobile-first custom overrides on Bootstrap 5 */
:root {
    --vg-accent: #e53935;
    --rv-red: #e53935;
    --rv-red-dark: #c62828;
    --rv-red-bright: #ff5252;
    --rv-page-bg: #1a1a1a;
    --rv-page-text: #d0d0d0;
    --rv-header-bg: #000;
    --rv-sidebar-bg: #0d0d0d;
    --rv-search-bg: #1f1f1f;
    --bs-body-bg: #000;
    --bs-body-color: #e8e8e8;
    --bs-danger: #e53935;
    --bs-danger-rgb: 229, 57, 53;
}

[data-bs-theme="dark"] {
    --bs-body-bg: #000;
    --bs-body-color: #e8e8e8;
    --bs-secondary-color: #9aa0a6;
    --bs-border-color: #2a2a2a;
    --bs-dark: #000;
    --bs-dark-rgb: 0, 0, 0;
}

body,
.site-body {
    -webkit-tap-highlight-color: transparent;
    background: #000;
    color: #e8e8e8;
}

.btn-danger {
    --bs-btn-bg: var(--rv-red);
    --bs-btn-border-color: var(--rv-red);
    --bs-btn-hover-bg: var(--rv-red-bright);
    --bs-btn-hover-border-color: var(--rv-red-bright);
    --bs-btn-active-bg: var(--rv-red-dark);
    --bs-btn-active-border-color: var(--rv-red-dark);
}

.btn-outline-danger {
    --bs-btn-color: var(--rv-red);
    --bs-btn-border-color: var(--rv-red);
    --bs-btn-hover-bg: var(--rv-red);
    --bs-btn-hover-border-color: var(--rv-red);
}

.text-danger {
    color: var(--rv-red) !important;
}

.site-breadcrumb .breadcrumb {
    --bs-breadcrumb-divider: "›";
    font-size: 0.8125rem;
    background: transparent;
    padding: 0;
    margin-bottom: 0.75rem;
}

.site-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    color: #666;
}

.site-breadcrumb .breadcrumb-item a {
    color: var(--bs-secondary-color);
    text-decoration: none;
}

.site-breadcrumb .breadcrumb-item a:hover {
    color: var(--rv-red-bright);
}

.site-breadcrumb .breadcrumb-item.active {
    color: #e8e8e8;
}

/* Site shell + sidebar */
.site-shell {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-main-wrap {
    flex: 1 1 auto;
    min-width: 0;
}

.site-overlay {
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: rgba(0, 0, 0, 0.65);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.site-shell.sidebar-open .site-overlay {
    opacity: 1;
    visibility: visible;
}

body.sidebar-no-scroll {
    overflow: hidden;
}

.site-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1050;
    width: min(300px, 88vw);
    height: 100vh;
    background: var(--rv-sidebar-bg);
    border-right: 1px solid #222;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    overflow: hidden;
}

.site-shell.sidebar-open .site-sidebar {
    transform: translateX(0);
}

.site-sidebar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 3px;
    height: 100%;
    background: var(--rv-red);
}

.site-sidebar-inner {
    height: 100%;
    overflow-y: auto;
    padding: 12px 14px 24px;
}

.site-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #222;
}

.site-sidebar-close {
    border: 0;
    background: transparent;
    color: #aaa;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.site-sidebar-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.site-sidebar-nav,
.site-sidebar-account {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.site-sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 999px;
    background: #1a1a1a;
    color: #fff;
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
    transition: background 0.15s ease, color 0.15s ease;
}

.site-sidebar-link i {
    font-size: 1.1rem;
    color: var(--rv-red);
    width: 20px;
    text-align: center;
}

.site-sidebar-link:hover {
    background: #252525;
    color: #fff;
}

.site-sidebar-section {
    margin-top: 16px;
}

.site-sidebar-accordion {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 14px;
    border: 0;
    border-radius: 999px;
    background: #1a1a1a;
    color: #fff;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
}

.site-sidebar-accordion:hover {
    background: #252525;
}

.site-sidebar-chevron {
    transition: transform 0.2s ease;
    color: #888;
}

.site-sidebar-accordion.is-open .site-sidebar-chevron {
    transform: rotate(180deg);
}

.site-sidebar-cats {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
}

.site-sidebar-cats.is-open {
    max-height: 520px;
}

.site-sidebar-cats li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px 8px 20px;
    color: #ccc;
    text-decoration: none;
    font-size: 0.88rem;
    border-radius: 6px;
}

.site-sidebar-cats li a i {
    color: #666;
    font-size: 0.85rem;
}

.site-sidebar-cats li a:hover {
    color: #fff;
    background: rgba(229, 57, 53, 0.12);
}

.site-sidebar-more a {
    color: var(--rv-red) !important;
    font-weight: 600;
}

.site-sidebar-account {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #222;
}

/* Top header bar */
.site-header {
    background: var(--rv-header-bg);
    border-bottom: 1px solid #1f1f1f;
}

.site-topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    max-width: 1400px;
    margin: 0 auto;
}

.site-topbar-left {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.site-menu-btn {
    border: 0;
    background: transparent;
    color: var(--rv-red);
    width: 40px;
    height: 40px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    cursor: pointer;
    padding: 0;
}

.site-menu-btn:hover {
    background: rgba(229, 57, 53, 0.12);
}

.site-topbar-logo {
    display: none;
}

@media (min-width: 576px) {
    .site-topbar-logo {
        display: inline-flex;
    }
}

.site-search {
    flex: 1 1 auto;
    position: relative;
    max-width: 640px;
    margin: 0 auto;
}

.site-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    pointer-events: none;
}

.site-search input {
    width: 100%;
    height: 40px;
    padding: 0 16px 0 40px;
    border: 0;
    border-radius: 999px;
    background: var(--rv-search-bg);
    color: #fff;
    font-size: 0.95rem;
}

.site-search input::placeholder {
    color: #888;
}

.site-search input:focus {
    outline: 2px solid rgba(229, 57, 53, 0.45);
    outline-offset: 0;
}

.site-topbar-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.site-action-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    font-size: 1.35rem;
}

.site-action-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

/* Sub navigation */
.site-subnav {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0 12px;
    max-width: 1400px;
    margin: 0 auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.site-subnav::-webkit-scrollbar {
    display: none;
}

.site-subnav-link {
    flex: 0 0 auto;
    padding: 12px 16px;
    color: #fff;
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.site-subnav-link:hover {
    color: var(--rv-red-bright);
}

.site-subnav-link.is-active {
    color: #fff;
    border-bottom-color: var(--rv-red);
}

.site-content {
    max-width: 1400px;
}

.site-footer {
    background: #000;
    border-top: 1px solid #1f1f1f;
}

.site-footer-links {
    border-bottom: 1px solid #1f1f1f;
}

.site-footer-heading {
    color: #9aa0a6;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 12px;
}

.site-footer-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-footer-list li + li {
    margin-top: 8px;
}

.site-footer-list a {
    color: var(--rv-red);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
}

.site-footer-list a:hover {
    color: var(--rv-red-bright);
    text-decoration: underline;
}

.static-page-content {
    color: #d0d0d0;
    line-height: 1.7;
    max-width: 820px;
}

.static-page-content h2,
.static-page-content .h5 {
    color: #fff;
    font-weight: 700;
}

.static-page-content p {
    margin-bottom: 1rem;
}

.static-page-content ul,
.static-page-content ol {
    margin-bottom: 1rem;
    padding-left: 1.35rem;
}

.static-page-content li + li {
    margin-top: 0.35rem;
}

.static-page-content a {
    color: var(--rv-red);
    text-decoration: none;
}

.static-page-content a:hover {
    color: var(--rv-red-bright);
    text-decoration: underline;
}

.static-page-content p:last-child {
    margin-bottom: 0;
}

.video-card {
    background: transparent;
    border: 0;
}

.video-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 4px;
    background: #1a1a1a;
}

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

.video-thumb-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 2rem;
}

.video-duration {
    position: absolute;
    right: 6px;
    bottom: 6px;
    z-index: 2;
    padding: 2px 6px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    color: #fff;
    background: rgba(0, 0, 0, 0.75);
    border-radius: 3px;
    pointer-events: none;
}

.video-meta {
    padding: 8px 2px 0;
}

.video-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.video-channel {
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.video-views {
    color: #9aa0a6;
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
}

.video-views .bi {
    font-size: 11px;
    margin-right: 2px;
}

.video-title-row {
    margin-top: 4px;
    align-items: flex-start;
}

.video-title {
    color: #e8eaed;
    font-size: 13px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
    min-width: 0;
}

.video-title:hover {
    color: #fff;
}

.video-menu-btn {
    background: none;
    border: 0;
    color: #9aa0a6;
    padding: 0 0 0 4px;
    line-height: 1;
    flex-shrink: 0;
    cursor: pointer;
}

.video-menu-btn:hover {
    color: #fff;
}

@media (hover: hover) {
    .video-thumb-link:hover .video-thumb-img {
        filter: brightness(1.08);
    }
}

.object-fit-cover {
    object-fit: cover;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.taxonomy-grid .col {
    display: flex;
}

.taxonomy-card {
    width: 100%;
    border-radius: 4px;
    overflow: hidden;
}

.taxonomy-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: 90px;
    overflow: hidden;
    background: #1a1a1a;
    border-radius: 4px;
}

.taxonomy-thumb-img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.taxonomy-thumb-fallback {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to top, rgba(0, 0, 0, 0.5) 0%, transparent 55%),
        linear-gradient(135deg, #3a3a3a 0%, #1f1f1f 45%, #141414 100%);
}

.taxonomy-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.35) 45%, transparent 70%);
    pointer-events: none;
}

.taxonomy-info {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 10px 12px;
    text-align: left;
    z-index: 2;
}

.taxonomy-name {
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.25;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.taxonomy-count {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.8rem;
    line-height: 1.3;
    margin-top: 2px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

@media (min-width: 768px) {
    .taxonomy-name {
        font-size: 1.05rem;
    }

    .taxonomy-count {
        font-size: 0.85rem;
    }
}

.taxonomy-thumb-preview {
    width: 200px;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background: #1a1a1a;
}

.taxonomy-card:hover .taxonomy-thumb-img {
    transform: scale(1.03);
}

.taxonomy-card .taxonomy-thumb-img {
    transition: transform 0.2s ease;
}

.video-embed iframe {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0.375rem;
}

/* RVids enhanced embed player */
.rv-player {
    background: #0a0a0a;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #333;
}

.rv-player.is-theater {
    max-width: none;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    width: 100vw;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
}

body.rv-player-theater-active {
    overflow-x: hidden;
}

.rv-player-screen {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}

.rv-player:fullscreen {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    border-radius: 0;
}

.rv-player:fullscreen .rv-player-screen {
    flex: 1 1 auto;
    aspect-ratio: auto;
    min-height: 0;
}

.rv-player:fullscreen .rv-player-frame-wrap,
.rv-player:fullscreen iframe {
    height: 100%;
}

.rv-player-frame-wrap,
.rv-player-poster {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.rv-player-poster {
    border: 0;
    padding: 0;
    margin: 0;
    cursor: pointer;
    background: #000;
}

.rv-player-poster-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.rv-player-play-btn {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(220, 53, 69, 0.92);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
    transition: transform 0.15s ease, background 0.15s ease;
}

.rv-player-poster:hover .rv-player-play-btn {
    transform: translate(-50%, -50%) scale(1.06);
    background: #dc3545;
}

.rv-player-frame-wrap {
    position: absolute;
    inset: 0;
}

.rv-player-frame-wrap iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.rv-player-loading {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    pointer-events: none;
}

.rv-player-duration-badge {
    position: absolute;
    right: 10px;
    bottom: 10px;
    z-index: 2;
    padding: 3px 8px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: rgba(0, 0, 0, 0.75);
    border-radius: 4px;
}

.rv-embed-shields {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
}

.rv-embed-shields.is-disabled {
    display: none;
}

.rv-embed-shield {
    position: absolute;
    background: transparent;
    pointer-events: auto;
}

/* Small top-corner shields only — never cover player controls at the bottom */
.rv-embed-shield-tl {
    top: 0;
    left: 0;
    width: 90px;
    height: 44px;
}

.rv-embed-shield-tr {
    top: 0;
    right: 0;
    width: 72px;
    height: 44px;
}

.rv-player-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px;
    background: #141414;
    border-top: 1px solid #2a2a2a;
}

.rv-player-toolbar-left,
.rv-player-toolbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.rv-player-title {
    color: #ccc;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rv-player-btn {
    border: 0;
    background: transparent;
    color: #ddd;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
}

.rv-player-btn:hover,
.rv-player-btn.is-active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.rv-player-previews {
    display: flex;
    gap: 6px;
    padding: 10px 12px;
    overflow-x: auto;
    background: #101010;
    border-top: 1px solid #2a2a2a;
}

.rv-player-preview-thumb {
    flex: 0 0 auto;
    width: 120px;
    aspect-ratio: 16 / 9;
    border: 2px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    padding: 0;
    background: #000;
    cursor: pointer;
}

.rv-player-preview-thumb.is-active {
    border-color: #dc3545;
}

.rv-player-preview-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.rv-player-empty {
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a1a;
}

.rv-player-empty-msg {
    color: #888;
}

.admin-sidebar {
    min-height: calc(100vh - 56px);
}

.admin-sidebar .nav-link {
    color: rgba(255, 255, 255, 0.75);
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
}

.table-responsive {
    -webkit-overflow-scrolling: touch;
}

/* Custom pagination */
.rv-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin: 2rem 0 1rem;
    padding: 0;
}

.rv-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 38px;
    padding: 0 14px;
    border: 0;
    border-radius: 4px;
    background: var(--rv-page-bg);
    color: var(--rv-page-text);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    line-height: 1;
    transition: background 0.15s ease, color 0.15s ease;
}

a.rv-page-btn:hover {
    background: #3a3a3a;
    color: #fff;
}

.rv-page-btn.rv-num {
    min-width: 38px;
    padding: 0 10px;
}

.rv-page-btn.rv-num.is-active {
    background: #3d3d3d;
    color: #fff;
}

.rv-page-btn.rv-prev,
.rv-page-btn.rv-next {
    min-width: 64px;
    padding: 0 18px;
}

.rv-page-btn.rv-prev.is-disabled {
    background: #1f1f1f;
    color: #555;
    cursor: default;
}

.rv-page-btn.rv-next {
    background: var(--rv-red);
    color: #fff;
}

a.rv-page-btn.rv-next:hover {
    background: var(--rv-red-bright);
    color: #fff;
}

.rv-page-btn.rv-next.is-disabled {
    background: #4a1515;
    color: #666;
    cursor: default;
}

@media (max-width: 575.98px) {
    .rv-pagination {
        gap: 4px;
    }

    .rv-page-btn {
        min-width: 34px;
        height: 34px;
        font-size: 13px;
        padding: 0 10px;
    }

    .rv-page-btn.rv-prev,
    .rv-page-btn.rv-next {
        min-width: 56px;
    }
}

.brand-logo {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #fff;
    text-decoration: none;
    align-items: center;
}

.brand-logo .brand-accent {
    display: inline-block;
    background: var(--rv-red);
    color: #fff;
    padding: 2px 8px;
    margin-left: 1px;
    border-radius: 5px;
    font-weight: 800;
}

#similar-load-more {
    min-width: 160px;
    font-weight: 700;
}

/* Touch-friendly tap targets on mobile */
@media (max-width: 575.98px) {
    .btn, .page-link {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    .site-topbar {
        padding: 6px 8px;
        gap: 6px;
    }

    .site-subnav-link {
        padding: 10px 12px;
        font-size: 0.72rem;
    }
}
