/* ihavenotv.com - dark theme, no framework. */

:root {
    --bg: #121212;
    --surface: #1c1c1c;
    --surface-2: #2a2a2a;
    --border: #3a3a3a;
    --text: #e6e6e6;
    --muted: #9a9a9a;
    --accent: #e64a19;
    --accent-hover: #ff7d47;
    --radius: 8px;
    --header-height: 56px;
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-padding-top: calc(var(--header-height) + 12px); }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main { flex: 1; padding-bottom: 48px; }

a { color: var(--accent-hover); text-decoration: none; }
a:hover { color: #ffa27a; text-decoration: underline; }

img { max-width: 100%; height: auto; }

h1, h2, h3 { line-height: 1.25; margin: 0; font-weight: 600; }
h1 { font-size: 26px; margin: 28px 0 16px; }
h2 { font-size: 20px; }
h1 small, h2 small { color: var(--muted); font-size: 14px; font-weight: 400; margin-left: 8px; }

:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 2px; }

.muted { color: var(--muted); }
.empty { color: var(--muted); padding: 24px 0; }

.skip-link { position: absolute; left: -999px; top: 8px; background: var(--accent); color: #fff; padding: 8px 12px; border-radius: var(--radius); z-index: 100; }
.skip-link:focus { left: 8px; }

.container { width: 100%; max-width: 1680px; margin: 0 auto; padding: 0 20px; }
.container.narrow { max-width: 980px; }

/* ---------- buttons ---------- */

.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px; border-radius: 999px;
    border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
    font: inherit; font-size: 14px; line-height: 1.3; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--accent-hover); color: #fff; text-decoration: none; }
