/* ---------- Farben ---------- */
:root {
    color-scheme: light;

    /* Allgemein */
    --bg: #f6f6f9;
    --ink: #17171c;
    --muted: #70707c;
    --line: #e4e4ea;
    --soft: #f0f0f5;
    --white: #fff;
    --error: #d92d20;
    --star: #e69500;

    /* Zusatzfarben (werden im Dark Mode ersetzt) */
    --ink-hover: #2e2e38;      /* Hover auf dunklen Buttons */
    --line-hover: #c9c9d2;     /* Hover-Rahmen */
    --glass: rgba(255, 255, 255, .6);
    --glass-strong: rgba(255, 255, 255, .92);
    --error-soft: #fde7e4;

    /* Medien-Kategorien */
    --film: #ff6b6b;
    --serie: #e69500;
    --buch: #1fa35d;
    --musik: #4f8cff;
    --spiel: #a970ff;
}

/* ---------- Dark Mode ----------
   Wird über <html data-theme="dark"> aktiviert (Umschalter in der Navbar, gespeichert im Browser).
   --white ist die Fläche (Karten, Felder), --ink die Schrift. */
html[data-theme="dark"] {
    color-scheme: dark;

    --bg: #0f1115;          /* Seitenhintergrund */
    --white: #181b22;       /* Karten, Felder, Pop-ups */
    --soft: #20242d;        /* leichte Flächen (Tabs, Hover) */
    --line: #2b303b;        /* Rahmen */
    --ink: #e7e9ee;         /* Schrift */
    --muted: #9ba2b0;       /* Nebentext */
    --error: #f2726a;
    --star: #f5b335;

    --ink-hover: #ffffff;
    --line-hover: #3c4250;
    --glass: rgba(24, 27, 34, .6);
    --glass-strong: rgba(24, 27, 34, .92);
    --error-soft: rgba(242, 114, 106, .14);

    /* Entdecken */
    --discovery-text: #e7e9ee;
    --discovery-muted: #9ba2b0;
    --discovery-border: #2b303b;
    --discovery-soft: #20242d;
    --discovery-surface: #181b22;

    /* Navbar */
    --nav-bg: rgba(15, 17, 21, .85);
    --nav-text: #e7e9ee;
    --nav-muted: #9ba2b0;
    --nav-hover: #20242d;
    --nav-border: #2b303b;
}

/* Hintergrund: die farbigen Ecken nur ganz leicht */
html[data-theme="dark"] body {
    background-image:
        radial-gradient(560px circle at 0 0, rgba(255, 107, 107, .05), transparent 60%),
        radial-gradient(560px circle at 100% 0, rgba(79, 140, 255, .06), transparent 60%),
        radial-gradient(560px circle at 0 100%, rgba(47, 191, 113, .04), transparent 60%),
        radial-gradient(560px circle at 100% 100%, rgba(169, 112, 255, .06), transparent 60%);
}

/* Kategorie-Flächen (Platzhalter-Poster, Chips) etwas klarer statt trüb */
html[data-theme="dark"] .film  { --cs: rgba(255, 107, 107, .16); }
html[data-theme="dark"] .serie { --cs: rgba(255, 176, 32, .15); }
html[data-theme="dark"] .buch  { --cs: rgba(47, 191, 113, .15); }
html[data-theme="dark"] .musik { --cs: rgba(79, 140, 255, .17); }
html[data-theme="dark"] .spiel { --cs: rgba(169, 112, 255, .17); }

/* Schatten im Dunkeln weicher */
html[data-theme="dark"] .settings-panel,
html[data-theme="dark"] .sidebar { box-shadow: 0 16px 40px rgba(0, 0, 0, .5); }

html[data-theme="dark"] img.logo-light { display: none; }
html:not([data-theme="dark"]) img.logo-dark { display: none; }

/* Sanfter Wechsel zwischen hell und dunkel */
html.theme-anim,
html.theme-anim * {
    transition: background-color .25s, border-color .25s, color .25s !important;
}

