/* ============================================================
   tink Filmdatenbank – Stylesheet
   Konzept: Kinosaal im Dunkeln, Projektorlicht als Akzent,
   Filmstreifen-Perforation als wiederkehrendes Strukturelement.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600&family=Work+Sans:wght@400;500;600&display=swap');

:root {
    /* Vorgegebene Palette - ausschließlich diese Farben werden verwendet
       (Zwischentöne entstehen nur durch Transparenz-Abstufungen davon) */
    --black:     #000000;
    --purple:    #734895;
    --lavender:  #E2D7EE;
    --mint:      #E3EED7;
    --rustred:   #C63D23;
    --offwhite:  #F7FAF3;
    --white:     #FDFEFD;

    --bg:          var(--black);
    --bg-raised:   rgba(115, 72, 149, 0.12);
    --bg-card:     rgba(115, 72, 149, 0.18);
    --line:        rgba(226, 215, 238, 0.22);
    --text:        var(--white);
    --text-dim:    rgba(247, 250, 243, 0.68);
    --accent:      var(--purple);
    --danger:      var(--rustred);
    --focus:       var(--lavender);

    --font-display: 'Fraunces', Georgia, serif;
    --font-body: 'Work Sans', -apple-system, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { color-scheme: dark; font-size: 108%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    line-height: 1.65;
    letter-spacing: .025em;
}

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

h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.15;
    margin: 0 0 .5em;
}
h1 { font-size: 2.1rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1em; }

/* ---------- Perforation (Filmstreifen-Motiv) ---------- */
.perf {
    height: 10px;
    background-image: radial-gradient(circle, var(--bg) 2.5px, transparent 2.6px);
    background-size: 18px 10px;
    background-repeat: repeat-x;
    background-color: var(--purple);
    opacity: .85;
}

/* ---------- Layout ---------- */
.site-header {
    background: var(--bg-raised);
    border-bottom: 1px solid var(--line);
}
.site-header__inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.brand {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--text);
    letter-spacing: .01em;
}
.brand span { color: var(--accent); }

.nav { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; }
.nav a { color: var(--text-dim); font-weight: 500; }
.nav a:hover { color: var(--text); text-decoration: none; }
.nav__user { margin-left: 1.5rem; }
.nav__logout { margin-left: .75rem; }
.btn--logout { background: var(--mint); color: var(--black); }

main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
}

.site-footer {
    text-align: center;
    color: var(--text-dim);
    font-size: .85rem;
    padding: 2rem 1rem 3rem;
}

/* ---------- Buttons & Formulare ---------- */
.btn {
    display: inline-block;
    background: var(--accent);
    color: var(--white);
    font-weight: 600;
    padding: .6em 1.3em;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: .95rem;
    font-family: var(--font-body);
}
.btn:hover { filter: brightness(1.18); text-decoration: none; }
.btn--ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--line);
}
.btn--ghost:hover { border-color: var(--accent); background: transparent; }
.btn--small { padding: .35em .9em; font-size: .85rem; }
.btn--danger { background: var(--danger); color: var(--white); }

form .field { margin-bottom: 1.15rem; }
label {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: .35rem;
    letter-spacing: .01em;
}
input[type=text], input[type=number], input[type=email], input[type=url],
input[type=password], input[type=search], select, textarea {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--line);
    color: var(--text);
    padding: .6em .75em;
    border-radius: 3px;
    font-family: var(--font-body);
    font-size: .95rem;
}
textarea { resize: vertical; min-height: 6em; }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--focus);
    box-shadow: 0 0 0 1px var(--focus);
}
.field-hint { font-size: .85rem; color: var(--text-dim); margin-top: .3rem; }

.pw-strength-meter { display: flex; align-items: center; gap: .6rem; margin-top: .45rem; }
.pw-strength-track { flex: 1; height: 6px; background: var(--bg-raised); border-radius: 3px; overflow: hidden; }
.pw-strength-bar { height: 100%; width: 0; border-radius: 3px; transition: width .2s ease, background-color .2s ease; }
.pw-strength-bar--schwach { background: var(--rustred); }
.pw-strength-bar--mittel { background: var(--purple); }
.pw-strength-bar--stark { background: var(--mint); }
.pw-strength-label { font-size: .82rem; white-space: nowrap; min-width: 4.2em; }
.pw-strength-label--schwach { color: var(--rustred); }
.pw-strength-label--mittel { color: var(--purple); }
.pw-strength-label--stark { color: var(--mint); }
.radio-group, .checkbox-group { display: flex; flex-wrap: wrap; gap: 1rem; }
.radio-group label, .checkbox-group label {
    display: flex; align-items: center; gap: .4rem;
    font-weight: 400; color: var(--text); text-transform: none;
    font-size: .95rem;
}
.radio-group input, .checkbox-group input { width: auto; }

fieldset {
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 1.25rem;
    margin: 0 0 1.5rem;
}

