/*
 * DokuTrip - Design-System. Hell und dunkel ueber Tokens,
 * Akzent passend zum App-Icon (#c4302b) mit warmem Verlauf.
 */

:root {
    --grund: #f5f6f8;
    --glanz: rgba(196, 48, 43, 0.07);
    --karte: #ffffff;
    --feld: #f1f2f5;
    --text: #16181d;
    --text-neben: #6b7280;
    --linie: #e7e8ec;
    --chip: #eef0f3;
    --akzent: #c4302b;
    --akzent-verlauf: linear-gradient(135deg, #d63a2c 0%, #e05a2b 100%);
    --ring: rgba(196, 48, 43, 0.22);
    --hinweis-grund: #edf3fb;
    --fehler-grund: #fbeeee;
    --schatten: 0 1px 2px rgba(20, 24, 33, 0.04), 0 10px 28px -14px rgba(20, 24, 33, 0.12);
    --schatten-akzent: 0 8px 20px -8px rgba(196, 48, 43, 0.55);
}

@media (prefers-color-scheme: dark) {
    :root {
        --grund: #0e1013;
        --glanz: rgba(224, 90, 43, 0.09);
        --karte: #16191e;
        --feld: #1d2127;
        --text: #edeef1;
        --text-neben: #99a1ac;
        --linie: #262b32;
        --chip: #21262d;
        --hinweis-grund: #182335;
        --fehler-grund: #33201f;
        --schatten: 0 1px 2px rgba(0, 0, 0, 0.35), 0 12px 30px -16px rgba(0, 0, 0, 0.6);
        --schatten-akzent: 0 8px 22px -8px rgba(214, 58, 44, 0.45);
    }
}

* { box-sizing: border-box; }

/* Klassen mit display wuerden das hidden-Attribut sonst uebersteuern */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    padding: 0 16px 56px;
    background-color: var(--grund);
    background-image: radial-gradient(900px 340px at 50% -60px, var(--glanz), transparent 70%);
    background-repeat: no-repeat;
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    font-size: 15.5px;
    line-height: 1.55;
}

/* ---------- Kopf ---------- */

header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 44px 0 10px;
    text-align: center;
}
.logo {
    width: 64px;
    height: 64px;
    /* drop-shadow statt box-shadow: die Ecken des Logos sind transparent */
    filter: drop-shadow(0 8px 18px rgba(196, 48, 43, 0.45));
}
#installieren { margin-top: 6px; }
header h1 {
    margin: 2px 0 0;
    font-size: 2.05rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}
.untertitel {
    margin: 0;
    color: var(--text-neben);
    font-size: 1.02rem;
}

main, footer { max-width: 720px; margin: 0 auto; }

/* ---------- Karten ---------- */

.karte {
    background: var(--karte);
    border: 1px solid var(--linie);
    border-radius: 18px;
    padding: 22px;
    margin-top: 18px;
    box-shadow: var(--schatten);
}

h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 8px;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}
h2 small { font-weight: 500; color: var(--text-neben); font-size: 0.85em; }

.schritt {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--akzent-verlauf);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
}

.hilfe { margin: 4px 0 12px; color: var(--text-neben); font-size: 0.9rem; }

/* ---------- Eingaben ---------- */

