/* Tour CRM — UX feedback library styles (toasts + modals).
 * Loaded after modern-crm.css so design tokens are available.
 */

/* ── Toast host: top-right stack ───────────────────────────────── */
#appToastHost {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
    max-width: 420px;
}

@media (max-width: 640px){
    #appToastHost {
        top: 0.5rem;
        right: 0.5rem;
        left: 0.5rem;
        max-width: none;
    }
}

.app-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    background: #1f2937;
    color: #f9fafb;
    box-shadow: 0 12px 40px rgba(0,0,0,0.18), 0 4px 8px rgba(0,0,0,0.08);
    font-size: 0.92rem;
    line-height: 1.4;
    min-width: 280px;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.28s cubic-bezier(0.16,1,0.3,1), opacity 0.2s ease;
    border: 1px solid rgba(255,255,255,0.06);
    font-family: 'Noto Sans Georgian', Inter, system-ui, sans-serif;
}

.app-toast--show {
    transform: translateX(0);
    opacity: 1;
}

.app-toast__icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    background: rgba(255,255,255,0.14);
}

.app-toast__msg {
    flex: 1;
    word-break: break-word;
    padding-top: 0.1rem;
    white-space: pre-wrap;
}

.app-toast__close {
    background: transparent;
    border: 0;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    padding: 0 0.2rem;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}

.app-toast__close:hover {
    color: #fff;
    background: rgba(255,255,255,0.08);
}

/* Color variants ───────────────────────────────────────────────── */
.app-toast--success {
    background: #065f46;
    border-color: rgba(16,185,129,0.4);
}
.app-toast--success .app-toast__icon { background: #10b981; color: #022c22; }

.app-toast--error {
    background: #7f1d1d;
    border-color: rgba(239,68,68,0.4);
}
.app-toast--error .app-toast__icon { background: #ef4444; color: #450a0a; }

.app-toast--warning {
    background: #78350f;
    border-color: rgba(245,158,11,0.4);
}
.app-toast--warning .app-toast__icon { background: #f59e0b; color: #451a03; }

.app-toast--info {
    background: #1e3a8a;
    border-color: rgba(59,130,246,0.4);
}
.app-toast--info .app-toast__icon { background: #3b82f6; color: #0c1e3f; }

/* ── Modal overlay (appConfirm) ─────────────────────────────────── */
.app-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.app-modal-overlay--show {
    opacity: 1;
}

.app-modal {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.25);
    max-width: 480px;
    width: 100%;
    padding: 1.5rem 1.5rem 1.25rem;
    transform: scale(0.94);
    transition: transform 0.22s cubic-bezier(0.16,1,0.3,1);
    font-family: 'Noto Sans Georgian', Inter, system-ui, sans-serif;
}

.app-modal-overlay--show .app-modal {
    transform: scale(1);
}

.app-modal__body {
    color: #1f2937;
    font-size: 0.98rem;
    line-height: 1.55;
    margin-bottom: 1.2rem;
    white-space: pre-wrap;
}

.app-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
}

.app-modal__btn {
    padding: 0.6rem 1.1rem;
    border-radius: 8px;
    border: 1px solid transparent;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
    font-family: inherit;
}

.app-modal__btn:active { transform: translateY(1px); }

.app-modal__btn--secondary {
    background: #f1f5f9;
    color: #334155;
    border-color: #e2e8f0;
}
.app-modal__btn--secondary:hover { background: #e2e8f0; color: #0f172a; }

.app-modal__btn--primary {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.app-modal__btn--primary:hover { background: #1d4ed8; border-color: #1d4ed8; }

.app-modal__btn--danger {
    background: #dc2626;
    border-color: #dc2626;
}
.app-modal__btn--danger:hover { background: #b91c1c; border-color: #b91c1c; }

/* ── Form autosave indicator + restore banner ──────────────────── */
.fa-indicator {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    background: #1f2937;
    color: #f9fafb;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    z-index: 9000;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.18s, transform 0.18s;
    pointer-events: none;
    box-shadow: 0 6px 20px rgba(0,0,0,0.18);
    font-family: 'Noto Sans Georgian', Inter, system-ui, sans-serif;
}
.fa-indicator--show {
    opacity: 0.92;
    transform: translateY(0);
}
.fa-indicator[data-type="success"] { background: #047857; }

.fa-restore-banner {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1px solid #fbbf24;
    border-radius: 12px;
    padding: 0.85rem 1.1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    box-shadow: 0 4px 12px rgba(245,158,11,0.12);
    font-family: 'Noto Sans Georgian', Inter, system-ui, sans-serif;
}

.fa-restore-banner__msg {
    color: #78350f;
    font-size: 0.9rem;
    line-height: 1.4;
}
.fa-restore-banner__msg strong { color: #451a03; }
.fa-restore-banner__sub { font-size: 0.82rem; color: #92400e; margin-top: 0.15rem; }

.fa-restore-banner__actions { display: flex; gap: 0.5rem; flex-shrink: 0; }

.fa-restore-banner__btn {
    padding: 0.5rem 0.95rem;
    border-radius: 8px;
    border: 1px solid transparent;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    font-family: inherit;
}
.fa-restore-banner__btn--yes {
    background: #f59e0b;
    color: #fff;
    border-color: #f59e0b;
}
.fa-restore-banner__btn--yes:hover { background: #d97706; border-color: #d97706; }
.fa-restore-banner__btn--no {
    background: #fff;
    color: #92400e;
    border-color: #fcd34d;
}
.fa-restore-banner__btn--no:hover { background: #fef3c7; }

@media (max-width: 640px){
    .fa-restore-banner {
        flex-direction: column;
        align-items: stretch;
    }
    .fa-restore-banner__actions { justify-content: flex-end; }
}
