/* Odex Toast — frontend notification system. */

.odex-toast-container {
    position: fixed;
    top: auto;
    right: 16px;
    bottom: 16px;
    left: auto;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    max-width: calc(100vw - 32px);
    width: 360px;
    pointer-events: none; /* the container itself doesn't catch events */
}

@media (max-width: 480px) {
    .odex-toast-container {
        left: 16px;
        right: 16px;
        width: auto;
    }
}

.odex-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #ffffff;
    color: #1f2937;
    box-shadow:
        0 10px 24px rgba(0, 0, 0, 0.12),
        0 2px 6px rgba(0, 0, 0, 0.08);
    border-left: 4px solid #6b7280;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.45;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 220ms ease, transform 220ms ease;
}

.odex-toast.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.odex-toast.is-leaving {
    opacity: 0;
    transform: translateX(20px);
}

.odex-toast__icon {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    color: #ffffff;
    background: #6b7280;
}

.odex-toast__body {
    flex: 1 1 auto;
    color: inherit;
    word-break: break-word;
    padding-top: 2px;
}

.odex-toast__close {
    flex: 0 0 auto;
    appearance: none;
    background: transparent;
    border: 0;
    color: #6b7280;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    padding: 0 4px;
    margin: -2px -4px 0 0;
    transition: color 150ms ease;
}

.odex-toast__close:hover,
.odex-toast__close:focus-visible {
    color: #111827;
    outline: none;
}

/* ── Variants ──────────────────────────────────────── */

.odex-toast--success {
    border-left-color: #16a34a;
}
.odex-toast--success .odex-toast__icon {
    background: #16a34a;
}

.odex-toast--error {
    border-left-color: #dc2626;
}
.odex-toast--error .odex-toast__icon {
    background: #dc2626;
}

.odex-toast--warning {
    border-left-color: var(--odex-orange, #f59e0b);
}
.odex-toast--warning .odex-toast__icon {
    background: var(--odex-orange, #f59e0b);
}

.odex-toast--info {
    border-left-color: var(--odex-blue, #04a1ff);
}
.odex-toast--info .odex-toast__icon {
    background: var(--odex-blue, #04a1ff);
}

/* ── Dark scheme ───────────────────────────────────── */

@media (prefers-color-scheme: dark) {
    .odex-toast {
        background: #1f2937;
        color: #f3f4f6;
        box-shadow:
            0 10px 24px rgba(0, 0, 0, 0.45),
            0 2px 6px rgba(0, 0, 0, 0.30);
    }
    .odex-toast__close {
        color: #9ca3af;
    }
    .odex-toast__close:hover,
    .odex-toast__close:focus-visible {
        color: #f3f4f6;
    }
}

/* ── Reduced motion ────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .odex-toast {
        transition: opacity 120ms linear;
        transform: none;
    }
    .odex-toast.is-leaving {
        transform: none;
    }
}
