/* VideoHub — Main Stylesheet */

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg:        #191c23;
    --bg2:       #24262d;
    --bg3:       #1d1d1d;
    --border:    #33353a;
    --text:      #f1f1f2;
    --text-muted:#aaa;
    --accent:    #f5b12d;
    --accent2:   #ff3077;
    --link:      #fff;
    --link-hover:#ffbe76;
    --radius:    12px;
    --nav-h:     70px;
}

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    min-height: 100vh;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); }

img { max-width: 100%; height: auto; display: block; }

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 10px; background: #23242a; }
::-webkit-scrollbar-thumb { background: #444857; border-radius: 6px; }

/* ── Layout ───────────────────────────────────────────────── */
.container-fluid {
    max-width: 1420px;
    margin: 0 auto;
    padding: 0 12px;
}

.content { padding: 20px 0; }

/* ── Navigation ───────────────────────────────────────────── */
.header-nav {
    background: #000;
    position: sticky;
    top: 0;
    z-index: 999;
    border-bottom: 1px solid #111;
}

.nav-inner {
    max-width: 1420px;
    margin: 0 auto;
    padding: 0 16px;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.nav-left { display: flex; align-items: center; gap: 20px; }
.nav-logo img { height: 52px; width: auto; }

.nav-links { display: flex; align-items: center; gap: 12px; }
.nav-link {
    background: var(--bg3);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: background .15s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.nav-link:hover { background: #2d2d2d; color: var(--link-hover); }

.nav-search {
    position: relative;
    width: 300px;
}
.nav-search input {
    width: 100%;
    background: var(--bg3);
    border: none;
    border-radius: 8px;
    color: var(--text);
    height: 44px;
    padding: 0 44px 0 16px;
    font-size: 14px;
    outline: none;
    transition: background .15s;
}
.nav-search input:focus { background: #2a2a2a; }
.nav-search button {
    position: absolute;
    right: 0; top: 0; bottom: 0;
    width: 44px;
    background: none; border: none;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.nav-search svg { width: 18px; height: 18px; fill: #888; }

/* Mobile nav */
.hamburger {
    display: none;
    background: none; border: none; cursor: pointer; padding: 4px;
}
.hamburger svg { width: 26px; height: 26px; }

.mobile-search-btn {
    display: none;
    background: none; border: none; cursor: pointer;
}

.mobile-nav-panel {
    display: none;
    background: #111;
    padding: 16px;
    border-top: 1px solid #222;
}
.mobile-nav-panel.open { display: block; }
.mobile-nav-panel a {
    display: block;
    background: var(--bg3);
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 15px;
}

.mobile-search-panel {
    display: none;
    padding: 12px 16px;
    background: #111;
    border-top: 1px solid #222;
}
.mobile-search-panel.open { display: block; }
.mobile-search-panel .ms-form {
    position: relative;
}
.mobile-search-panel input {
    width: 100%;
    background: var(--bg3);
    border: none;
    border-radius: 8px;
    color: var(--text);
    height: 44px;
    padding: 0 44px 0 16px;
    font-size: 14px;
    outline: none;
}
.mobile-search-panel .ms-icon {
    position: absolute;
    right: 12px; top: 50%;
    transform: translateY(-50%);
    width: 20px; height: 20px;
    fill: #888;
    pointer-events: none;
}

@media (max-width: 991px) {
    .nav-links, .nav-search { display: none; }
    .hamburger, .mobile-search-btn { display: flex; align-items: center; }
}

/* ── Breadcrumb ───────────────────────────────────────────── */
.breadcrumb {
    padding: 10px 0;
    font-size: 13px;
}
.breadcrumb ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.breadcrumb li + li::before { content: "/"; margin-right: 6px; color: #666; }
.breadcrumb a { color: var(--accent); font-weight: 600; }
.breadcrumb a:hover { color: #fff; }
.breadcrumb .current { color: var(--text-muted); }

/* ── Tag pill bar ─────────────────────────────────────────── */
.fj-tagbar-wrapper {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    position: relative;
}

.fj-tagbar {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    overflow-x: auto;
    padding: 12px 0;
    scrollbar-width: none;
    scroll-behavior: smooth;
    width: 100%;
}
.fj-tagbar::-webkit-scrollbar { display: none; }

.fj-tagpill {
    background: var(--bg3);
    color: var(--text);
    border-radius: 26px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: background .15s, color .15s;
    border: 1px solid var(--border);
    flex-shrink: 0;
}
.fj-tagpill:hover { background: var(--accent); color: #000; }

.fj-arrow {
    background: none; border: none;
    color: var(--accent);
    min-width: 36px; min-height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; flex-shrink: 0;
    transition: background .15s;
}
.fj-arrow:hover { background: #111; }

/* ── Video grid ───────────────────────────────────────────── */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.thumb {
    background: none;
}

.card {
    display: block;
    background: none !important;
    border: none !important;
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform .15s;
}
.card:hover { transform: translateY(-3px); }

.thumb__img {
    aspect-ratio: 16/9;
    width: 100%;
    overflow: hidden;
    border-radius: var(--radius);
    background: #111;
    position: relative;
}
.thumb__img img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .3s;
}
.card:hover .thumb__img img { transform: scale(1.04); }

.card-body { padding: 7px 4px 5px; background: none !important; }
.card-title {
    color: var(--text) !important;
    font-size: 13px;
    font-weight: 500;
    margin: 0 0 5px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.time-ago { font-size: 11px; color: var(--text-muted); }
.card-stat {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}
.card-stat svg { flex-shrink: 0; opacity: .7; }

/* ── Single video page ────────────────────────────────────── */
.single-video { max-width: 1420px; margin: 0 auto; }

.single-title {
    font-size: clamp(1.1rem, 2.5vw, 1.6rem);
    font-weight: 700;
    margin: 12px 0 10px;
}

.video-player { margin-bottom: 12px; }

.vid-maxwrap {
    width: 100%;
    max-width: 1420px;
    aspect-ratio: 16/9;
    background: #111;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 8px;
    position: relative;
    display: block;
    cursor: pointer;
}
.vid-max-thumb { width: 100%; height: 100%; object-fit: cover; }
.vid-max-playbtn {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,.45);
    border-radius: 50%;
    padding: 0;
    pointer-events: none;
    transition: background .15s;
    display: flex; align-items: center; justify-content: center;
}
.vid-maxwrap:hover .vid-max-playbtn { background: rgba(0,0,0,.6); }
.vid-max-iframe { width: 100%; height: 100%; border: 0; background: #000; }

.video-unit { opacity: 0; visibility: hidden; display: none; transition: opacity .3s; }
.video-unit.active { opacity: 1; visibility: visible; display: block; }

/* Server dropdown */
.srv-dropdown-wrap { position: relative; display: inline-block; margin-bottom: 10px; }
.srv-drop-toggle {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 9px 14px;
    background: linear-gradient(135deg,#1c1c1c,#000);
    color: var(--accent);
    border: none; border-radius: 12px;
    font-size: 15px; font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,0,0,.3);
    transition: background .2s;
}
.srv-drop-menu {
    display: none; position: absolute;
    top: calc(100% + 6px); left: 0;
    background: #1a1a1a; border: 1px solid #333;
    border-radius: 10px; min-width: 160px;
    z-index: 99; box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
.srv-drop-menu.open { display: block; }
.srv-drop-item {
    display: flex; align-items: center; gap: 8px;
    width: 100%; padding: 10px 14px;
    background: none; border: none;
    color: #ccc; font-size: 14px;
    cursor: pointer; text-align: left;
    transition: background .15s;
}
.srv-drop-item:hover, .srv-drop-item.active { background: #2a2a2a; color: var(--accent); }

/* Video meta / tags */
.video-meta { display: flex; flex-wrap: wrap; gap: 4px; margin: 12px 0; align-items: center; }
.video-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.video-categories { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }

.tag-badge {
    background: #000;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 99px;
    padding: 4px 12px;
    font-size: 13px;
    font-weight: 500;
    transition: background .2s;
    white-space: nowrap;
}
.tag-badge:hover { background: #ededed; color: #000; }

.cat-badge {
    background: var(--accent2);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    border-radius: 99px;
    padding: 5px 14px;
    box-shadow: 0 2px 12px rgba(255,48,119,.3);
    white-space: nowrap;
    transition: background .15s;
}
.cat-badge:hover { background: #e2005a; }

/* Vote buttons */
.vote-strip {
    display: flex;
    gap: 8px;
    margin: 10px 0;
}
.vote-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 6px 10px;
    color: #000;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s;
}
.vote-btn:hover { background: #f0f0f0; box-shadow: 0 0 8px rgba(0,0,0,.2); }
.vote-strip.voted .vote-btn { opacity: .5; pointer-events: none; }
.vote-count { font-size: 16px; font-weight: 600; min-width: 24px; }

/* Favourite button */
.fav-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,.08);
    color: #fff;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 8px;
    padding: 5px 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    margin-top: 0;
    height: 36px;
}
.fav-btn:hover { background: rgba(255,255,255,.14); }
.fav-btn.faved { background: #ff4a75; border-color: #ff4a75; }
.fav-icon { width: 18px; height: 18px; object-fit: contain; }

/* Download button */
.download-btn {
    display: block;
    width: 100%;
    padding: 10px;
    background: var(--accent);
    color: #1d1d1d;
    text-align: center;
    border-radius: var(--radius);
    font-size: 17px;
    font-weight: 700;
    margin: 6px 0;
    transition: all .25s;
}
.download-btn:hover { background: #000; color: #fff; }

/* Share buttons */
.share-strip {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 14px 0;
}
.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 14px;
    border-radius: 12px;
    background: #0f1115;
    color: #e5e7eb;
    font: 600 13px/1 system-ui,Arial;
    border: 1px solid #23262f;
    cursor: pointer;
    transition: transform .12s, opacity .12s;
    text-decoration: none;
}
.share-btn:hover { transform: translateY(-1px); opacity: .9; color: #e5e7eb; }
.share-btn svg { width: 16px; height: 16px; fill: currentColor; }
.share-btn--wa:hover { background: #128c7e; }
.share-btn--tg:hover { background: #229ED9; }
.share-btn--tw:hover { background: #1d9bf0; }

/* Popular strip */
.popular-section { margin: 20px 0; }
.popular-heading { font-size: 17px; font-weight: 700; color: #fff; margin-bottom: 10px; }
.popular-wrapper { position: relative; overflow: hidden; }
.popular-row {
    display: flex; gap: 12px;
    overflow-x: auto; scroll-behavior: smooth;
    padding: 10px 0; scrollbar-width: none;
}
.popular-row::-webkit-scrollbar { display: none; }
.popular-item { flex: 0 0 auto; text-align: center; width: 86px; }
.popular-thumb {
    width: 80px; height: 80px;
    border-radius: 50%; object-fit: cover;
    margin: 0 auto 5px;
    border: 2px solid #333; background: #111;
}
.popular-title {
    display: block; font-size: 12px; color: #fff;
    white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; max-width: 82px;
}
.popular-arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 34px; height: 34px;
    background: rgba(0,0,0,.6);
    color: #fff; border: none; border-radius: 50%;
    cursor: pointer; font-size: 20px;
    display: flex; align-items: center; justify-content: center;
    z-index: 5;
}
.popular-arrow:disabled { opacity: .3; cursor: default; }
.popular-left { left: -4px; }
.popular-right { right: -4px; }

/* Related videos */
.related-videos { margin: 24px 0; }
.related-videos h2 { font-size: 18px; font-weight: 700; margin-bottom: 14px; }

/* Prev/next nav */
.prevnext { display: flex; justify-content: space-between; margin: 14px 0; font-size: 14px; }
.prevnext a { color: var(--accent); }

/* ── Pagination ───────────────────────────────────────────── */
.pagination-wrapper { text-align: center; margin: 28px 0 16px; }
.page-numbers {
    display: inline-block;
    min-width: 38px; line-height: 38px;
    font-size: 15px; font-weight: 700;
    border-radius: 6px;
    background: #000; color: #fff;
    margin: 0 2px;
    text-align: center;
    transition: background .2s, color .2s;
    cursor: pointer;
    text-decoration: none;
}
.page-numbers.current { background: var(--accent) !important; color: #000 !important; pointer-events: none; }
.page-numbers.dots { background: none !important; color: #aaa !important; cursor: default; }
.page-numbers:hover:not(.current):not(.dots) { background: var(--accent); color: #000; }

/* ── Tags/Categories archive page ────────────────────────── */
.terms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
    margin: 20px 0;
}
.term-card {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform .15s, border-color .15s;
}
.term-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.term-thumb { aspect-ratio: 16/9; overflow: hidden; background: #111; }
.term-thumb img { width: 100%; height: 100%; object-fit: cover; }
.term-info { padding: 8px 10px; }
.term-name { font-size: 13px; font-weight: 600; color: var(--text); }
.term-count { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ── Search ───────────────────────────────────────────────── */
.search-header { margin: 14px 0 20px; }
.search-header h1 { font-size: 1.4rem; }

/* ── Favourites ───────────────────────────────────────────── */
.fav-container { max-width: 1280px; margin: 0 auto; padding: 20px 0; }
.fav-intro { background: var(--bg2); padding: 16px; border-radius: 10px; margin-bottom: 20px; }
.fav-item { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.fav-item img { border-radius: 8px; width: 120px; height: 68px; object-fit: cover; flex-shrink: 0; }
.fav-item-title { flex: 1; }
.fav-item-title h3 a { font-size: 14px; font-weight: 600; }
.fav-delete { background: var(--bg3); border: none; color: #fff; padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.fav-delete:hover { background: #c12727; }
.fav-tools { margin-top: 30px; padding: 20px; background: var(--bg2); border-radius: 10px; }
.fav-tools h2 { margin-bottom: 14px; }
.btn-primary {
    background: #345fff; border: none; color: #fff;
    padding: 10px 18px; border-radius: 8px;
    cursor: pointer; font-size: 14px; font-weight: 600;
    transition: background .2s;
}
.btn-primary:hover { background: #2341b8; }

/* ── Tag archive extra ────────────────────────────────────── */
.jd-tag-html { margin: 16px 0; }

/* ── Footer ───────────────────────────────────────────────── */
footer {
    background: #0f0f0f;
    color: #e0e0e0;
    padding: 40px 20px 24px;
    border-top: 1px solid #222;
    margin-top: 40px;
    font-size: 14px;
}
.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 36px;
}
.footer-section h3 {
    color: #fff; margin-bottom: 16px;
    font-size: 1.1rem; position: relative; padding-bottom: 8px;
}
.footer-section h3::after {
    content: ''; position: absolute; left: 0; bottom: 0;
    width: 36px; height: 3px;
    background: var(--accent); border-radius: 2px;
}
.footer-section a { color: #bbb; display: block; margin-bottom: 8px; }
.footer-section a:hover { color: #f89ba4; }
.footer-bottom {
    max-width: 1100px; margin: 28px auto 0;
    padding-top: 20px; border-top: 1px solid #222;
    text-align: center; color: #666; font-size: 13px;
}

/* ── 404 ──────────────────────────────────────────────────── */
.error-404 { text-align: center; padding: 80px 20px; }
.error-404 h1 { font-size: clamp(3rem, 10vw, 7rem); color: var(--accent); }
.error-404 p { font-size: 1.1rem; margin: 16px 0 28px; color: var(--text-muted); }

/* ── Utilities ────────────────────────────────────────────── */
.d-flex { display: flex; }
.d-none { display: none; }
.gap-2 { gap: 8px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mb-2 { margin-bottom: 8px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.w-100 { width: 100%; }

/* ── Media queries ────────────────────────────────────────── */
@media (max-width: 600px) {
    .share-strip .share-btn { flex: 1 1 calc(50% - 8px); }
    .vote-strip { flex-direction: column; }
    .fav-item { flex-direction: column; align-items: flex-start; }
    .footer-inner { grid-template-columns: 1fr; text-align: center; }
    .footer-section h3::after { left: 50%; transform: translateX(-50%); }
    .videos-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
}
@media (max-width: 380px) {
    .videos-grid { grid-template-columns: 1fr; }
}

/* ── AJAX Search Dropdown ─────────────────────────────────── */
.search-wrap { position: relative; }
.search-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0; right: 0;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    overflow: hidden;
    z-index: 9999;
    box-shadow: 0 12px 40px rgba(0,0,0,.6);
    min-width: 340px;
}
.search-dropdown.open { display: block; }
.sd-section-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #555;
    padding: 10px 14px 4px;
}
.sd-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    text-decoration: none;
    color: #ccc;
    font-size: 13px;
    transition: background .12s;
    cursor: pointer;
}
.sd-item:hover { background: #252525; color: #fff; }
.sd-thumb {
    width: 52px;
    height: 30px;
    object-fit: cover;
    border-radius: 4px;
    background: #111;
    flex-shrink: 0;
}
.sd-thumb-placeholder {
    width: 52px; height: 30px;
    background: #222; border-radius: 4px; flex-shrink: 0;
}
.sd-item-text { flex: 1; overflow: hidden; }
.sd-item-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-item-sub { font-size: 11px; color: #555; margin-top: 1px; }
.sd-tag-pill {
    display: inline-flex; align-items: center; gap: 5px;
    background: #111; border: 1px solid #2a2a2a;
    color: #aaa; font-size: 12px; padding: 4px 10px;
    border-radius: 99px; text-decoration: none;
    transition: background .12s, color .12s;
}
.sd-tag-pill:hover { background: #222; color: #f5b12d; }
.sd-tags-wrap { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 14px 12px; }
.sd-footer { padding: 8px 14px; border-top: 1px solid #222; }
.sd-footer a { color: var(--accent); font-size: 12px; text-decoration: none; }
.sd-footer a:hover { text-decoration: underline; }
.sd-loading { padding: 16px; text-align: center; color: #555; font-size: 13px; }
.sd-empty { padding: 16px; text-align: center; color: #555; font-size: 13px; }

/* ── Nav icon alignment ───────────────────────────────────── */
.nav-link { display: inline-flex; align-items: center; gap: 5px; }

/* ── Related categories section ──────────────────────────── */
.related-cats-section { margin: 32px 0 20px; }
.related-cats-section h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 14px; }
.related-cats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}
.rel-cat-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    background: #111;
    text-decoration: none;
    display: block;
    transition: transform .15s;
}
.rel-cat-card:hover { transform: translateY(-2px); }
.rel-cat-card img {
    width: 100%; aspect-ratio: 16/9;
    object-fit: cover; display: block;
}
.rel-cat-placeholder {
    width: 100%; aspect-ratio: 16/9;
    background: #1a1a2e;
    display: flex; align-items: center; justify-content: center;
}
.rel-cat-overlay {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,.85));
    padding: 20px 8px 8px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}
.rel-cat-count { font-size: 10px; color: #aaa; font-weight: 400; margin-top: 2px; }
