/* MovieFinder — After Dark.
   Tokens mirror DESIGN.md (the source of truth); keep both in sync. */

:root {
    --ground: #0E0C10;
    --raised: #16131B;
    --panel: #1C1822;
    --panel-2: #221D2A;
    --row: #14111A;
    --line: rgba(242, 238, 233, 0.08);

    --text: #F2EEE9;
    --text-soft: #D8CFC6;
    --text-muted: #A79FA6;
    --text-faint: #6E6670;

    --gold: #E3A94E;
    --gold-deep: #B87F2E;
    --gold-dim: #8A6B3A;
    --red: #D4574D;
    --on-gold: #14100A;

    --r-card: 10px;
    --r-hero: 14px;
    --r-control: 9px;

    --display: 'Bebas Neue', 'Arial Narrow', sans-serif;
    --body: 'Archivo', 'Helvetica Neue', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100vh;
    background: var(--ground);
    color: var(--text);
    font-family: var(--body);
    font-size: 15px;
    line-height: 1.5;
}

/* The browser surfaces carry the design too. */
::selection { background: rgba(227, 169, 78, 0.35); color: var(--text); }
input, textarea { caret-color: var(--gold); }
* { scrollbar-width: thin; scrollbar-color: var(--panel-2) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--panel-2); border-radius: 5px; }
::-webkit-scrollbar-track { background: transparent; }

:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
    border-radius: 4px;
}

/* The router focuses the page heading on navigation — that focus is
   programmatic, never keyboard intent; no ring. */
h1:focus, h1:focus-visible { outline: none; }
h1 { scroll-margin-top: 84px; }

input[type="file"] { color: var(--text-muted); font-size: 13px; }

input[type="file"]::file-selector-button {
    height: 40px;
    padding: 0 16px;
    margin-right: 12px;
    border-radius: var(--r-control);
    border: 1.5px solid rgba(242, 238, 233, 0.18);
    background: none;
    color: var(--text-soft);
    font-family: var(--body);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

input[type="file"]::file-selector-button:hover { border-color: rgba(242, 238, 233, 0.35); }

a { color: var(--gold); text-decoration: none; }
a:hover { color: #F2C77E; }

h1, h2, h3 { margin: 0; }

button {
    font-family: var(--body);
    font-size: 14.5px;
    color: var(--text);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

button:disabled { opacity: 0.45; cursor: default; }

.display {
    font-family: var(--display);
    letter-spacing: 3px;
    text-transform: uppercase;
    line-height: 1;
    text-wrap: balance;
}

.tabular { font-variant-numeric: tabular-nums; }

/* ---- boot splash (pre-Blazor) ---- */
.boot {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
}

.boot-mark {
    font-family: var(--display);
    font-size: 30px;
    letter-spacing: 6px;
    color: var(--gold);
}

.boot-line {
    width: 160px;
    height: 2px;
    background: var(--line);
    overflow: hidden;
    border-radius: 1px;
}

.boot-line span {
    display: block;
    width: 40%;
    height: 100%;
    background: var(--gold);
    animation: boot-sweep 1.1s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

@keyframes boot-sweep {
    from { transform: translateX(-100%); }
    to { transform: translateX(400%); }
}

#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 12px 40px;
    background: var(--panel-2);
    border-top: 1px solid var(--line);
    color: var(--text-soft);
    font-size: 13.5px;
}

#blazor-error-ui .reload { margin-left: 10px; }
#blazor-error-ui .dismiss { float: right; cursor: pointer; color: var(--text-faint); }

/* ---- shared controls ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    height: 48px;
    padding: 0 20px;
    border-radius: var(--r-control);
    font-size: 14.5px;
    font-weight: 600;
    transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:not(:disabled):active { transform: scale(0.97); }

.btn-gold {
    background: linear-gradient(160deg, var(--gold), #C98F35);
    color: var(--on-gold);
    font-weight: 700;
    box-shadow: 0 10px 26px rgba(227, 169, 78, 0.25);
}

.btn-gold:not(:disabled):hover { box-shadow: 0 12px 30px rgba(227, 169, 78, 0.38); }

.btn-outline-gold {
    border: 1.5px solid rgba(227, 169, 78, 0.5);
    color: var(--gold);
}

.btn-outline-gold:not(:disabled):hover { background: rgba(227, 169, 78, 0.1); }

.btn-ghost {
    border: 1.5px solid rgba(242, 238, 233, 0.18);
    color: var(--text-muted);
    font-weight: 500;
}

.btn-ghost:not(:disabled):hover { border-color: rgba(242, 238, 233, 0.35); color: var(--text-soft); }

.btn-dim {
    border: 1.5px solid rgba(242, 238, 233, 0.12);
    color: var(--text-faint);
    font-weight: 500;
}

.btn-dim:not(:disabled):hover { color: var(--text-muted); }

.pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.pill-gold {
    background: rgba(227, 169, 78, 0.14);
    border: 1px solid rgba(227, 169, 78, 0.4);
    color: var(--gold);
}

.tag {
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(242, 238, 233, 0.06);
    font-size: 11.5px;
    color: var(--text-muted);
}

.select-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 14px;
    border-radius: var(--r-control);
    border: 1px solid rgba(242, 238, 233, 0.14);
    background: none;
    font-size: 13px;
    color: var(--text-soft);
}

.select-chip:hover { border-color: rgba(242, 238, 233, 0.3); }

.input {
    height: 44px;
    padding: 0 16px;
    border-radius: var(--r-control);
    background: var(--raised);
    border: 1.5px solid var(--line);
    color: var(--text);
    font-family: var(--body);
    font-size: 14px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input::placeholder { color: var(--text-faint); }

.input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(227, 169, 78, 0.12);
}

/* ---- poster fallback art ----
   Gradient placeholder until TMDB art loads (and the demo catalogue's look). */
.poster {
    position: relative;
    aspect-ratio: 2 / 3;
    border-radius: var(--r-card);
    overflow: hidden;
    background: var(--panel);
    box-shadow: inset 0 0 0 1px var(--line);
}

.poster img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.poster-title {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 14px 10px;
    text-align: center;
    font-family: var(--display);
    letter-spacing: 2px;
    text-transform: uppercase;
    background: linear-gradient(180deg, transparent, rgba(7, 6, 9, 0.85));
}

/* ---- page scaffolding ---- */
.page {
    padding: 34px 56px 60px;
    max-width: 1440px;
    margin: 0 auto;
}

.page-title { font-size: 44px; }

.page-sub { font-size: 13.5px; color: var(--text-muted); margin-top: 6px; }

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 90px 20px;
    text-align: center;
    color: var(--text-muted);
}

.empty-state .display { font-size: 30px; color: var(--text-soft); }

.error-note {
    padding: 14px 18px;
    border-radius: var(--r-control);
    background: rgba(212, 87, 77, 0.08);
    border: 1px solid rgba(212, 87, 77, 0.3);
    color: var(--text-soft);
    font-size: 13.5px;
}

.skeleton {
    background: linear-gradient(100deg, var(--raised) 40%, var(--panel-2) 50%, var(--raised) 60%);
    background-size: 200% 100%;
    animation: shimmer 1.4s ease infinite;
    border-radius: var(--r-card);
}

@keyframes shimmer {
    from { background-position: 130% 0; }
    to { background-position: -30% 0; }
}

@media (max-width: 900px) {
    .page { padding: 22px 18px 48px; }
    .page-title { font-size: 34px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
