
/* =====================================================
   AJEEB EXPRESS — GLOBAL TOAST
===================================================== */

.ajeeb-toast {
    position: fixed;
    top: 20px;
    right: 22px;
    z-index: 100000;

    display: flex;
    align-items: center;
    gap: 11px;

    width: min(350px, calc(100% - 32px));
    min-height: 64px;
    padding: 11px 13px;

    overflow: hidden;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 13px;
    box-shadow: var(--shadow-md);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transform: translateY(-10px);
    transition:
        opacity 220ms ease,
        transform 260ms var(--ease),
        visibility 220ms ease;
}

.ajeeb-toast[hidden] {
    display: none;
}

.ajeeb-toast.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

/* =====================================================
   ICON
===================================================== */

.ajeeb-toast__icon {
    display: grid;
    place-items: center;
    flex: 0 0 36px;

    width: 36px;
    height: 36px;

    color: var(--primary);
    background: var(--primary-light);
    border-radius: 11px;
}

.ajeeb-toast__icon svg {
    width: 19px;
    height: 19px;
}

.ajeeb-toast__error {
    display: none;
}

.ajeeb-toast.is-error .ajeeb-toast__check {
    display: none;
}

.ajeeb-toast.is-error .ajeeb-toast__error {
    display: block;
}

/* =====================================================
   CONTENT
===================================================== */

.ajeeb-toast__content {
    flex: 1;
    min-width: 0;
}

.ajeeb-toast__brand {
    display: block;
    margin-bottom: 2px;

    color: var(--primary);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1px;
}

.ajeeb-toast__message {
    margin: 0;

    color: var(--text);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.6;

    overflow-wrap: anywhere;
}

/* =====================================================
   CLOSE BUTTON
===================================================== */

.ajeeb-toast__close {
    display: grid;
    place-items: center;
    flex: 0 0 26px;

    width: 26px;
    height: 26px;
    padding: 0;

    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);

    cursor: pointer;
    transition:
        background var(--transition),
        color var(--transition);
}

.ajeeb-toast__close:hover {
    background: var(--bg-secondary);
    color: var(--primary);
}

.ajeeb-toast__close svg {
    width: 15px;
    height: 15px;
}

/* =====================================================
   PROGRESS BAR
===================================================== */

.ajeeb-toast__progress {
    position: absolute;
    bottom: 0;
    left: 0;

    width: 100%;
    height: 2px;

    background: var(--primary);
    transform: scaleX(1);
    transform-origin: left center;
}

.ajeeb-toast[dir="rtl"] .ajeeb-toast__progress {
    transform-origin: right center;
}

.ajeeb-toast.is-visible .ajeeb-toast__progress {
    animation: ajeebToastProgress 3.5s linear forwards;
}

/* =====================================================
   LANGUAGE DIRECTION
===================================================== */

.ajeeb-toast[dir="rtl"] {
    text-align: right;
}

.ajeeb-toast[dir="ltr"] {
    text-align: left;
}

/* =====================================================
   ANIMATION
===================================================== */

@keyframes ajeebToastProgress {
    to {
        transform: scaleX(0);
    }
}

/* =====================================================
   MOBILE
===================================================== */

@media (max-width: 480px) {
    .ajeeb-toast {
        top: 12px;
        right: 12px;

        width: min(330px, calc(100% - 24px));
        min-height: 58px;
        padding: 9px 11px;
        gap: 9px;

        border-radius: 11px;
    }

    .ajeeb-toast__icon {
        flex-basis: 32px;
        width: 32px;
        height: 32px;
        border-radius: 9px;
    }

    .ajeeb-toast__icon svg {
        width: 17px;
        height: 17px;
    }

    .ajeeb-toast__message {
        font-size: 11px;
    }

    .ajeeb-toast__brand {
        font-size: 8px;
    }
}

/* =====================================================
   ACCESSIBILITY
===================================================== */

@media (prefers-reduced-motion: reduce) {
    .ajeeb-toast,
    .ajeeb-toast__close {
        transition: none;
    }

    .ajeeb-toast.is-visible .ajeeb-toast__progress {
        animation: none;
    }
}
