/*
 * Die Emoji-Auswahl (Issue #393) – Knopf am Textfeld und kleines Fenster.
 * Skript: `emoji-auswahl.js`. Gemeinsam für Hörerfläche, Redaktion und Studio.
 *
 * Die Oberflächen des Guden Drahts sind durchgehend dunkel; das Fenster hängt
 * aber am `<body>` und erbt deshalb keine ihrer Variablen. Es trägt seine
 * Farben selbst und bleibt in Hell- wie Dunkelmodus des Geräts lesbar.
 */
.emo-knopf {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    color: #f5f5f7;
    cursor: pointer;
}

.emo-knopf svg { width: 22px; height: 22px; fill: currentColor; }
.emo-knopf:hover { background: rgba(255, 255, 255, 0.12); }
.emo-knopf[aria-expanded="true"] { background: rgba(255, 255, 255, 0.18); }
.emo-knopf:focus-visible,
.emo-zu:focus-visible,
.emo-kat:focus-visible,
.emo-e:focus-visible,
.emo-suche:focus-visible { outline: 2px solid #ff3b30; outline-offset: 1px; }

/* Unter dem Vorschlag der GUDE KI steht das Feld allein in einer Spalte; der
   Knopf sitzt dort links darunter und nicht als Streifen. */
.chatk-vorschlag .emo-knopf { margin-top: 6px; }

.emo-fenster {
    position: fixed;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-sizing: border-box;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 14px;
    background: #1e1e25;
    color: #f5f5f7;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
    overscroll-behavior: contain;
}

.emo-fenster[hidden] { display: none; }

.emo-kopf { display: flex; align-items: center; gap: 6px; }

.emo-suche {
    flex: 1 1 auto;
    min-width: 0;
    box-sizing: border-box;
    min-height: 40px;
    padding: 6px 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.07);
    color: inherit;
    font: inherit;
    font-size: 16px; /* kein Zoom beim Antippen auf iOS */
}

.emo-zu {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

.emo-zu svg { width: 20px; height: 20px; fill: currentColor; }
.emo-zu:hover { background: rgba(255, 255, 255, 0.1); }

.emo-kategorien { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.emo-kategorien::-webkit-scrollbar { display: none; }

.emo-kat {
    flex: 1 0 auto;
    min-width: 40px;
    height: 40px;
    padding: 0 4px;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 8px 8px 0 0;
    background: transparent;
    color: inherit;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.emo-kat.is-an { border-bottom-color: #ff3b30; background: rgba(255, 255, 255, 0.08); }

.emo-titel {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(245, 245, 247, 0.62);
}

.emo-gitter {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 2px;
    flex: 1 1 auto;
    min-height: 80px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.emo-e {
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.emo-e:hover { background: rgba(255, 255, 255, 0.12); }

.emo-status {
    margin: 0;
    min-height: 1.1em;
    font-size: 0.75rem;
    color: rgba(245, 245, 247, 0.62);
}

.emo-status:empty { display: none; }
.emo-status.is-warnung { color: #ffb4ae; }

@media (prefers-reduced-motion: no-preference) {
    .emo-fenster:not([hidden]) { animation: emo-ein 0.12s ease-out; }
}

@keyframes emo-ein {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: none; }
}
