/* Global toast stack — fixed to viewport bottom-right so it’s visible regardless of scroll. */
.fotogenic-ai-toast-root {
    position: fixed;
    bottom: 16px;
    right: 16px;
    top: auto;
    left: auto;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    max-width: min(520px, calc(100vw - 32px));
    pointer-events: none;
}

/* Studio header: wrapper takes no flow space; root is fixed to viewport above */
.fotogenic-ai-studio-header__toasts {
    position: relative;
    width: 0;
    min-width: 0;
    flex-shrink: 0;
    overflow: visible;
}

/* Legacy modifier: same as base (viewport bottom-right) */
.fotogenic-ai-toast-root--fullscreen {
    position: fixed;
    bottom: 16px;
    right: 16px;
    top: auto;
    z-index: 99999;
}

/* Only toast cards capture clicks; root never blocks UI */
.fotogenic-ai-toast {
    pointer-events: auto;
}

.fotogenic-ai-toast {
    opacity: 0;
    transition: opacity 0.25s ease;
    border-radius: var(--fa-radius-md, 8px);
    padding: 8px 32px 8px 12px;
    min-height: 36px;
    min-width: 200px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--fa-shadow-float, 0 4px 10px rgba(15, 23, 42, 0.12));
    border: 1px solid var(--fa-color-border-muted, #eef0f2);
    position: relative;
    line-height: 1.35;
}

/* Enter: fade in */
.fotogenic-ai-toast--visible {
    opacity: 1;
}

/* Exit: fade out */
.fotogenic-ai-toast--exiting {
    opacity: 0;
}

.fotogenic-ai-toast__icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    border-radius: 50%;
    line-height: 1;
}

.fotogenic-ai-toast--success .fotogenic-ai-toast__icon {
    background: rgba(34, 197, 94, 0.15);
    color: #16a34a;
}

.fotogenic-ai-toast--info .fotogenic-ai-toast__icon {
    background: rgba(59, 130, 246, 0.12);
    color: #2563eb;
}

.fotogenic-ai-toast--warning .fotogenic-ai-toast__icon {
    background: rgba(239, 68, 68, 0.15);
    color: #b91c1c;
}

.fotogenic-ai-toast--success {
    background: var(--fa-color-white, #fff);
    border-color: rgba(34, 197, 94, 0.25);
    color: var(--fa-color-text, #374151);
}

.fotogenic-ai-toast--info {
    background: var(--fa-color-white, #fff);
    color: var(--fa-color-text, #374151);
}

.fotogenic-ai-toast--warning {
    background: rgba(254, 242, 242, 0.95);
    border-color: rgba(239, 68, 68, 0.2);
    color: #7f1d1d;
}

.fotogenic-ai-toast__message {
    flex: 1;
    font-size: 13px;
    line-height: 1.35;
    min-width: 0;
    white-space: nowrap;
}

.fotogenic-ai-toast__close {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--fa-color-muted, #9ca3af);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    border-radius: var(--fa-radius-sm, 6px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.fotogenic-ai-toast__close:hover {
    color: var(--fa-color-text, #374151);
    background: rgba(0, 0, 0, 0.06);
}

.fotogenic-ai-toast__close:focus-visible {
    outline: 2px solid var(--fa-color-accent, #ff9500);
    outline-offset: 2px;
}

@media (max-width: 640px) {
    .fotogenic-ai-toast-root,
    .fotogenic-ai-toast-root--fullscreen {
        left: 12px;
        right: 12px;
        bottom: 12px;
        max-width: none;
        align-items: stretch;
    }

    .fotogenic-ai-toast {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .fotogenic-ai-toast__message {
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
    }
}
