/* ============================================================
   Nexus Messenger — Invite Links (Patch 01, v1.29.19)
   Модалка управления пригласительными ссылками + join-by-link.
   Использует существующие CSS-переменные темы (var(--…)).
   ============================================================ */

.nx-il-overlay {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: nx-il-fade 0.18s ease;
}
@keyframes nx-il-fade { from { opacity: 0; } to { opacity: 1; } }

.nx-il-modal {
    width: min(560px, 94vw);
    max-height: 88vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--bg-panel, var(--bg-secondary, #1e1f24));
    color: var(--text-primary, #e9e9ee);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
    animation: nx-il-pop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes nx-il-pop {
    from { transform: translateY(12px) scale(0.98); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}

.nx-il-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
}
.nx-il-title {
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}
.nx-il-close {
    border: none;
    background: transparent;
    color: var(--text-secondary, #9aa0aa);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
}
.nx-il-close:hover { background: var(--bg-hover, rgba(255, 255, 255, 0.06)); color: var(--text-primary, #fff); }

.nx-il-body {
    padding: 16px 18px;
    overflow-y: auto;
}

/* — primary link block — */
.nx-il-primary {
    background: var(--bg-input, rgba(255, 255, 255, 0.04));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}
.nx-il-primary-label {
    font-size: 12px;
    color: var(--text-secondary, #9aa0aa);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.nx-il-url-row { display: flex; gap: 8px; align-items: center; }
.nx-il-url {
    flex: 1;
    min-width: 0;
    font-family: var(--font-mono, ui-monospace, monospace);
    font-size: 13px;
    padding: 9px 11px;
    background: var(--bg-panel, #14151a);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 9px;
    color: var(--accent, #6ea8fe);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nx-il-btn {
    border: none;
    border-radius: 9px;
    padding: 9px 13px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: filter 0.15s, background 0.15s, transform 0.05s;
}
.nx-il-btn:active { transform: translateY(1px); }
.nx-il-btn.primary { background: var(--accent, #4f7cff); color: #fff; }
.nx-il-btn.primary:hover { filter: brightness(1.08); }
.nx-il-btn.ghost {
    background: var(--bg-hover, rgba(255, 255, 255, 0.06));
    color: var(--text-primary, #e9e9ee);
}
.nx-il-btn.ghost:hover { background: var(--bg-hover-strong, rgba(255, 255, 255, 0.12)); }
.nx-il-btn.danger { background: rgba(229, 72, 77, 0.16); color: #ff8087; }
.nx-il-btn.danger:hover { background: rgba(229, 72, 77, 0.28); }
.nx-il-btn.icon { padding: 9px 11px; }

/* — create form — */
.nx-il-create {
    border-top: 1px dashed var(--border-color, rgba(255, 255, 255, 0.1));
    padding-top: 14px;
    margin-bottom: 8px;
}
.nx-il-section-title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-primary, #e9e9ee);
}
.nx-il-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}
.nx-il-field { flex: 1; min-width: 130px; }
.nx-il-field label {
    display: block;
    font-size: 11px;
    color: var(--text-secondary, #9aa0aa);
    margin-bottom: 4px;
}
.nx-il-input, .nx-il-select {
    width: 100%;
    padding: 8px 10px;
    font-size: 13px;
    background: var(--bg-input, rgba(255, 255, 255, 0.04));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 8px;
    color: var(--text-primary, #e9e9ee);
    box-sizing: border-box;
}
.nx-il-input:focus, .nx-il-select:focus {
    outline: none;
    border-color: var(--accent, #4f7cff);
}

/* — links list — */
.nx-il-list { margin-top: 14px; }
.nx-il-link-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    border-radius: 11px;
    margin-bottom: 8px;
    background: var(--bg-input, rgba(255, 255, 255, 0.03));
}
.nx-il-link-main { flex: 1; min-width: 0; }
.nx-il-link-name {
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}
.nx-il-link-meta {
    font-size: 11px;
    color: var(--text-secondary, #9aa0aa);
    margin-top: 3px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.nx-il-badge {
    font-size: 10px;
    padding: 1px 7px;
    border-radius: 20px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.nx-il-badge.primary { background: rgba(79, 124, 255, 0.18); color: #8ab0ff; }
.nx-il-badge.dead    { background: rgba(229, 72, 77, 0.16); color: #ff8087; }
.nx-il-link-actions { display: flex; gap: 6px; }
.nx-il-icon-btn {
    border: none;
    background: var(--bg-hover, rgba(255, 255, 255, 0.06));
    color: var(--text-secondary, #c4c8d0);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.15s, color 0.15s;
}
.nx-il-icon-btn:hover { background: var(--bg-hover-strong, rgba(255, 255, 255, 0.12)); color: #fff; }
.nx-il-icon-btn.danger:hover { background: rgba(229, 72, 77, 0.24); color: #ff8087; }

.nx-il-empty, .nx-il-loading {
    text-align: center;
    color: var(--text-secondary, #9aa0aa);
    font-size: 13px;
    padding: 18px 0;
}

/* — join-by-link card — */
.nx-il-join-modal { width: min(420px, 92vw); }
.nx-il-join-avatar {
    width: 72px; height: 72px;
    border-radius: 18px;
    margin: 6px auto 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 32px;
    background: var(--accent, #4f7cff);
    color: #fff;
    font-weight: 700;
}
.nx-il-join-name { text-align: center; font-size: 18px; font-weight: 700; }
.nx-il-join-sub  { text-align: center; font-size: 13px; color: var(--text-secondary, #9aa0aa); margin-top: 4px; }
.nx-il-join-desc { text-align: center; font-size: 13px; margin: 12px 0; line-height: 1.45; }
.nx-il-join-actions { display: flex; gap: 10px; margin-top: 16px; }
.nx-il-join-actions .nx-il-btn { flex: 1; padding: 11px; text-align: center; }
.nx-il-join-note {
    margin-top: 10px;
    font-size: 12px;
    text-align: center;
    color: var(--text-secondary, #9aa0aa);
}

/* — QR — */
.nx-il-qr-wrap { text-align: center; padding: 8px 0; }
.nx-il-qr-wrap canvas, .nx-il-qr-wrap img, .nx-il-qr-wrap svg {
    background: #fff;
    padding: 10px;
    border-radius: 12px;
}
