/* --------------------------------------------- */
/* DFlow - Einheitliches App-Modal                */
/* (ersetzt native alert()/confirm() Dialoge)     */
/* --------------------------------------------- */

.app-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 25, 0.6);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

.app-modal-overlay.is-open {
    display: flex;
}

.app-modal {
    width: 100%;
    max-width: 420px;
    max-height: 85vh;
    background: linear-gradient(160deg, rgba(40, 53, 147, 0.98), rgba(26, 35, 126, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
    padding: 1.75rem;
    color: #fff;
    text-align: center;
    font-family: 'Nunito', 'Montserrat', sans-serif;
    display: flex;
    flex-direction: column;
}

.app-modal__icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: linear-gradient(135deg, #5c6bc0, #3949ab);
    border-radius: 16px;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
}

.app-modal--danger .app-modal__icon {
    background: linear-gradient(135deg, #ef5350, #c62828);
}

.app-modal__title {
    font-size: 1.1rem;
    font-weight: 800;
    margin: 0 0 0.5rem;
}

/* Icon/Titel oben und Buttons unten bleiben fix sichtbar, nur der Text
   dazwischen scrollt - wichtig bei langen Listen (Info-Broadcast), damit auf
   dem Handy nichts oben/unten abgeschnitten wird. */
.app-modal__message {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
    margin: 0 0 1.5rem;
    white-space: pre-line;
    text-align: left;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
}

/* Formatierter Inhalt (z.B. Info-Broadcast mit Stichpunkten) - siehe
   broadcastCheck.js formatBroadcastText(). */
.app-modal__message p {
    margin: 0 0 0.75rem;
}

.app-modal__message ul {
    margin: 0 0 0.75rem;
    padding-left: 1.2rem;
}

.app-modal__message li {
    margin-bottom: 0.3rem;
}

.app-modal__message p:last-child,
.app-modal__message ul:last-child {
    margin-bottom: 0;
}

.app-modal__message strong {
    color: #fff;
}

/* Runder Lade-Spinner (z.B. beim App-Update-Modal) */
.app-modal__spinner {
    width: 32px;
    height: 32px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    animation: app-modal-spin 0.8s linear infinite;
}

@keyframes app-modal-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.app-modal__actions {
    display: flex;
    gap: 0.6rem;
}

.app-modal__btn {
    flex: 1;
    border: none;
    border-radius: 12px;
    padding: 0.7rem 1rem;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.app-modal__btn:active {
    transform: scale(0.97);
}

.app-modal__btn--cancel {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.app-modal__btn--cancel:hover {
    background: rgba(255, 255, 255, 0.18);
}

.app-modal__btn--confirm {
    background: linear-gradient(135deg, #5c6bc0, #3949ab);
    color: #fff;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
}

.app-modal__btn--confirm:hover {
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.4);
}

.app-modal--danger .app-modal__btn--confirm {
    background: linear-gradient(135deg, #ef5350, #c62828);
}
