/* =========================================================
   server-messages.css
   Server-Nachrichten vom Backend
   Wichtig: IDs und Klassen wurden nicht umbenannt.
========================================================= */

#serverMessage {
    position: fixed;
    top: 22px;
    left: 50%;
    transform: translate(-50%, -12px);

    z-index: 9999;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    width: fit-content;
    max-width: min(90%, 520px);

    padding: 14px 20px;

    border-radius: 14px;

    font-family: "Nunito", sans-serif;
    font-size: clamp(0.95rem, 2vw, 1.08rem);
    font-weight: 800;
    line-height: 1.4;
    text-align: center;

    opacity: 0;
    pointer-events: none;

    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.18);
    backdrop-filter: blur(10px);
}

/* ---------- Erfolgreiche Nachricht ---------- */
.success {
    color: #14532d;
    background: rgba(220, 252, 231, 0.96);
    border: 1px solid rgba(34, 197, 94, 0.35);
}

/* Häkchen */
.success::before {
    content: "✔";
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 24px;
    height: 24px;

    border-radius: 50%;

    color: white;
    background: #22c55e;

    font-size: 14px;
    font-weight: 900;

    animation: pop 0.28s ease;
    flex-shrink: 0;
}

/* ---------- Fehlermeldung ---------- */
.error {
    color: #7f1d1d;
    background: rgba(254, 226, 226, 0.96);
    border: 1px solid rgba(220, 38, 38, 0.35);
}

/* Fehler Icon */
.error::before {
    content: "!";
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 24px;
    height: 24px;

    border-radius: 50%;

    color: white;
    background: #dc2626;

    font-size: 15px;
    font-weight: 900;

    animation: pop 0.28s ease;
    flex-shrink: 0;
}

/* ---------- Nachricht anzeigen ---------- */
.show {
    animation: fadeIn 0.35s ease forwards;
    pointer-events: auto;
}

/* Optional: Wenn du später eine hide-Klasse per JS nutzt */
.hide {
    animation: fadeOut 0.3s ease forwards;
}

/* ---------- Animationen ---------- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -12px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translate(-50%, 0);
    }

    to {
        opacity: 0;
        transform: translate(-50%, -12px);
    }
}

@keyframes pop {
    from {
        transform: scale(0.4);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* ---------- Handy Optimierung ---------- */
@media (max-width: 600px) {
    #serverMessage {
        top: 14px;
        max-width: calc(100% - 28px);
        padding: 12px 16px;
        border-radius: 12px;
    }
}
