/* ZAMOK — Copy button + Toast (глобально) */

/* ── Кнопка копирования ─────────────────────────────────────────── */
.copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin: 0;
    padding: 0;
    border: 1px solid transparent;
    background: transparent;
    color: var(--color-text-muted, #6b7280);
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0;
    vertical-align: middle;
    position: relative;
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity .18s ease, transform .18s ease,
                color .15s ease, background .15s ease, border-color .15s ease;
}

/* На hover родителя — показываем кнопку */
.has-copy:hover .copy-btn,
.has-copy:focus-within .copy-btn,
.copy-btn:focus-visible,
.copy-btn.is-copied {
    opacity: 1;
    transform: translateX(0);
}

.copy-btn:hover {
    color: var(--color-primary, #e11e28);
    border-color: rgba(225, 30, 40, .25);
    background: #fff5f5;
}
.copy-btn:active { transform: scale(.92); }
.copy-btn:focus-visible {
    outline: 2px solid rgba(225, 30, 40, .35);
    outline-offset: 2px;
}

.copy-btn__ico { display: block; pointer-events: none; transition: transform .2s ease; }
.copy-btn__ico--ok { display: none; color: #16a34a; }

.copy-btn.is-copied {
    color: #16a34a;
    border-color: #86efac;
    background: #f0fdf4;
    animation: copy-flash .35s ease;
}
.copy-btn.is-copied .copy-btn__ico--copy { display: none; }
.copy-btn.is-copied .copy-btn__ico--ok { display: block; animation: copy-pop .25s ease; }

@keyframes copy-flash {
    0%   { box-shadow: 0 0 0 0 rgba(22, 163, 74, .35); }
    60%  { box-shadow: 0 0 0 6px rgba(22, 163, 74, 0); }
    100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}
@keyframes copy-pop {
    0%   { transform: scale(.5); opacity: 0; }
    60%  { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(1); }
}

/* На сенсорных экранах — кнопка всегда видна */
@media (hover: none) {
    .copy-btn { opacity: 1; transform: none; }
}

/* wrapper, чтобы не разваливать flex-родителя */
.has-copy {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 100%;
    border-radius: 6px;
    transition: background .15s ease;
}
.has-copy:hover { background: rgba(0, 0, 0, .025); }
.has-copy > a {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Toast ──────────────────────────────────────────────────────── */
.zamok-toast-host {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 9999;
    pointer-events: none;
}
.zamok-toast {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px 10px 14px;
    background: #111827;
    color: #fff;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0,0,0,.18);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .25s ease, transform .25s ease;
}
.zamok-toast.is-show { opacity: 1; transform: translateY(0); }
.zamok-toast svg { color: #4ade80; }
.zamok-toast--error { background: #b91c1c; }
.zamok-toast--error svg { color: #fff; }

@media (max-width: 600px) {
    .zamok-toast-host { bottom: 80px; left: 16px; right: 16px; transform: none; align-items: center; }
    .zamok-toast { width: auto; }
}
