/* 11-modern-web-misc.css — Teil der Aufteilung von style.css (2026-08-10).
   Urspruenglich Zeilen 6096-6538 der einen Datei. Scrollbars, View Transitions, Container Queries, Select-Fixes.
   Diese und alle anderen css/*.css-Dateien werden auf JEDER Seite
   gemeinsam geladen, in fester Reihenfolge - die Kaskade ist exakt
   dieselbe wie vorher, nur auf mehrere Dateien verteilt. */

/* =========================
   Freigabe-Seite (quick-approve.php)
   -------------------------
   Wird ohne Login aus der Admin-Mail heraus aufgerufen. Wie index.html laeuft
   die Seite bewusst im hellen Standard (kein data-theme), damit der Wechsel
   aus der hellen Mail nicht bricht. Farben deshalb aus den Hell-Variablen,
   nicht aus rgb(var(--ink)).
   ========================= */
.qa-page {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 32px 16px;
    background: var(--darker-background);
}

.qa-card {
    width: min(100%, 480px);
    background: var(--background-color);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    border-top: 4px solid var(--tigers-yellow);
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    padding: 32px;
}

.qa-titel {
    font-size: 1.25rem;
    font-weight: 900;
    color: var(--tigers-black);
    text-align: center;
    margin-bottom: 20px;
}

.qa-text {
    font-size: 0.95rem;
    color: var(--text-color);
    text-align: center;
    line-height: 1.7;
    margin-bottom: 12px;
}

.qa-text a { color: var(--primary-blue); }

.qa-icon { font-size: 2.6rem; text-align: center; margin-bottom: 12px; }
.qa-icon.qa-ok i     { color: #2ecc71; }
.qa-icon.qa-fehler i { color: var(--danger-red); }

/* Kopfdaten der Registrierung */
.qa-person {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-table-header);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-small);
    margin-bottom: 20px;
}

.qa-person td {
    padding: 7px 12px;
    font-size: 0.88rem;
    color: var(--text-color);
    vertical-align: top;
}

.qa-person td:first-child { font-weight: 700; width: 116px; color: var(--text-dark); }

/* Rollenauswahl */
.qa-rollen { width: 100%; border-collapse: collapse; margin-bottom: 14px; }

.qa-rollen th {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-placeholder);
    text-align: left;
    padding: 0 8px 6px;
    border-bottom: 1px solid var(--border-light);
}

.qa-rollen th:last-child { text-align: center; }

.qa-rollen td {
    padding: 9px 8px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-color);
}

.qa-rollen tbody tr:last-child td { border-bottom: none; }

.qa-td-check { width: 30px; }
.qa-td-std   { width: 54px; text-align: center; }

.qa-td-name label {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 0.95rem;
    color: var(--text-dark);
    cursor: pointer;
}

.qa-td-name label i { color: var(--tigers-yellow-ink); width: 18px; text-align: center; }

.qa-rollen input[type="checkbox"],
.qa-rollen input[type="radio"] {
    width: 17px;
    height: 17px;
    accent-color: var(--tigers-black);
    cursor: pointer;
}

.qa-hinweis {
    font-size: 0.78rem;
    color: var(--text-placeholder);
    line-height: 1.6;
    margin-bottom: 8px;
}

.qa-hinweis-fehler {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--danger-red);
    background: rgba(211,47,47,0.08);
    border: 1px solid var(--danger-red-tint);
    border-radius: var(--radius-small);
    padding: 9px 12px;
    margin-bottom: 16px;
}

.qa-hinweis-fehler i { color: var(--danger-red); margin-right: 6px; }

.qa-btn {
    width: 100%;
    height: 48px;
    margin-top: 10px;
    background: #111111;
    color: var(--tigers-yellow-text);
    -webkit-text-stroke: 0.4px var(--tigers-yellow-outline);
    text-shadow: 0 0 1px var(--tigers-yellow-outline);
    border: none;
    border-radius: var(--radius-small);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.15s ease, transform 0.12s ease;
}

