/* ============================================
   TOAST NOTIFICATION SYSTEM – stresstherapie.de
   Corporate Design: Blues (#007bff, #000066),
   Purples (#a39bc6, #7b7bad), Clean whites
   ============================================ */

/* ── Container – centered top ────────────────── */
#st-toast-container {
    position: fixed;
    top: 28px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    pointer-events: none;
    max-width: 520px;
    width: calc(100% - 32px);
}

/* ── Single Toast ────────────────────────────── */
.st-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    width: 100%;
    padding: 18px 22px;
    border-radius: 16px;
    background: #ffffff;
    box-shadow:
        0 12px 48px rgba(0, 0, 0, 0.16),
        0 4px 12px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(0, 0, 0, 0.04);
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #333;
    opacity: 0;
    transform: translateY(-24px) scale(0.95);
    animation: stToastIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    position: relative;
    overflow: hidden;
}

.st-toast.st-toast-out {
    animation: stToastOut 0.32s cubic-bezier(0.55, 0, 1, 0.45) forwards;
}

/* ── Type Variants ───────────────────────────── */
.st-toast.st-toast-success {
    border-left: 5px solid #28a745;
    background: linear-gradient(135deg, #ffffff 0%, #f0faf3 100%);
}

.st-toast.st-toast-error {
    border-left: 5px solid #dc3545;
    background: linear-gradient(135deg, #ffffff 0%, #fef0f0 100%);
}

.st-toast.st-toast-info {
    border-left: 5px solid #007bff;
    background: linear-gradient(135deg, #ffffff 0%, #f0f6ff 100%);
}

.st-toast.st-toast-warning {
    border-left: 5px solid #ffc107;
    background: linear-gradient(135deg, #ffffff 0%, #fffcf0 100%);
}

/* ── Icon ────────────────────────────────────── */
.st-toast-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #fff;
    margin-top: 1px;
}

.st-toast-success .st-toast-icon {
    background: linear-gradient(135deg, #28a745, #20c43d);
    box-shadow: 0 4px 14px rgba(40, 167, 69, 0.35);
}

.st-toast-error .st-toast-icon {
    background: linear-gradient(135deg, #dc3545, #e8485a);
    box-shadow: 0 4px 14px rgba(220, 53, 69, 0.35);
}

.st-toast-info .st-toast-icon {
    background: linear-gradient(135deg, #007bff, #3399ff);
    box-shadow: 0 4px 14px rgba(0, 123, 255, 0.35);
}

.st-toast-warning .st-toast-icon {
    background: linear-gradient(135deg, #e6ac00, #ffca28);
    box-shadow: 0 4px 14px rgba(255, 193, 7, 0.35);
}

/* ── Body ────────────────────────────────────── */
.st-toast-body {
    flex: 1;
    min-width: 0;
}

.st-toast-title {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 2px;
    letter-spacing: -0.2px;
}

.st-toast-success .st-toast-title { color: #1a7a32; }
.st-toast-error   .st-toast-title { color: #b02a37; }
.st-toast-info    .st-toast-title { color: #0056b3; }
.st-toast-warning .st-toast-title { color: #8a6d00; }

.st-toast-text {
    font-size: 0.9rem;
    color: #555;
    word-break: break-word;
}

/* ── Close Button ────────────────────────────── */
.st-toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    font-size: 1.35rem;
    color: #bbb;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    transition: color 0.2s, transform 0.2s;
    margin-top: 1px;
}

.st-toast-close:hover {
    color: #555;
    transform: scale(1.2);
}

/* ── Progress Bar ────────────────────────────── */
.st-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    border-radius: 0 0 0 16px;
    animation: stToastProgress linear forwards;
}

.st-toast-success .st-toast-progress { background: linear-gradient(90deg, #28a745, #6fdc8c); }
.st-toast-error   .st-toast-progress { background: linear-gradient(90deg, #dc3545, #f08895); }
.st-toast-info    .st-toast-progress { background: linear-gradient(90deg, #007bff, #66b3ff); }
.st-toast-warning .st-toast-progress { background: linear-gradient(90deg, #ffc107, #ffe480); }

/* ── Animations ──────────────────────────────── */
@keyframes stToastIn {
    0% {
        opacity: 0;
        transform: translateY(-24px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes stToastOut {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-16px) scale(0.94);
    }
}

@keyframes stToastProgress {
    0%   { width: 100%; }
    100% { width: 0%; }
}

/* ── Mobile Responsive ───────────────────────── */
@media (max-width: 520px) {
    #st-toast-container {
        top: 12px;
        max-width: 100%;
        width: calc(100% - 20px);
    }

    .st-toast {
        padding: 15px 16px;
        border-radius: 14px;
        gap: 12px;
        font-size: 0.9rem;
    }

    .st-toast-icon {
        width: 34px;
        height: 34px;
        font-size: 1.1rem;
        border-radius: 10px;
    }

    .st-toast-title {
        font-size: 0.9rem;
    }

    .st-toast-text {
        font-size: 0.85rem;
    }
}

/* ── Hide old message divs (keep in DOM for PHP compat) ── */
.message.success-message,
.message.error-message,
.error-message.full-width {
    display: none !important;
}