/* ---------- Reset ---------- */
* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

[hidden] {
    display: none !important;
}

/* Icons (SVG) sollen überall gleich aussehen */
svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.i {
    width: 1.1em;
    height: 1.1em;
    vertical-align: -.17em;
}

/* ---------- Grundlayout ---------- */
body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;   /* Footer bleibt unten */
    background-color: var(--bg);
    background-image:
        radial-gradient(560px circle at 0 0, rgba(255, 107, 107, .12), transparent 60%),
        radial-gradient(560px circle at 100% 0, rgba(79, 140, 255, .12), transparent 60%),
        radial-gradient(560px circle at 0 100%, rgba(47, 191, 113, .1), transparent 60%),
        radial-gradient(560px circle at 100% 100%, rgba(169, 112, 255, .12), transparent 60%);
    background-attachment: fixed;
    background-repeat: no-repeat;
    color: var(--ink);
    font: 400 1rem/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* Seitenbreite: Inhalt immer in .wrap, wie in der Vorlage */
main {
    flex: 1 0 auto;
    padding: 28px 0 64px;
}

.wrap {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------- Text ---------- */
h1,
h2,
h3 {
    margin: 0;
    letter-spacing: -.02em;
    line-height: 1.15;
}

h1 {
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    font-weight: 700;
}

h2 {
    font-size: 1.3rem;
    font-weight: 700;
}

/* ---------- Bedienelemente ---------- */
button {
    font: inherit;
    color: inherit;
    cursor: pointer;
}

:focus-visible {
    outline: 3px solid rgba(79, 140, 255, .55);
    outline-offset: 2px;
}

/* ---------- Kategorie-Farben (--c = Farbe, --cs = helle Fläche) ---------- */
.film  { --c: var(--film);  --cs: rgba(255, 107, 107, .13); }
.serie { --c: var(--serie); --cs: rgba(255, 176, 32, .17); }
.buch  { --c: var(--buch);  --cs: rgba(47, 191, 113, .14); }
.musik { --c: var(--musik); --cs: rgba(79, 140, 255, .14); }
.spiel { --c: var(--spiel); --cs: rgba(169, 112, 255, .15); }

/* ---------- Poster und Platzhalter-Cover (immer 2:3) ---------- */
.poster {
    transition: transform .15s;
}

.poster img {
    display: block;
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 14px;
}

.ph {
    aspect-ratio: 2 / 3;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 14px;
    overflow: hidden;
    color: var(--c);
    background: var(--cs);
    border: 1px solid var(--line);
    border-radius: 14px;
}

.ph .i {
    width: 28px;
    height: 28px;
}

.ph b {
    color: var(--ink);
    font-size: .98rem;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

/* ---------- Sterne ---------- */
.stars {
    color: var(--star);
    letter-spacing: 1px;
    white-space: nowrap;
}

/* ---------- Medien-Icons ----------*/
.icon {
    display: inline-block;
    width: 1.2em;
    height: 1.2em;
    vertical-align: -.2em;
    background-color: currentColor;
    -webkit-mask: var(--icon) center / contain no-repeat;
            mask: var(--icon) center / contain no-repeat;
}

.chip .icon { color: inherit; }

/* ---------- Suchfeld mit Lupe (Font Awesome) ---------- */
.search-ico {
    position: relative;
    display: block;
}

.search-ico > .fa-magnifying-glass {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: .95rem;
    pointer-events: none;
    z-index: 1;
}

.search-ico > input {
    padding-left: 2.6rem !important;
    margin-bottom: 0 !important;
}

.search-ico.mb { margin-bottom: 8px; }

/* Sterne (Font Awesome) */
.stars i { font-size: .85em; }

/* Dark Mode: gewählter Tab soll sich vom Hintergrund abheben */
html[data-theme="dark"] .tabs button[aria-selected="true"],
html[data-theme="dark"] .admin-tabs a[aria-current="page"] {
    background: #2b303b;
}