.zeile { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

input, select {
    font: inherit;
    color: inherit;
    background: var(--feld);
    border: 1.5px solid transparent;
    border-radius: 12px;
    padding: 11px 14px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
input::placeholder { color: var(--text-neben); opacity: 0.75; }
input:focus, select:focus {
    outline: none;
    border-color: var(--akzent);
    background: var(--karte);
    box-shadow: 0 0 0 4px var(--ring);
}
#dauer { flex: 1 1 220px; }
#thema { flex: 1 1 220px; }
#api-key { flex: 1 1 260px; }
#routes-key { flex: 1 1 260px; }

.vorschau {
    color: var(--text-neben);
    min-width: 8em;
    font-variant-numeric: tabular-nums;
}

.route {
    margin-top: 18px;
    border-top: 1px solid var(--linie);
    padding-top: 6px;
}
#route-start, #route-ziel { flex: 1 1 160px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chips button {
    font: inherit;
    font-size: 0.88rem;
    font-weight: 500;
    color: inherit;
    background: var(--chip);
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 7px 15px;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.chips button:hover {
    border-color: var(--linie);
    background: var(--feld);
    transform: translateY(-1px);
}
.chips button:active { transform: translateY(0); }

/* ---------- Knoepfe ---------- */

button.gross {
    display: block;
    width: 100%;
    margin-top: 20px;
    font: inherit;
    font-size: 1.05rem;
    font-weight: 650;
    color: #fff;
    background: var(--akzent-verlauf);
    border: none;
    border-radius: 14px;
    padding: 15px;
    cursor: pointer;
    box-shadow: var(--schatten-akzent);
    transition: transform 0.15s ease, filter 0.15s ease;
}
button.gross:hover { filter: brightness(1.06); transform: translateY(-1px); }
button.gross:active { transform: translateY(0); }
button.gross:disabled { opacity: 0.7; cursor: wait; transform: none; }

.route button, .knopf,
.aktionen button:not(.gross),
.einstellungen-inhalt button {
    display: inline-block;
    font: inherit;
    font-weight: 550;
    color: inherit;
    background: var(--chip);
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 10px 16px;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.route button:hover, .knopf:hover,
.aktionen button:not(.gross):hover,
.einstellungen-inhalt button:hover {
    border-color: var(--linie);
    background: var(--feld);
    transform: translateY(-1px);
}
.route button:disabled { opacity: 0.7; cursor: wait; transform: none; }

:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }

/* ---------- Meldungen ---------- */

#meldung {
    margin: 18px 0 0;
    padding: 13px 16px;
    border-radius: 12px;
    border: 1px solid var(--linie);
}
#meldung.hinweis { background: var(--hinweis-grund); }
#meldung.fehler { background: var(--fehler-grund); }

/* ---------- Ergebnis ---------- */

.fuellbalken {
    height: 6px;
    border-radius: 999px;
    background: var(--chip);
    overflow: hidden;
    margin: 12px 0 14px;
}
#fuellstand {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: var(--akzent-verlauf);
    transition: width 0.5s ease;
}

.aktionen {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin: 4px 0 6px;
}
.aktionen button.gross { width: auto; margin: 0; padding: 11px 20px; font-size: 1rem; }
.aktionen a { color: var(--text-neben); }
.aktionen #navigation-link {
    color: inherit;
    background: var(--chip);
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 10px 16px;
    font-weight: 550;
    text-decoration: none;
    transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.aktionen #navigation-link:hover {
    border-color: var(--linie);
    background: var(--feld);
    transform: translateY(-1px);
}
.aktionen #youtube-link { margin-left: auto; font-size: 0.9rem; }

#playlist { list-style: none; margin: 10px 0 0; padding: 0; }
#playlist li {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 12px 8px;
    margin: 0 -8px;
    border-radius: 14px;
    transition: background 0.15s ease;
}
#playlist li + li { border-top: 1px solid var(--linie); border-radius: 0 0 14px 14px; }
#playlist li:hover { background: var(--feld); }

.thumb { position: relative; flex-shrink: 0; }
.thumb img {
    display: block;
    width: 128px;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 10px;
    background: var(--chip);
}
.thumb .laenge {
    position: absolute;
    right: 5px;
    bottom: 5px;
    background: rgba(0, 0, 0, 0.78);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    padding: 2px 6px;
    border-radius: 6px;
}

.eintrag-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.eintrag-text .titel {
    color: inherit;
    text-decoration: none;
    font-weight: 650;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.eintrag-text .titel:hover { text-decoration: underline; }
.eintrag-text .neben { color: var(--text-neben); font-size: 0.88rem; }

.entfernen {
    margin-left: auto;
    flex-shrink: 0;
    font: inherit;
    color: var(--text-neben);
    background: none;
    border: none;
    border-radius: 10px;
    padding: 8px 11px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.entfernen:hover { background: var(--fehler-grund); color: var(--akzent); }

/* ---------- Player ---------- */

.player-rahmen {
    aspect-ratio: 16 / 9;
    border-radius: 14px;
    overflow: hidden;
    background: #000;
    box-shadow: var(--schatten);
}
.player-rahmen iframe, #player { width: 100%; height: 100%; display: block; border: 0; }
#player-status { margin: 12px 0 0; font-weight: 650; }

/* ---------- Fuss ---------- */

footer { margin-top: 30px; }
details {
    border: 1px solid var(--linie);
    border-radius: 14px;
    background: var(--karte);
    padding: 12px 16px;
}
details summary {
    cursor: pointer;
    color: var(--text-neben);
    font-weight: 550;
    list-style-position: inside;
}
details[open] summary { margin-bottom: 8px; }
.einstellungen-inhalt { margin-top: 4px; }

a { color: var(--akzent); }

@media (max-width: 480px) {
    body { font-size: 15px; }
    header { padding-top: 32px; }
    header h1 { font-size: 1.75rem; }
    .karte { padding: 18px; }
    .thumb img { width: 104px; }
    .aktionen #youtube-link { margin-left: 0; }
}

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