/* ======================================================================
   Toast notifications + progress bar
   Single source of truth — consumed by pro.html, standard.html, subtitles.html.
   Elements are injected at runtime by js/toast-manager.js.
   ====================================================================== */

:root {
    /* Distance from viewport bottom. Overridden on mobile to clear the
       fixed recording bar on standard.html (see media query below). */
    --toast-bottom: 80px;
}

.operation-toast {
    position: fixed;
    bottom: var(--toast-bottom);
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-bg-tertiary);
    color: var(--color-text-primary);
    padding: 12px 24px;
    border-radius: 20px;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    z-index: 10001;
    display: flex;
    align-items: center;
    gap: 8px;
}

.operation-toast.show {
    opacity: 1;
    visibility: visible;
    animation: toastSlideUp 0.3s ease-out;
}

@keyframes toastSlideUp {
    from { opacity: 0; transform: translate(-50%, 20px); }
    to   { opacity: 1; transform: translate(-50%, 0); }
}

/* Type signals via border + icon tint only — background stays opaque so
   text behind the chip never bleeds through. */
.operation-toast.success { border-color: var(--color-success); }
.operation-toast.warning { border-color: var(--color-warning); }
.operation-toast.error   { border-color: var(--color-error); }

.operation-toast.success .toast-icon { color: var(--color-success); }
.operation-toast.warning .toast-icon { color: var(--color-warning); }
.operation-toast.error   .toast-icon { color: var(--color-error); }

.operation-toast .toast-icon { display: flex; }
.operation-toast .toast-icon .lucide { width: 18px; height: 18px; }

/* Progress bar */
.operation-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 10002;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-fast);
}

.operation-progress.show {
    opacity: 1;
    visibility: visible;
}

.operation-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--color-brand) 0%, var(--color-success) 100%);
    width: 0%;
    transition: width var(--transition-slow);
}

.operation-progress-bar.indeterminate {
    width: 30%;
    animation: toastIndeterminate 1.5s infinite;
}

@keyframes toastIndeterminate {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(400%); }
}

/* ----------------------------------------------------------------------
   Mobile: standard.html pins .recording-section to the bottom. The toast
   must sit above it with breathing room. Recording-section content is
   ~132px tall (padding 12 + button 56 + gap 8 + status 27 + padding 12 +
   safe-area inset); we add 24px above that for a clean gap.
   ---------------------------------------------------------------------- */
@media (max-width: 480px) {
    :root {
        --toast-bottom: calc(132px + 24px + env(safe-area-inset-bottom));
    }

    .operation-toast {
        left: 16px;
        right: 16px;
        transform: none;
        justify-content: center;
    }

    .operation-toast.show {
        animation: toastSlideUpMobile 0.3s ease-out;
    }

    @keyframes toastSlideUpMobile {
        from { opacity: 0; transform: translateY(20px); }
        to   { opacity: 1; transform: translateY(0); }
    }
}
