/* ===== Rueckmeldungen: Einblendungen und Dialoge ========================
   Gehoert zu js/hinweise.js. Ersetzt die 323 alert() und 60 confirm(),
   also die grauen Browserkaesten, und die sieben einzeln hineinkopierten
   showToast-Fassungen mit ihren drei verschiedenen Aussehen.            */

#hinweis-behaelter {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: min(420px, calc(100vw - 32px));
}

.hinweis {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 13px 14px 13px 16px;
    border-radius: 12px;
    background: var(--card-2, #181b26);
    border: 1px solid var(--line-2, rgba(255, 255, 255, .12));
    border-left-width: 3px;
    color: var(--text-main, #eef0f7);
    font-size: .9rem;
    line-height: 1.45;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
    animation: hinweis-rein .24s cubic-bezier(.16, 1, .3, 1);
}

.hinweis-icon { margin-top: 1px; font-size: .95rem; flex: 0 0 auto; }
.hinweis-text { flex: 1 1 auto; word-break: break-word; }

.hinweis-zu {
    flex: 0 0 auto;
    background: none;
    border: none;
    color: var(--text-faint, #5b6178);
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
    transition: color .15s;
}
.hinweis-zu:hover { color: var(--text-main, #eef0f7); }

.hinweis-success { border-left-color: var(--success, #22c55e); }
.hinweis-success .hinweis-icon { color: var(--success, #22c55e); }
.hinweis-error   { border-left-color: var(--danger, #ef4444); }
.hinweis-error   .hinweis-icon { color: var(--danger, #ef4444); }
.hinweis-warn    { border-left-color: var(--warning, #f59e0b); }
.hinweis-warn    .hinweis-icon { color: var(--warning, #f59e0b); }
.hinweis-info    { border-left-color: var(--primary, #6366f1); }
.hinweis-info    .hinweis-icon { color: var(--primary-2, #818cf8); }

@keyframes hinweis-rein {
    from { opacity: 0; transform: translateY(14px) scale(.97); }
    to   { opacity: 1; transform: none; }
}
.hinweis-raus {
    opacity: 0;
    transform: translateX(20px);
    transition: opacity .2s, transform .2s;
}

/* --- Rueckfrage und Eingabe ------------------------------------------- */

.dialog-hintergrund {
    position: fixed;
    inset: 0;
    z-index: 10001;
    background: rgba(4, 5, 9, .72);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: dialog-rein .16s ease;
}
.dialog-hintergrund.dialog-raus { opacity: 0; transition: opacity .18s; }

.dialog {
    width: min(440px, 100%);
    background: var(--card-bg, #14161f);
    border: 1px solid var(--line-2, rgba(255, 255, 255, .12));
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .6);
    animation: dialog-hoch .2s cubic-bezier(.16, 1, .3, 1);
}

.dialog-titel {
    margin: 0 0 8px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main, #eef0f7);
}
.dialog-text {
    margin: 0 0 20px;
    font-size: .92rem;
    line-height: 1.55;
    color: var(--text-dim, #8b91a6);
    white-space: pre-wrap;
}

.dialog-feld {
    width: 100%;
    box-sizing: border-box;
    margin: -8px 0 20px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--input-bg, #0a0c12);
    border: 1px solid var(--line-2, rgba(255, 255, 255, .12));
    color: var(--text-main, #eef0f7);
    font-size: .92rem;
    font-family: inherit;
}
.dialog-feld:focus {
    outline: none;
    border-color: var(--primary, #6366f1);
    box-shadow: 0 0 0 3px var(--primary-glow, rgba(99, 102, 241, .14));
}

.dialog-knoepfe { display: flex; gap: 10px; justify-content: flex-end; }

.dialog-knoepfe button {
    padding: 9px 18px;
    border-radius: 10px;
    font-size: .88rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: 1px solid transparent;
    transition: filter .15s, transform .15s;
}
.dialog-knoepfe button:hover { filter: brightness(1.12); }
.dialog-knoepfe button:active { transform: translateY(1px); }
.dialog-knoepfe button:focus-visible {
    outline: 2px solid var(--primary-2, #818cf8);
    outline-offset: 2px;
}

.dialog-nein {
    background: transparent;
    border-color: var(--line-2, rgba(255, 255, 255, .12));
    color: var(--text-dim, #8b91a6);
}
.dialog-ja {
    background: var(--primary, #6366f1);
    color: #fff;
}
.dialog-ja.dialog-gefahr { background: var(--danger, #ef4444); }

@keyframes dialog-rein { from { opacity: 0; } to { opacity: 1; } }
@keyframes dialog-hoch {
    from { opacity: 0; transform: translateY(12px) scale(.97); }
    to   { opacity: 1; transform: none; }
}

/* Wer Bewegungen abgestellt hat, bekommt keine. */
@media (prefers-reduced-motion: reduce) {
    .hinweis, .dialog, .dialog-hintergrund { animation: none; }
    .hinweis-raus, .dialog-hintergrund.dialog-raus { transition: none; }
}

@media (max-width: 640px) {
    #hinweis-behaelter { left: 16px; right: 16px; bottom: 16px; max-width: none; }
}