.qa-btn i { color: var(--tigers-yellow-text); }

.qa-btn:hover { background: #1a1a1a; transform: translateY(-1px); }

/* ---------------------------------------------------------------------
   Honeypot-Feld im Registrierungsformular (2026-08-01)
   ---------------------------------------------------------------------
   Muss fuer Menschen unsichtbar sein, aber fuer Automaten wie ein ganz
   normales Feld aussehen. Deshalb NICHT display:none und NICHT
   visibility:hidden — beides erkennen viele Bots und lassen das Feld
   dann leer. Stattdessen aus dem sichtbaren Bereich schieben.
   Gehoert zu <div class="reg-hp"> in register.html.
   --------------------------------------------------------------------- */
.reg-hp {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ---------------------------------------------------------------------
   Übungsdatenbank: Duplikatsprüfung & Strukturierte Textdarstellung
   --------------------------------------------------------------------- */
.ueb-duplikat-warnung {
    background: rgba(255, 152, 0, 0.12);
    border: 1px solid rgba(255, 152, 0, 0.45);
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 14px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.ueb-duplikat-titel {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    /* War #e65100 fest (3,45:1 im Hellmodus, 2026-08-23 gemessen) mit einer
       Dunkelmodus-Ausnahme darunter. Die Ausnahme hat NIE gegriffen: sie
       fragt [data-theme="dunkel"] ab, header.php setzt aber "dark" - im
       Dunkelmodus stand also ebenfalls das Orange da, nicht das gedachte
       #ffb74d. var(--warn-text) loest beides: hell #8a5a00, dunkel #fbbf24. */
    color: var(--warn-text);
    margin-bottom: 4px;
}
.ueb-duplikat-titel i {
    font-size: 1rem;
    color: #f57c00;
}
.ueb-duplikat-liste {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 8px 0;
}
.ueb-duplikat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    background: var(--karte-bg);
    border: 1px solid var(--karte-border);
    border-radius: 10px;
    padding: 9px 12px;
    box-shadow: 0 2px 8px var(--glass-shadow);
}
.ueb-duplikat-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.ueb-duplikat-item-title {
    font-weight: 700;
    font-size: 0.86rem;
    color: rgb(var(--ink));
}
.ueb-duplikat-item-meta {
    font-size: 0.75rem;
    color: rgba(var(--ink) / 0.72);
}
.ueb-duplikat-item-actions {
    display: flex;
    gap: 6px;
}
.ueb-duplikat-item-actions button {
    padding: 5px 10px;
    font-size: 0.76rem;
}

/* ---- Strukturierte Textabschnitte (Aufbau, Ablauf, Coaching Points, Varianten) ---- */
.ueb-formatted-text {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 6px 0 12px;
}
.ueb-text-section {
    background: var(--glass-12);
    border: 1px solid var(--glass-22);
    border-radius: 12px;
    padding: 12px 15px;
}
.ueb-text-section-title {
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--tigers-yellow-ink);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 7px;
}
.ueb-text-section-title i {
    font-size: 0.85rem;
    color: var(--tigers-yellow-ink);
}
.ueb-text-section-list {
    margin: 0;
    padding-left: 18px;
    color: rgba(var(--ink) / 0.88);
    font-size: 0.88rem;
    line-height: 1.55;
}
.ueb-text-section-list li {
    margin-bottom: 5px;
}

/* === Modern Web Guidance 2026: Scrollbars, View Transitions & Container Queries === */

/* Custom Tigers Theme Scrollbars (Standard) */
html, body, .scroller, .dropdown, div {
    scrollbar-color: var(--tigers-yellow, #fdee17) var(--darker-background, #f0f2f5);
    scrollbar-width: thin;
}

/* Sanfte Seiten-Übergänge */
@view-transition {
    navigation: auto;
}

/* Container Queries für dynamische Bausteine & Kacheln */
.baustein-container, .ueb-container, .content-container, .login-container {
    container-type: inline-size;
}

@container (max-width: 480px) {
    .baustein-karten, .ueb-kachel {
        flex-direction: column;
        padding: 12px;
    }
}

/* === Lesefortschrittsbalken am oberen Bildschirmrand === */
.scroll-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--tigers-yellow, #fdee17);
    transform-origin: 0 50%;
    z-index: 9999;
    pointer-events: none;
}

@supports (animation-timeline: scroll()) {
    .scroll-progress-bar {
        animation: scroll-progress linear;
        animation-timeline: scroll(root);
    }
    @keyframes scroll-progress {
        from { transform: scaleX(0); }
        to { transform: scaleX(1); }
    }
}

/* === Scroll-Driven Animations für Kacheln & Tabellen (Ohne JS) === */
@supports (animation-timeline: view()) {
    .ueb-kachel, .baustein-karten, .card, table tbody tr {
        animation: scroll-reveal linear both;
        animation-timeline: view();
        animation-range: entry 10% cover 30%;
    }
    @keyframes scroll-reveal {
        from {
            opacity: 0.3;
            transform: translateY(16px) scale(0.98);
        }
        to {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }
}

/* === CSS @starting-style: Seidenweiches Ausfaden von Modals === */
dialog, .modern-dialog {
    transition: opacity 0.25s ease-out, transform 0.25s ease-out, display 0.25s allow-discrete, overlay 0.25s allow-discrete;
}
@starting-style {
    dialog[open], .modern-dialog[open] {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
}

/* === Intelligente CSS :has() Selektoren === */
table tbody tr:has(input[type="checkbox"]:checked),
table tbody tr:has(input[type="radio"]:checked) {
    background-color: var(--tigers-yellow-12, rgba(253,238,23,0.12)) !important;
    border-left: 3px solid var(--tigers-yellow, #fdee17);
}

.ueb-text-section-list li:last-child {
    margin-bottom: 0;
}
.ueb-text-section-list strong {
    color: rgb(var(--ink));
    font-weight: 700;
}

/* === Dark Mode Text- & Kontrast-Fix für Formularbeschreibungen, Checkbox-Texte & Hinweise === */
:root[data-theme="dark"] label,
:root[data-theme="dark"] .checkbox-label,
:root[data-theme="dark"] .ad-sec,
:root[data-theme="dark"] .ad-desc,
:root[data-theme="dark"] .ad-lead,
:root[data-theme="dark"] .ad-hinweis,
:root[data-theme="dark"] .ad-card,
:root[data-theme="dark"] .ad-card label,
:root[data-theme="dark"] .ad-card p,
/* span NUR ohne eigene Klasse (2026-08-23). Vorher traf der Selektor jeden
   span in einer .ad-card - auch Komponenten, die ihre Schriftfarbe selbst und
   richtig setzen. Die Initialen-Kreise (.ad-av) etwa haben
   color: var(--tigers-black) auf background: var(--tigers-yellow), also
   14,4:1; diese Regel machte im Dunkelmodus Weiss daraus und damit 2,06:1.
   Dieselbe Sorte Fehler wie im Hellmodus, nur andersherum: eine breite
   Theme-Regel schlaegt die Komponente. Unklassierte spans sind genau der
   Fall, fuer den der Block gedacht war - reiner Fliesstext. */
:root[data-theme="dark"] .ad-card span:not([class]),
:root[data-theme="dark"] .hint,
:root[data-theme="dark"] .help-text,
:root[data-theme="dark"] .form-text,
:root[data-theme="dark"] fieldset legend,
:root[data-theme="dark"] form label,
:root[data-theme="dark"] form p,
:root[data-theme="dark"] form span:not([class]) {
    color: rgba(255, 255, 255, 0.92);
}

:root[data-theme="dark"] .ad-card input[type="text"],
:root[data-theme="dark"] .ad-card select,
:root[data-theme="dark"] .ad-card textarea {
    background-color: rgba(0, 0, 0, 0.4) !important;
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.25) !important;
}

/* Gleicher Fix wie oben, aber fuer Theme "System" bei dunklem Betriebssystem
   (2026-08-10): das Attribut heisst hier "system" statt "dark", der obige
   Selektor griff deshalb nicht - Aktiv-Dropdown & Co. blieben hell/schwarz. */
@media (prefers-color-scheme: dark) {
    :root[data-theme="system"] .ad-card input[type="text"],
    :root[data-theme="system"] .ad-card select,
    :root[data-theme="system"] .ad-card textarea {
        background-color: rgba(0, 0, 0, 0.4) !important;
        color: #ffffff;
        border-color: rgba(255, 255, 255, 0.25) !important;
    }
}

/* === Globaler Fix für ALLE Select- & Dropdown-Felder der gesamten Homepage === */
select,
.content select,
.ad-field select,
.pf-field select,
.hb-card select,
.so-sel,
.ah-in select,
.ad-card select,
.ad-table select {
    max-width: 100% !important;
    box-sizing: border-box !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    padding-right: 32px !important;
}

/* Optionseinträge im ausgeklappten Dropdown-Menü */
select option,
.content select option,
.ad-field select option,
.hb-card select option,
.ad-card select option,
.ad-table select option {
    background-color: var(--darker-background, #111111) !important;
    color: var(--text-color, #ffffff) !important;
    padding: 8px 12px !important;
    max-width: 100% !important;
    white-space: normal !important;
    word-break: break-word !important;
}

/* === Übungsdatenbank: Strukturierte Varianten & Plan-Auswahl (2026-08-12) === */
.ueb-var-edit-liste {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 6px;
    margin-bottom: 6px;
}
.ueb-var-edit-row {
    background: rgba(var(--ink) / 0.05);
    border: 1px solid rgba(var(--ink) / 0.15);
    border-radius: var(--radius-small, 8px);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
}
.ueb-var-edit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.ueb-var-edit-header input[type="text"] {
    flex: 1;
    font-weight: 700;
}
.ueb-var-del-btn {
    background: transparent;
    border: none;
    color: var(--danger-red, #e74c3c);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px;
}
.ueb-var-del-btn:hover {
    opacity: 0.8;
}
.ueb-var-edit-row textarea {
    min-height: 50px;
    resize: vertical;
}

/* Planer: Varianten Checkbox-Liste pro Übungseintrag */
.ueb-plan-var-box {
    margin-top: 8px;
    padding: 8px 10px;
    background: rgba(var(--ink) / 0.05);
    border: 1px solid rgba(var(--ink) / 0.12);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.ueb-plan-var-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--tigers-yellow-ink, #a07b00);
}
.ueb-plan-var-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.86rem;
    cursor: pointer;
    line-height: 1.4;
}
.ueb-plan-var-chk {
    margin-top: 2px;
    accent-color: var(--tigers-yellow, #fdee17);
}

/* Detailansicht Overlay: Varianten & Varianten-Galerie */
.ueb-detail-var-item {
    margin-top: 10px;
    padding: 10px 12px;
    background: rgba(var(--ink) / 0.04);
    border-left: 3px solid var(--tigers-yellow, #fdee17);
    border-radius: 4px;
}
.ueb-detail-var-item h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 0 4px 0;
    color: rgb(var(--ink));
}
.ueb-detail-galerie-var {
    margin-top: 6px;
}

/* === Nur fuer Screenreader (2026-08-23) ===
   Text, der vorgelesen, aber nicht angezeigt wird. Gebraucht fuer
   Spaltenueberschriften ohne sichtbare Beschriftung (die Knopfspalte in
   Fahrtkosten und Stundennachweis) und fuer die Statusmeldung der
   Summenleiste. Bewusst NICHT display:none - das nimmt den Text auch dem
   Screenreader weg. */
.nur-vorlesen {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}
