/*
 * Toast Notification System — BINTACURA
 * Floating toasts with 4 types: success, error, warning, info.
 * Accessible: aria-live="polite" region, role="status".
 */

#binta-toast-region {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    max-width: 360px;
    width: calc(100% - 48px);
    pointer-events: none;
}

.binta-toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 10px;
    background: var(--bg-secondary, #fff);
    box-shadow: 0 4px 20px rgba(0,0,0,0.14);
    pointer-events: all;
    border-left: 4px solid var(--border-color, #e0e0e0);
    animation: binta-toast-in 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    position: relative;
    min-width: 0;
}

@keyframes binta-toast-in {
    from { opacity: 0; transform: translateX(60px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes binta-toast-out {
    from { opacity: 1; transform: translateX(0); max-height: 120px; margin-bottom: 0; }
    to   { opacity: 0; transform: translateX(60px); max-height: 0; margin-bottom: -10px; }
}

.binta-toast.removing {
    animation: binta-toast-out 0.24s ease-in forwards;
}

/* Type variants */
.binta-toast[data-type="success"] { border-left-color: var(--status-success); }
.binta-toast[data-type="error"]   { border-left-color: #ef4444; }
.binta-toast[data-type="warning"] { border-left-color: #f59e0b; }
.binta-toast[data-type="info"]    { border-left-color: var(--brand-primary, var(--brand-hover)); }

/* Icon */
.binta-toast-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 1px;
}
.binta-toast[data-type="success"] .binta-toast-icon { color: var(--status-success); }
.binta-toast[data-type="error"]   .binta-toast-icon { color: #ef4444; }
.binta-toast[data-type="warning"] .binta-toast-icon { color: #f59e0b; }
.binta-toast[data-type="info"]    .binta-toast-icon { color: var(--brand-primary, var(--brand-hover)); }

/* Body */
.binta-toast-body {
    flex: 1;
    font-size: 14px;
    line-height: 1.45;
    color: var(--text-primary, #1a1a1a);
    word-break: break-word;
}

/* Close button */
.binta-toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted, #888);
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: color 0.15s;
}
.binta-toast-close:hover { color: var(--text-primary, #333); }

/* Dark mode */
[data-theme="dark"] .binta-toast {
    background: var(--bg-secondary, #1e1e1e);
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

/* Mobile: bottom-center */
@media (max-width: 576px) {
    #binta-toast-region {
        right: 16px;
        left: 16px;
        bottom: 16px;
        max-width: 100%;
        width: auto;
    }
}