.select-with-add { display: flex; gap: .5rem; align-items: flex-start; }
.select-with-add select { flex: 1; }
.select-with-add .btn { white-space: nowrap; flex-shrink: 0; }
legend {
    font-family: var(--font-display);
    padding: 0 .5rem;
    color: var(--lavender);
    font-size: 1.05rem;
}

/* ---------- Meldungen ---------- */
.alert {
    padding: .85em 1.1em;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    font-size: .92rem;
}
.alert--error { background: rgba(198, 61, 35, 0.16); border: 1px solid var(--danger); color: var(--offwhite); }
.alert--success { background: rgba(227, 238, 215, 0.16); border: 1px solid var(--mint); color: var(--mint); }

/* ---------- Suche ---------- */
.hero-search {
    background: var(--bg-raised);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 2rem;
    margin-bottom: 2.5rem;
}
.hero-search h1 { margin-bottom: .25rem; }
.hero-search__sub { color: var(--text-dim); margin-bottom: 1.5rem; }
.search-row { display: flex; gap: .75rem; }
.search-row input[type=search] { flex: 1; }

details.filters {
    margin-top: 1.25rem;
    border-top: 1px solid var(--line);
    padding-top: 1.25rem;
}
details.filters summary {
    cursor: pointer;
    color: var(--lavender);
    font-weight: 600;
    font-size: .9rem;
    margin-bottom: 1rem;
}
.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

/* ---------- Filmkarten / Ergebnisliste ---------- */
.results-count { color: var(--text-dim); margin-bottom: 1.5rem; font-size: .9rem; }

.film-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}
.film-grid--home { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
    .film-grid--home { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .film-grid--home { grid-template-columns: 1fr; }
}
.film-card {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: 5px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color .15s ease;
}
.film-card:hover { border-color: var(--accent); }
.film-card__poster {
    aspect-ratio: 2 / 3;
    background: var(--bg-raised) center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    font-size: .87rem;
}
.film-card__body { padding: .9rem 1rem 1.1rem; }
.film-card__title {
    font-family: var(--font-display);
    font-size: 1.05rem;
    margin: 0 0 .2rem;
}
.film-card__meta { color: var(--text-dim); font-size: .88rem; }
.film-card a { color: inherit; }
.film-card a:hover { text-decoration: none; }

/* ---------- Filmdetailseite ---------- */
.film-detail {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 2.5rem;
}
.film-detail__poster {
    width: 100%;
    border-radius: 5px;
    border: 1px solid var(--line);
    aspect-ratio: 2/3;
    object-fit: cover;
    background: var(--bg-raised);
}
.film-detail__tags { display: flex; flex-wrap: wrap; gap: .4rem; margin: .75rem 0 1.5rem; }
.tag {
    background: var(--lavender);
    border: 1px solid transparent;
    color: var(--black);
    font-size: .85rem;
    padding: .25em .7em;
    border-radius: 20px;
}
.tag--alt { background: var(--mint); }
.info-table { width: 100%; border-collapse: collapse; margin-bottom: 1.75rem; }
.info-table th, .info-table td {
    text-align: left;
    padding: .5em .75em .5em 0;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
    font-size: .92rem;
}
.info-table th { color: var(--text-dim); font-weight: 500; width: 40%; }
.section-block { margin-bottom: 2rem; }
.content-note {
    background: var(--bg-raised);
    border-left: 3px solid var(--danger);
    padding: .9rem 1.1rem;
    border-radius: 0 4px 4px 0;
    font-size: .92rem;
}

/* ---------- Login ---------- */
.auth-box {
    max-width: 380px;
    margin: 2rem auto;
    background: var(--bg-raised);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 2.25rem;
}
.auth-box h1 { text-align: center; margin-bottom: 1.5rem; }

/* ---------- Tabellen (Admin) ---------- */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td {
    padding: .6em .75em;
    border-bottom: 1px solid var(--line);
    text-align: left;
    font-size: .9rem;
}
.data-table th { color: var(--text-dim); font-weight: 600; }
.actions-cell { display: flex; gap: .5rem; }

.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem; }

.lookup-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; }
.lookup-card { background: var(--bg-card); border: 1px solid var(--line); border-radius: 5px; padding: 1.25rem; }
.lookup-card h3 { margin-bottom: .9rem; }
.lookup-list { list-style: none; margin: 0 0 1rem; padding: 0; }
.lookup-list li {
    display: flex; justify-content: space-between; align-items: center;
    padding: .4em 0; border-bottom: 1px solid var(--line); font-size: .9rem;
}
.inline-form { display: flex; gap: .5rem; }
.inline-form input { flex: 1; }

/* ---------- Empty state ---------- */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-dim);
}

@media (max-width: 700px) {
    .film-detail { grid-template-columns: 1fr; }
    .film-detail__poster { max-width: 220px; }
}
