/* src/web/static/css/tz_ui.css — shared AppToast and AppConfirmModal */

.tz-toast-container {
    position: fixed;
    top: max(16px, env(safe-area-inset-top));
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.tz-toast {
    pointer-events: auto;
    min-width: min(280px, calc(100vw - 32px));
    max-width: min(400px, calc(100vw - 32px));
    display: grid;
    grid-template-columns: 8px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    padding: 11px 13px;
    border: 1px solid var(--tz-border, hsl(var(--border, 214.3 31.8% 91.4%)));
    border-radius: var(--tz-radius-lg, 10px);
    background: var(--tz-bg-card, hsl(var(--card, 0 0% 100%)));
    color: var(--tz-text-primary, hsl(var(--foreground, 0 0% 10%)));
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
    animation: toastIn 0.18s ease;
    font-size: 13px;
    line-height: 1.45;
    font-family: var(--tz-font-sans, inherit);
    word-break: break-word;
}

.tz-toast__dot {
    width: 8px;
    height: 8px;
    margin-top: 5px;
    border-radius: 999px;
    background: var(--tz-primary, #FF6B01);
}

.tz-toast--success .tz-toast__dot { background: var(--tz-success, #22C55E); }
.tz-toast--error .tz-toast__dot { background: var(--tz-error, #EF4444); }
.tz-toast--warning .tz-toast__dot { background: var(--tz-warning, #F59E0B); }
.tz-toast--info .tz-toast__dot { background: var(--tz-primary, #FF6B01); }

.tz-toast__text {
    min-width: 0;
}

@keyframes toastIn {
    from { transform: translateY(-6px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes toastOut {
    from { transform: translateY(0); opacity: 1; }
    to { transform: translateY(-6px); opacity: 0; }
}

.tz-confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.48);
}

.dark .tz-confirm-overlay {
    background: rgba(0, 0, 0, 0.68);
}

.tz-confirm-box {
    width: min(420px, 100%);
    border: 1px solid var(--tz-border, hsl(var(--border, 214.3 31.8% 91.4%)));
    border-radius: var(--tz-radius-lg, 10px);
    background: var(--tz-bg-card, hsl(var(--card, 0 0% 100%)));
    color: var(--tz-text-primary, hsl(var(--foreground, 0 0% 10%)));
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.16);
    animation: tz-modal-in 0.16s ease;
    overflow: hidden;
}

@keyframes tz-modal-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.tz-confirm-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 16px 0;
}

.tz-confirm-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--tz-text-primary, hsl(var(--foreground, 0 0% 10%)));
}

.tz-confirm-desc {
    margin: 4px 0 0;
    font-size: 12px;
    line-height: 1.45;
    color: var(--tz-text-secondary, hsl(var(--muted-foreground, 215.4 16.3% 46.9%)));
}

.tz-confirm-close {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--tz-text-secondary, hsl(var(--muted-foreground, 215.4 16.3% 46.9%)));
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

.tz-confirm-close:hover {
    border-color: var(--tz-border, hsl(var(--border, 214.3 31.8% 91.4%)));
    background: hsl(var(--muted, 210 40% 96.1%));
    color: var(--tz-text-primary, hsl(var(--foreground, 0 0% 10%)));
}

.tz-confirm-msg {
    padding: 14px 16px 18px;
    font-size: 14px;
    color: var(--tz-text-primary, hsl(var(--foreground, 0 0% 10%)));
    line-height: 1.6;
    white-space: pre-wrap;
}

.tz-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 16px 16px;
    border-top: 1px solid var(--tz-border, hsl(var(--border, 214.3 31.8% 91.4%)));
    background: hsl(var(--muted, 210 40% 96.1%) / 0.48);
}

.tz-btn {
    min-height: 34px;
    padding: 0 14px;
    border-radius: var(--tz-radius-md, 8px);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--tz-font-sans, inherit);
    outline: none;
    transition: color 150ms ease, background 150ms ease, border-color 150ms ease, opacity 150ms ease;
}

.tz-btn:focus-visible,
.tz-confirm-close:focus-visible {
    box-shadow: 0 0 0 3px rgba(255, 107, 1, 0.16);
}

.tz-btn-cancel {
    border: 1px solid var(--tz-border, hsl(var(--border, 214.3 31.8% 91.4%)));
    background: var(--tz-bg-card, hsl(var(--card, 0 0% 100%)));
    color: var(--tz-text-secondary, hsl(var(--muted-foreground, 215.4 16.3% 46.9%)));
}

.tz-btn-cancel:hover {
    border-color: rgba(255, 107, 1, 0.32);
    color: var(--tz-text-primary, hsl(var(--foreground, 0 0% 10%)));
}

.tz-btn-ok {
    border: 1px solid var(--tz-primary, #FF6B01);
    background: var(--tz-primary, #FF6B01);
    color: #fff;
}

.tz-btn-ok:hover {
    background: var(--tz-primary-hover, #E55E00);
    border-color: var(--tz-primary-hover, #E55E00);
}

.tz-btn-danger {
    border-color: var(--tz-error, #EF4444);
    background: var(--tz-error, #EF4444);
}

.tz-btn-danger:hover {
    border-color: #DC2626;
    background: #DC2626;
}

@media (max-width: 520px) {
    .tz-toast-container {
        left: 12px;
        right: 12px;
        top: max(12px, env(safe-area-inset-top));
    }

    .tz-toast {
        width: 100%;
        min-width: 0;
    }

    .tz-confirm-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tz-toast,
    .tz-confirm-box {
        animation: none;
    }
}
