/* Reading Position Memory Plugin — Toast */

.rpm-toast {
    position: fixed;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem 0.625rem 1rem;
    background: var(--fb-bg-surface, #1e1e2e);
    border: 1px solid var(--fb-border, rgba(255, 255, 255, 0.1));
    border-radius: var(--fb-radius-lg, 0.75rem);
    box-shadow: var(--fb-shadow-lg, 0 8px 24px rgba(0, 0, 0, 0.25));
    font-size: 0.8rem;
    font-family: var(--fb-font-system, system-ui, sans-serif);
    opacity: 0;
    transform: translateY(0.5rem);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

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

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

.rpm-toast--bottom-center {
    bottom: 4.5rem;
    left: 50%;
    translate: -50% 0;
}

.rpm-toast--bottom-left {
    bottom: 4.5rem;
    left: 1.5rem;
}

.rpm-toast--bottom-right {
    bottom: 4.5rem;
    right: 1.5rem;
}

/* ── Message ───────────────────────────────────────────────── */

.rpm-toast__message {
    color: var(--fb-text-muted, #a1a1aa);
    white-space: nowrap;
}

/* ── Actions ───────────────────────────────────────────────── */

.rpm-toast__actions {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-shrink: 0;
}

.rpm-toast__btn {
    border: none;
    cursor: pointer;
    font-family: inherit;
    line-height: 1;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.rpm-toast__btn--jump {
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    background: var(--fb-bg-accent, var(--fb-blue, #6366f1));
    border-radius: var(--fb-radius-sm, 0.25rem);
}

.rpm-toast__btn--jump:hover {
    background: var(--fb-bg-accent-hover, #4f46e5);
}

.rpm-toast__btn--dismiss {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    font-size: 1rem;
    color: var(--fb-text-muted, #a1a1aa);
    background: transparent;
    border-radius: var(--fb-radius-sm, 0.25rem);
}

.rpm-toast__btn--dismiss:hover {
    background: var(--fb-bg-muted, rgba(255, 255, 255, 0.08));
    color: var(--fb-text, #e4e4e7);
}

/* ── Light Theme ───────────────────────────────────────────── */

:root:not(.dark) .rpm-toast {
    background: var(--fb-bg-surface, #ffffff);
    border-color: var(--fb-border, rgba(0, 0, 0, 0.1));
    box-shadow: var(--fb-shadow-lg, 0 8px 24px rgba(0, 0, 0, 0.1));
}

:root:not(.dark) .rpm-toast__message {
    color: var(--fb-text-muted, #6b7280);
}

:root:not(.dark) .rpm-toast__btn--dismiss {
    color: var(--fb-text-muted, #6b7280);
}

:root:not(.dark) .rpm-toast__btn--dismiss:hover {
    background: var(--fb-bg-muted, #f3f4f6);
    color: var(--fb-text, #1f2937);
}

/* ── Mobile ────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .rpm-toast--bottom-center,
    .rpm-toast--bottom-left,
    .rpm-toast--bottom-right {
        left: 1rem;
        right: 1rem;
        translate: 0 0;
    }

    .rpm-toast {
        font-size: 0.75rem;
    }
}

/* ── Print ─────────────────────────────────────────────────── */

@media print {
    .rpm-toast {
        display: none !important;
    }
}

/* ── Reduced Motion ────────────────────────────────────────── */

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