/* ============================================================================
   Steigerwaldmobile – Gestaltung der selbst gebauten Dropdowns (v8)
   Gehört zu dropdowns.js und wird auf ALLEN Seiten geladen
   (Verwaltung, Editor, Vorschau), weil es mit admin.css UND editor.css
   kombiniert wird. Farb-Variablen kommen aus der jeweils geladenen CSS-Datei.
   ============================================================================ */

/* Der Button ersetzt das native Select optisch. */
.cus-sel {
    position: relative;
    display: inline-flex;
    width: 100%;
    vertical-align: middle;
}
.cus-sel.kompakt { width: auto; }

/* Das originale <select> bleibt im DOM (Formularwerte!), ist aber unsichtbar. */
.cus-quelle {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
    left: 0; top: 0;
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}

.cus-knopf {
    display: inline-flex; align-items: center; gap: 8px;
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--rand, #e4e7f0); border-radius: 10px;
    background: #fff; color: var(--text, #1c2333);
    font: inherit; font-size: 13.5px; line-height: 1.4;
    cursor: pointer; text-align: left;
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
    min-height: 36px;
}
.cus-knopf:hover { border-color: #b7c39f; }
.cus-knopf:focus-visible,
.cus-sel.offen .cus-knopf {
    outline: 2px solid rgba(117, 182, 59, 0.32);
    border-color: var(--gruen, #75b63b);
}
.cus-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cus-chev { display: inline-flex; color: #6b7280; flex: none; transition: transform 0.15s ease; }
.cus-sel.offen .cus-chev { transform: rotate(180deg); }

/* Aufgeklappte Liste: weiße Karte mit Schatten, am VIEWPORT fixiert
   (dropdowns.js setzt left/top inline) – wird damit nirgends abgeschnitten
   (auch nicht in overflow:hidden-Karten) und liegt über fast allem. */
.cus-liste {
    display: none;
    position: fixed;
    left: 0; top: 0;
    min-width: 150px;
    max-height: 268px; overflow-y: auto;
    background: #fff;
    border: 1px solid var(--rand, #e4e7f0);
    border-radius: 12px;
    box-shadow: 0 18px 44px rgba(15, 18, 34, 0.18);
    padding: 6px;
    z-index: 2200;
}
.cus-sel.offen .cus-liste { display: flex; flex-direction: column; gap: 2px; }

.cus-eintrag {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    width: 100%;
    padding: 8px 11px;
    border: 0; border-radius: 8px;
    background: none;
    font: inherit; font-size: 13.5px;
    color: var(--text, #1c2333);
    cursor: pointer; text-align: left;
}
.cus-eintrag:hover { background: #f2f4fb; }
.cus-eintrag.gewaehlt { background: #f1f7e8; color: #3c5c1e; font-weight: 600; }
.cus-eintrag.gesperrt { opacity: 0.45; cursor: not-allowed; }
.cus-eintrag-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cus-haken { display: inline-flex; color: var(--gruen, #75b63b); flex: none; }

/* Kompakte Variante (Kopfzeile des Editors, Struktur-Mini-Auswahl). */
.cus-sel.kompakt .cus-knopf { padding: 6px 10px; font-size: 13px; border-radius: 8px; min-height: 30px; }
.cus-sel.kompakt .cus-eintrag { padding: 7px 10px; font-size: 13px; }

/* ============================================================================
   v27: AKTIONS-DROPDOWNS (siehe dropdowns.js, unterer Block)
   Kleines Menü unter einem Button ("Teilen"/"Bearbeiten" der Übersicht).
   Gilt auf ALLEN Seiten, weil dropdowns.css überall geladen wird.
   ============================================================================ */

.aktion-dropdown {
    position: relative;
    display: inline-flex;
}
.aktion-dropdown .btn .menue-chev {
    display: inline-flex;
    color: currentColor;
    opacity: 0.75;
    transition: transform 0.15s ease;
}
.aktion-dropdown.offen .btn .menue-chev { transform: rotate(180deg); }

.aktion-menue {
    display: none;
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    min-width: 200px;
    background: #fff;
    border: 1px solid var(--rand, #e4e7f0);
    border-radius: 11px;
    box-shadow: 0 18px 44px rgba(15, 18, 34, 0.18);
    padding: 5px;
    z-index: 1500;
}
.aktion-dropdown.offen .aktion-menue { display: flex; flex-direction: column; gap: 2px; }

.menue-eintrag {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 11px;
    border: 0;
    border-radius: 8px;
    background: none;
    font: inherit;
    font-size: 13.5px;
    color: var(--text, #1c2333);
    cursor: pointer;
    text-align: left;
    text-decoration: none;
    white-space: nowrap;
}
.menue-eintrag:hover { background: #f2f4fb; text-decoration: none; }
.menue-eintrag.gefahr { color: var(--rot, #e5484d); }
.menue-eintrag .menue-icon { display: inline-flex; color: #6b7280; flex: none; }
.menue-eintrag.gefahr .menue-icon { color: var(--rot, #e5484d); }

/* ============================================================================
   v27: UPLOAD-FORTSCHRITTSKARTE (siehe dialoge.js, unterer Block)
   Feste Karte unten rechts: Dateiname, Balken, Prozent, Hinweis, Abbrechen.
   Sie liegt ÜBER den Dialogen (z-index 2600 > 2000), weil Uploads oft aus
   einem Modal heraus gestartet werden (Cover, Hintergrund, Mediathek).
   ============================================================================ */

.upload-fortschritt {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 2600;
    width: 320px;
    max-width: calc(100vw - 32px);
    background: #fff;
    border: 1px solid var(--rand, #e4e7f0);
    border-radius: 12px;
    box-shadow: 0 18px 44px rgba(15, 18, 34, 0.22);
    padding: 12px 14px;
    display: none;
    flex-direction: column;
    gap: 8px;
}
.upload-fortschritt.sichtbar { display: flex; }
.upload-kopf { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.upload-titel { font-size: 13.5px; font-weight: 700; color: #1c2333; }
.upload-abbrechen {
    border: 0; background: none;
    font: inherit; font-size: 12.5px;
    color: #6b7280; cursor: pointer;
    text-decoration: underline;
    padding: 0; flex: none;
}
.upload-abbrechen:disabled { opacity: 0.45; cursor: default; }
.upload-datei {
    font-size: 12.5px; color: #46506b;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.upload-balken {
    height: 8px;
    border-radius: 999px;
    background: #edeff6;
    overflow: hidden;
}
.upload-fuellung {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: var(--gruen, #75b63b);
    transition: width 0.15s ease;
}
.upload-zeile {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    color: #6b7280;
}
.upload-hinweis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-fortschritt.fehler .upload-fuellung { background: var(--rot, #e5484d); }
.upload-fortschritt.fehler .upload-titel { color: var(--rot, #e5484d); }
.upload-fortschritt.fehler .upload-hinweis { color: var(--rot, #e5484d); white-space: normal; }