.btn svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.btn[aria-pressed="true"] { border-color: var(--accent); color: var(--accent-hover); }
.btn[aria-pressed="true"] svg { fill: currentColor; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn-accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

/* ---------- header ---------- */

.site-header { position: sticky; top: 0; z-index: 50; background: rgba(30, 30, 30, .96); border-bottom: 1px solid var(--border); backdrop-filter: blur(8px); }
.bar { display: flex; align-items: center; gap: 18px; min-height: var(--header-height); max-width: 1680px; margin: 0 auto; padding: 0 20px; }

.logo { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-weight: 700; font-size: 17px; letter-spacing: .2px; }
.logo:hover { color: #fff; text-decoration: none; }

.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav > a, .menu > summary { color: var(--text); padding: 8px 12px; border-radius: var(--radius); cursor: pointer; white-space: nowrap; }
.site-nav > a:hover, .menu > summary:hover, .menu[open] > summary { background: var(--surface-2); color: #fff; text-decoration: none; }

.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary::after { content: ""; display: inline-block; margin-left: 6px; border: 4px solid transparent; border-top-color: currentColor; transform: translateY(3px); }
.menu ul { position: absolute; top: calc(100% + 6px); left: 0; margin: 0; padding: 8px; list-style: none; min-width: 420px; columns: 2; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(0, 0, 0, .5); }
.menu li { break-inside: avoid; }
.menu li a { display: flex; justify-content: space-between; gap: 16px; padding: 7px 10px; border-radius: 6px; color: var(--text); }
.menu li a:hover { background: var(--surface-2); text-decoration: none; }
.count { color: var(--muted); font-size: 13px; }

.search { position: relative; flex: 1; max-width: 460px; margin-left: auto; }
.search > svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.search input { width: 100%; padding: 8px 12px 8px 36px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit; }
.search input:focus { border-color: var(--accent-hover); outline: none; }
.suggestions { position: absolute; top: calc(100% + 6px); left: 0; right: 0; margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(0, 0, 0, .5); }
.suggestions li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.suggestions img { flex-shrink: 0; width: 64px; height: 36px; object-fit: cover; border-radius: 4px; background: var(--surface-2); }
.suggestion-text { display: flex; flex-direction: column; min-width: 0; }
.suggestion-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggestion-note { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggestion.tag { justify-content: space-between; }
.suggestions li:hover, .suggestions li[aria-selected="true"] { background: var(--surface-2); }

.nav-toggle { display: none; background: none; border: 0; color: var(--text); padding: 6px; cursor: pointer; }
.nav-toggle svg { stroke: currentColor; stroke-width: 2; stroke-linecap: round; fill: none; display: block; }

.support { display: flex; align-items: center; gap: 14px; white-space: nowrap; }
.ads-link { color: var(--text); font-size: 14px; }
.ads-link:hover { color: var(--accent-hover); text-decoration: none; }

/* The uBlock link goes first when space runs out; it is also in the footer. */
@media (max-width: 1400px) {
    .ads-link { display: none; }
}

@media (max-width: 1100px) {
    .support { display: none; }
}

@media (max-width: 860px) {
    .bar { flex-wrap: wrap; gap: 8px 12px; padding: 8px 14px; }
    .nav-toggle { display: block; margin-left: auto; }
    .search { order: 3; flex-basis: 100%; max-width: none; margin: 0; }
    .site-nav { display: none; order: 4; flex-basis: 100%; flex-direction: column; align-items: stretch; padding-bottom: 8px; }
    .site-nav.open { display: flex; }
    .menu ul { position: static; min-width: 0; box-shadow: none; margin-top: 4px; }
}

/* ---------- video grid ---------- */

.tagline { font-size: 22px; margin: 28px 0 4px; }
.tagline small { display: block; margin: 4px 0 0; }

.row-section { margin-top: 32px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.section-head h2 a { color: var(--text); }
.section-head h2 a:hover { color: var(--accent-hover); text-decoration: none; }
.section-head:has(.see-all) { align-items: center; }
.see-all { flex-shrink: 0; border-color: var(--accent); color: var(--accent-hover); font-weight: 600; }
.see-all:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.see-all span { font-size: 17px; line-height: 1; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 24px 18px; counter-reset: episode; }

.card { min-width: 0; counter-increment: episode; }
.thumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s ease; }
.thumb:hover img { transform: scale(1.04); }
.duration { position: absolute; right: 6px; bottom: 6px; padding: 1px 6px; border-radius: 4px; background: rgba(0, 0, 0, .78); color: #fff; font-size: 12px; font-variant-numeric: tabular-nums; }
.numbered .thumb::before { content: counter(episode); position: absolute; left: 6px; top: 6px; z-index: 1; min-width: 24px; padding: 1px 6px; border-radius: 4px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; text-align: center; }

.card h3 { font-size: 15px; margin: 10px 0 4px; }
.card h3 a { color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card h3 a:hover { color: var(--accent-hover); text-decoration: none; }
.synopsis { margin: 0 0 6px; color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { margin: 0; color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 2px 10px; }
.meta strong { color: var(--text); font-weight: 600; }
.card-remove { margin-top: 6px; padding: 3px 10px; font-size: 12px; }

/* ---------- pager ---------- */

.pager { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; margin-top: 36px; }
.pager .gap { color: var(--muted); padding: 0 4px; }

/* ---------- video page ---------- */

.backdrop { position: absolute; inset: 0 0 auto 0; height: 520px; z-index: -1; background-size: cover; background-position: center; filter: blur(40px) brightness(.35); transform: scale(1.2); -webkit-mask-image: linear-gradient(#000 40%, transparent); mask-image: linear-gradient(#000 40%, transparent); pointer-events: none; }
main { position: relative; overflow-x: clip; }

.video { padding-top: 24px; }
.player { aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); overflow: hidden; box-shadow: 0 16px 48px rgba(0, 0, 0, .6); }
.player iframe, .player video, .player embed, .player object, .player img { width: 100% !important; height: 100% !important; border: 0; display: block; object-fit: cover; }

.video-details h1 { margin: 20px 0 6px; }
.video-meta { margin: 0 0 14px; color: var(--muted); display: flex; flex-wrap: wrap; }
.video-meta > * + *::before { content: "·"; margin: 0 8px; color: var(--muted); display: inline-block; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.description { max-width: 78ch; color: #d2d2d2; }
.description p { margin: 0 0 10px; }

.donate { margin-top: 28px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.donate h2 { font-size: 17px; margin-bottom: 6px; }
.donate p { margin: 0 0 10px; color: #c8c8c8; max-width: 78ch; }
.donate-links { display: flex; flex-wrap: wrap; gap: 8px; }
.wallet { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; margin: 4px 0; }
.wallet strong { color: var(--text); margin-right: 4px; }

.series-head { padding: 24px 0 8px; }
.series-head h1 { font-size: 32px; margin-top: 12px; }

.not-found { text-align: center; padding-top: 40px; }
.not-found img { border-radius: var(--radius); }
.not-found .donate-links { justify-content: center; }

/* ---------- A-Z list ---------- */

.az { position: sticky; top: var(--header-height); z-index: 10; display: flex; flex-wrap: wrap; gap: 4px; padding: 10px 0; background: var(--bg); border-bottom: 1px solid var(--border); }
.az a { min-width: 30px; padding: 4px 8px; border-radius: 6px; text-align: center; color: var(--text); background: var(--surface); }
.az a:hover { background: var(--accent); color: #fff; text-decoration: none; }
.letter { scroll-margin-top: calc(var(--header-height) + 60px); }
.letter h2 { margin: 28px 0 10px; color: var(--accent-hover); }
.letter ul { margin: 0; padding: 0; list-style: none; columns: 320px 4; column-gap: 28px; }
.letter li { break-inside: avoid; padding: 3px 0; }
.letter a { color: var(--text); }
.letter a:hover { color: var(--accent-hover); }

/* ---------- forms (admin) ---------- */

.form-page { max-width: 420px; }
.form-page.wide { max-width: 760px; }
.form { display: flex; flex-direction: column; gap: 6px; }
.form label { margin-top: 10px; font-weight: 600; font-size: 14px; }
.form label small, legend small { color: var(--muted); font-weight: 400; }
.form input:not([type="file"]):not([type="hidden"]):not([type="checkbox"]), .form select, .form textarea { width: 100%; padding: 9px 11px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; }
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--accent-hover); outline: none; }
.form textarea { resize: vertical; }
.form fieldset { display: flex; flex-direction: column; gap: 6px; margin: 18px 0 0; padding: 6px 18px 18px; border: 1px solid var(--border); border-radius: var(--radius); min-width: 0; }
.form legend { padding: 0 8px; font-weight: 600; }
.form .inline { display: flex; gap: 8px; }
.form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form .two > div { display: flex; flex-direction: column; gap: 6px; }
.form > .btn { align-self: flex-start; margin-top: 20px; padding: 10px 22px; }
.form .preview { max-width: 320px; border-radius: var(--radius); margin-top: 8px; }
.errors ul { margin: 0 0 8px; padding: 12px 12px 12px 30px; border: 1px solid #a33; border-radius: var(--radius); background: #2a1616; color: #ffb4a8; }
.errors.validation-summary-valid { display: none; }
.notice { margin: 0 0 8px; padding: 12px 14px; border: 1px solid #2e6b3a; border-radius: var(--radius); background: #14261a; }
.field-error { color: #ffb4a8; font-size: 13px; }

/* ---------- sort bar, tags, episode navigation ---------- */

.sort { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -4px 0 18px; }
.sort .btn { padding: 4px 12px; font-size: 13px; }
.btn.current { background: var(--accent); border-color: var(--accent); color: #fff; cursor: default; }

.tags { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 14px 0 0; font-size: 13px; }
.tags a { color: var(--muted); }
.tags a:hover { color: var(--accent-hover); }

.episode-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.btn-quiet { background: none; color: var(--muted); }
.btn-danger { background: #7a1f1f; border-color: #a33; color: #fff; }
.btn-danger:hover { background: #a33; border-color: #c44; }

/* ---------- admin ---------- */

.admin-nav { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-top: 24px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.admin-nav nav { display: flex; flex-wrap: wrap; gap: 6px; }
.admin-search { display: flex; gap: 8px; max-width: 520px; margin-bottom: 16px; }
.admin-search input[type="search"] { flex: 1; padding: 8px 12px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { color: var(--muted); font-weight: 600; white-space: nowrap; }
.table td small { display: block; }
.table tr.is-invalid td { color: var(--muted); }
.table tr.is-invalid td:nth-child(6) { color: #ffb4a8; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; white-space: nowrap; }
.row-actions .btn { padding: 4px 10px; font-size: 13px; }

.form .check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.form .check input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.danger-zone { margin-top: 36px; padding: 16px 18px; border: 1px solid #a33; border-radius: var(--radius); }
.danger-zone p { margin: 0 0 12px; color: #c8c8c8; }

/* ---------- cards: bookmark button and "watched" mark ---------- */

.thumb-wrap { position: relative; }
.card-save { position: absolute; top: 6px; right: 6px; z-index: 2; display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .7); color: #fff; cursor: pointer; opacity: 0; transition: opacity .15s ease; }
.card-save svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.card-save[aria-pressed="true"] { opacity: 1; background: var(--accent); }
.card-save[aria-pressed="true"] svg { fill: currentColor; }
.card:hover .card-save, .card-save:focus-visible { opacity: 1; }
.card-save:hover { background: var(--accent-hover); }
@media (hover: none) { .card-save { opacity: 1; } } /* touch screens have no hover to reveal it */

.watched-badge { position: absolute; left: 6px; bottom: 6px; padding: 1px 6px; border-radius: 4px; background: rgba(0, 0, 0, .78); color: #9fe0a8; font-size: 12px; }
.card.watched .thumb img { opacity: .55; }
.card.watched .thumb:hover img { opacity: 1; }
.series-progress { margin: 0 0 14px; color: #9fe0a8; font-size: 14px; }

/* ---------- list pages: heading row, sort and filters ---------- */

.list-head { align-items: center; flex-wrap: wrap; margin-bottom: 0; }
.list-head h1 { margin-bottom: 14px; }
.list-controls { display: flex; flex-wrap: wrap; gap: 4px 28px; margin-bottom: 18px; }
.list-controls .sort { margin: 0 0 6px; }
.minor-heading { font-size: 16px; margin: 8px 0 12px; }

/* ---------- topics ---------- */

.topic-cloud { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.topic-cloud.sized { gap: 6px 16px; align-items: baseline; line-height: 1.5; }
.topic-cloud.sized a { color: var(--text); }
.topic-cloud.sized a:hover { color: var(--accent-hover); text-decoration: none; }
.size-1 { font-size: 13px; color: var(--muted) !important; }
.size-2 { font-size: 15px; }
.size-3 { font-size: 18px; }
.size-4 { font-size: 22px; font-weight: 600; }
.size-5 { font-size: 27px; font-weight: 700; }

/* ---------- dialog ---------- */

.dialog { max-width: 440px; padding: 22px 24px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); }
.dialog::backdrop { background: rgba(0, 0, 0, .65); }
.dialog p { margin: 0 0 12px; }
.dialog form { display: flex; justify-content: flex-end; margin-top: 16px; }
#report-dialog form { display: block; margin-top: 0; }
.dialog .choice { display: flex; align-items: center; gap: 8px; padding: 5px 0; cursor: pointer; }
.dialog .choice input { accent-color: var(--accent); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* ---------- footer ---------- */

.site-footer { background: var(--surface); border-top: 1px solid var(--border); color: #c8c8c8; font-size: 14px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 28px; max-width: 1680px; margin: 0 auto; padding: 28px 20px; }
.site-footer h2 { font-size: 15px; margin-bottom: 8px; color: var(--text); }
.site-footer p { margin: 0 0 8px; }

@media (prefers-reduced-motion: reduce) {
    .thumb img { transition: none; }
}
