/* PremiumTube — xHamster-inspired theme */
@import url('https://fonts.googleapis.com/css2?family=Onest:wght@400;500;600;700;800&display=swap');

:root {
    --bg: #0e0e0e;
    --bg-card: #1a1a1a;
    --bg-elev: #232323;
    --border: #2a2a2a;
    --text: #ffffff;
    --text-dim: #a8a8a8;
    --text-muted: #6e6e6e;
    --accent: #fd9b00;
    --accent-hover: #ffb133;
    --accent-dark: #c97b00;
    --danger: #ff3b30;
    --success: #34c759;
    --radius: 6px;
    --header-h: 56px;
    --nav-h: 44px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--text); font-family: 'Onest', sans-serif; font-size: 14px; line-height: 1.4; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }

::selection { background: var(--accent); color: #000; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #0a0a0a; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ============ AGE GATE ============ */
.age-gate { position: fixed; inset: 0; background: rgba(0,0,0,.96); z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 20px; }
.age-gate-box { max-width: 480px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 40px 32px; text-align: center; }
.age-gate-box h2 { color: var(--accent); font-size: 32px; font-weight: 800; margin-bottom: 10px; letter-spacing: -.5px; }
.age-gate-box p { color: var(--text-dim); margin-bottom: 24px; line-height: 1.6; }
.age-gate-actions { display: flex; gap: 12px; }
.age-gate-actions button { flex: 1; padding: 14px; border: none; border-radius: var(--radius); font-weight: 700; font-size: 14px; letter-spacing: .3px; }
.age-gate-yes { background: var(--accent); color: #000; }
.age-gate-yes:hover { background: var(--accent-hover); }
.age-gate-no { background: var(--bg-elev); color: var(--text-dim); }

/* ============ HEADER ============ */
.site-header { position: sticky; top: 0; z-index: 100; background: #000; border-bottom: 1px solid var(--border); }
.header-inner { max-width: 1600px; margin: 0 auto; padding: 0 16px; height: var(--header-h); display: flex; align-items: center; gap: 24px; }
.logo { font-size: 22px; font-weight: 800; letter-spacing: -.5px; color: #fff; white-space: nowrap; }
.logo span { color: var(--accent); }
.search-bar { flex: 1; max-width: 640px; position: relative; }
.search-bar input { width: 100%; height: 36px; background: var(--bg-elev); border: 1px solid transparent; border-radius: 20px; padding: 0 44px 0 18px; color: #fff; font-family: inherit; font-size: 14px; transition: border-color .15s; }
.search-bar input:focus { outline: none; border-color: var(--accent); }
.search-bar button { position: absolute; right: 4px; top: 4px; height: 28px; width: 32px; background: transparent; border: none; color: var(--text-dim); display: flex; align-items: center; justify-content: center; }
.search-bar button:hover { color: var(--accent); }
.header-actions { display: flex; gap: 8px; align-items: center; }
.btn-pill { padding: 8px 14px; border-radius: 20px; font-weight: 600; font-size: 13px; transition: all .15s; border: 1px solid var(--border); background: transparent; color: var(--text); }
.btn-pill:hover { border-color: var(--accent); color: var(--accent); }
.btn-pill.primary { background: var(--accent); border-color: var(--accent); color: #000; }
.btn-pill.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #000; }

/* ============ NAV BAR ============ */
.nav-bar { background: var(--bg-card); border-bottom: 1px solid var(--border); overflow-x: auto; }
.nav-inner { max-width: 1600px; margin: 0 auto; padding: 0 16px; display: flex; gap: 4px; height: var(--nav-h); align-items: center; white-space: nowrap; }
.nav-inner a { padding: 8px 14px; border-radius: var(--radius); font-size: 13px; font-weight: 500; color: var(--text-dim); transition: all .15s; }
.nav-inner a:hover, .nav-inner a.active { background: var(--bg-elev); color: var(--accent); }

/* ============ LAYOUT ============ */
.container { max-width: 1600px; margin: 0 auto; padding: 20px 16px; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.section-title h2 { font-size: 18px; font-weight: 700; color: #fff; letter-spacing: -.2px; }
.section-title h2 span.count { color: var(--text-muted); font-weight: 400; margin-left: 6px; }
.section-title .sort-tabs { display: flex; gap: 4px; }
.section-title .sort-tabs a { padding: 6px 12px; border-radius: var(--radius); font-size: 12px; color: var(--text-dim); transition: all .15s; font-weight: 600; }
.section-title .sort-tabs a:hover { color: var(--accent); }
.section-title .sort-tabs a.active { background: var(--accent); color: #000; }

/* ============ VIDEO GRID ============ */
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px 14px; }
.video-card { background: transparent; border-radius: var(--radius); overflow: hidden; transition: transform .2s; }
.video-card:hover { transform: translateY(-2px); }
.video-card .thumb-wrap { position: relative; aspect-ratio: 16/9; background: #000; border-radius: var(--radius); overflow: hidden; }
.video-card .thumb-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.video-card:hover .thumb-wrap img { transform: scale(1.04); }
.video-card .badge-duration { position: absolute; bottom: 8px; right: 8px; background: rgba(0,0,0,.85); color: #fff; padding: 3px 6px; border-radius: 3px; font-size: 12px; font-weight: 600; }
.video-card .badge-hd { position: absolute; bottom: 8px; left: 8px; background: var(--accent); color: #000; padding: 3px 6px; border-radius: 3px; font-size: 11px; font-weight: 700; letter-spacing: .3px; }
.video-card .badge-preview { position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,.8); color: #fff; padding: 3px 8px; border-radius: 3px; font-size: 11px; font-weight: 600; opacity: 0; transition: opacity .2s; }
.video-card:hover .badge-preview { opacity: 1; }
.video-card .play-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.0); transition: background .2s; opacity: 0; }
.video-card:hover .play-overlay { opacity: 1; background: rgba(0,0,0,.2); }
.video-card .play-overlay .play-icon { width: 56px; height: 56px; background: var(--accent); color: #000; border-radius: 50%; display: flex; align-items: center; justify-content: center; transform: scale(.8); transition: transform .2s; }
.video-card:hover .play-overlay .play-icon { transform: scale(1); }
.video-card .play-overlay svg { width: 22px; height: 22px; fill: #000; margin-left: 3px; }
.video-card .info { padding: 10px 2px 0; }
.video-card .info .title { font-size: 14px; font-weight: 600; color: #fff; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 36px; }
.video-card:hover .info .title { color: var(--accent); }
.video-card .info .meta { display: flex; align-items: center; gap: 10px; margin-top: 6px; font-size: 12px; color: var(--text-muted); }
.video-card .info .meta .source { color: var(--accent); font-weight: 600; }

/* ============ CATEGORY CARDS ============ */
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.category-card { position: relative; aspect-ratio: 16/9; border-radius: var(--radius); overflow: hidden; background: var(--bg-card); }
.category-card img { width: 100%; height: 100%; object-fit: cover; opacity: .55; transition: opacity .2s, transform .3s; }
.category-card:hover img { opacity: .35; transform: scale(1.05); }
.category-card .label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 10px; }
.category-card .label h3 { font-size: 16px; font-weight: 700; color: #fff; margin-bottom: 4px; }
.category-card .label .count { font-size: 11px; color: var(--accent); font-weight: 600; letter-spacing: .3px; }

/* ============ VIDEO PAGE ============ */
.video-page { display: grid; grid-template-columns: 1fr 320px; gap: 24px; }
@media (max-width: 1024px) { .video-page { grid-template-columns: 1fr; } }
.player-wrap { position: relative; aspect-ratio: 16/9; background: #000; border-radius: var(--radius); overflow: hidden; }
.player-wrap video { width: 100%; height: 100%; }
.video-info { margin-top: 18px; }
.video-info h1 { font-size: 22px; font-weight: 700; color: #fff; line-height: 1.3; }
.video-meta-row { display: flex; align-items: center; gap: 20px; margin-top: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.video-meta-row .views { color: var(--text-dim); font-size: 13px; }
.video-meta-row .actions { display: flex; gap: 8px; margin-left: auto; }
.action-btn { padding: 8px 14px; background: var(--bg-elev); border: none; border-radius: 20px; color: #fff; font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; transition: all .15s; }
.action-btn:hover { background: var(--accent); color: #000; }
.tag-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.tag-pills a { padding: 5px 11px; background: var(--bg-elev); border-radius: 14px; font-size: 12px; color: var(--text-dim); font-weight: 500; transition: all .15s; }
.tag-pills a:hover { background: var(--accent); color: #000; }
.video-desc { margin-top: 16px; color: var(--text-dim); line-height: 1.6; font-size: 13px; }

/* ============ SIDEBAR ============ */
.sidebar { display: flex; flex-direction: column; gap: 16px; }
.sidebar-ad { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; min-height: 200px; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 12px; }
.sidebar h3 { font-size: 13px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .8px; margin-bottom: 10px; }
.related-video { display: grid; grid-template-columns: 120px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.related-video:last-child { border-bottom: none; }
.related-video .rt { position: relative; aspect-ratio: 16/9; border-radius: 4px; overflow: hidden; background: #000; }
.related-video .rt img { width: 100%; height: 100%; object-fit: cover; }
.related-video .rt .dur { position: absolute; bottom: 4px; right: 4px; background: rgba(0,0,0,.85); color: #fff; padding: 1px 4px; border-radius: 2px; font-size: 10px; font-weight: 600; }
.related-video .rinfo .rtitle { font-size: 12px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.related-video .rinfo .rmeta { margin-top: 4px; font-size: 11px; color: var(--text-muted); }

/* ============ BANNERS ============ */
.banner-slot { margin: 16px 0; min-height: 60px; display: flex; justify-content: center; }
.banner-slot:empty { display: none; }
.banner-slot.banner-grid { margin: 24px 0; }

/* ============ FOOTER ============ */
.site-footer { background: #000; border-top: 1px solid var(--border); margin-top: 60px; padding: 40px 0 24px; }
.footer-inner { max-width: 1600px; margin: 0 auto; padding: 0 16px; }
.footer-top { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 30px; }
@media (max-width: 768px) { .footer-top { grid-template-columns: 1fr 1fr; } }
.footer-col h4 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--accent); margin-bottom: 14px; }
.footer-col a, .footer-col p { display: block; color: var(--text-dim); font-size: 13px; padding: 4px 0; line-height: 1.5; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { padding-top: 20px; border-top: 1px solid var(--border); text-align: center; color: var(--text-muted); font-size: 12px; }
.footer-warning { background: rgba(253,155,0,.08); border: 1px solid rgba(253,155,0,.2); padding: 10px 16px; border-radius: var(--radius); margin-bottom: 20px; color: var(--text-dim); font-size: 12px; line-height: 1.5; }

/* ============ PAGINATION ============ */
.pagination { display: flex; gap: 4px; justify-content: center; margin-top: 32px; flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 0 10px; font-size: 13px; font-weight: 600; color: var(--text-dim); transition: all .15s; }
.pagination a:hover { background: var(--bg-elev); color: var(--accent); border-color: var(--accent); }
.pagination .active { background: var(--accent); color: #000; border-color: var(--accent); }
.pagination .disabled { opacity: .4; pointer-events: none; }

/* ============ EMPTY/ERROR ============ */
.empty-state { padding: 60px 20px; text-align: center; color: var(--text-muted); }
.empty-state h3 { font-size: 18px; color: #fff; margin-bottom: 8px; }

/* ============ RESPONSIVE ============ */
@media (max-width: 640px) {
    .header-inner { gap: 10px; }
    .logo { font-size: 18px; }
    .btn-pill { padding: 6px 10px; font-size: 12px; }
    .video-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px 8px; }
    .video-card .info .title { font-size: 13px; }
    .container { padding: 14px 10px; }
}
