/* ============================================================
   Nexus v1.26.3 — Global Search + Theme Accent Picker
   ============================================================ */

/* ── Global search results dropdown ── */
.global-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 500;
    background: var(--bg-raised);
    border: 0.5px solid var(--border-strong);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    max-height: 400px;
    overflow-y: auto;
    margin-top: 4px;
}
.search-wrap {
    position: relative;
}
.gsr-section {
    padding: 4px 0;
}
.gsr-section + .gsr-section {
    border-top: 0.5px solid var(--border);
}
.gsr-title {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    padding: 6px 14px 3px;
}
.gsr-item {
    padding: 8px 14px;
    cursor: pointer;
    transition: background .12s;
}
.gsr-item:hover {
    background: var(--bg-hover);
}
.gsr-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gsr-sub {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Accent color picker (Settings panel) ── */
.accent-picker {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}
.accent-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform .15s, border-color .15s;
    flex-shrink: 0;
}
.accent-swatch:hover {
    transform: scale(1.15);
}
.accent-swatch.active {
    border-color: var(--text-primary);
    transform: scale(1.1);
}

/* data-accent overrides */
[data-accent="blue"]   { --accent: #4f8aff; --accent-dim: rgba(79,138,255,0.15); --accent-hover: #6b9fff; }
[data-accent="green"]  { --accent: #1D9E75; --accent-dim: rgba(29,158,117,0.15); --accent-hover: #23bc8c; }
[data-accent="purple"] { --accent: #7c6af7; --accent-dim: rgba(124,106,247,0.15); --accent-hover: #9585f9; }
[data-accent="pink"]   { --accent: #e05c8a; --accent-dim: rgba(224,92,138,0.15); --accent-hover: #e87aa0; }
[data-accent="orange"] { --accent: #e8720c; --accent-dim: rgba(232,114,12,0.15); --accent-hover: #f08930; }
[data-accent="red"]    { --accent: #e04444; --accent-dim: rgba(224,68,68,0.15); --accent-hover: #e86060; }
[data-accent="teal"]   { --accent: #0ea5e9; --accent-dim: rgba(14,165,233,0.15); --accent-hover: #38bdf8; }
[data-accent="gold"]   { --accent: #d4a017; --accent-dim: rgba(212,160,23,0.15); --accent-hover: #e5b830; }

/* Keyboard shortcut hint */
.search-hint {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: var(--text-muted);
    background: var(--bg-overlay);
    border: 0.5px solid var(--border);
    border-radius: 4px;
    padding: 1px 5px;
    pointer-events: none;
}

/* ── Bot Manager ─────────────────────────────────────────── */
.bot-manager-modal { max-width: 560px; width: calc(100vw - 32px); max-height: 85vh; display: flex; flex-direction: column; }
.bot-mgr-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.bot-mgr-actions { margin-bottom: 14px; }
.bot-list { display: flex; flex-direction: column; gap: 10px; }
.bot-item { background: var(--bg-overlay); border: 0.5px solid var(--border); border-radius: var(--radius-md); padding: 12px 14px; }
.bot-item-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.bot-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-dim); color: var(--accent); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 15px; flex-shrink: 0; }
.bot-info { flex: 1; min-width: 0; }
.bot-name { font-size: 14px; font-weight: 500; color: var(--text-primary); }
.bot-username { font-size: 12px; color: var(--text-secondary); }
.bot-status { font-size: 11px; }
.bot-status.active { color: var(--green, #1D9E75); }
.bot-status.inactive { color: var(--text-muted); }
.bot-desc { font-size: 12px; color: var(--text-secondary); margin-bottom: 8px; }
.bot-item-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 6px; border: 0.5px solid var(--border); background: var(--bg-overlay); color: var(--text-secondary); cursor: pointer; transition: background .15s; }
.btn-sm:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-danger-sm { border-color: var(--color-border-danger); color: var(--color-text-danger); }
.bot-loading, .bot-empty, .bot-error { text-align: center; padding: 24px; color: var(--text-secondary); font-size: 13px; }
.bot-create-form { background: var(--bg-overlay); border: 0.5px solid var(--border); border-radius: var(--radius-md); padding: 14px; margin-bottom: 12px; }
.form-label { font-size: 12px; color: var(--text-secondary); display: block; margin-bottom: 3px; }
.token-display { display: flex; align-items: center; gap: 8px; background: var(--bg-secondary); border-radius: 6px; padding: 8px 10px; }
.token-display code { flex: 1; font-size: 11px; word-break: break-all; color: var(--accent); }
.docs-endpoint { font-size: 13px; color: var(--text-secondary); padding: 4px 0; border-bottom: 0.5px solid var(--border); }
.docs-code { background: var(--bg-secondary); padding: 8px 10px; border-radius: 6px; font-size: 12px; color: var(--text-primary); white-space: pre-wrap; }

/* ── Location message bubble ─────────────────────────────── */
.location-bubble { border-radius: 8px; overflow: hidden; max-width: 280px; }
.loc-map-link { display: block; position: relative; }
.loc-map-img { width: 100%; height: 140px; object-fit: cover; display: block; }
.loc-pin { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-60%); font-size: 24px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.4)); }
.loc-label { font-size: 12px; color: var(--text-secondary); padding: 6px 10px 2px; }
.loc-coords { display: flex; align-items: center; justify-content: space-between; padding: 4px 10px 8px; font-size: 12px; color: var(--text-secondary); }
.loc-open { color: var(--accent); text-decoration: none; font-size: 12px; flex-shrink: 0; }
.loc-open:hover { text-decoration: underline; }

/* ── Federation & Remote user badges ────────────────────── */
.remote-domain-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 500;
    padding: 1px 6px;
    border-radius: 10px;
    background: var(--color-background-info);
    color: var(--color-text-info);
    margin-left: 5px;
    vertical-align: middle;
}

/* Federated search result */
.gsr-fed-item {
    border-left: 2px solid var(--accent);
    padding-left: 12px;
}

/* Federated chat badge в списке чатов */
.chat-item-federated .chat-name::after {
    content: '⬡';
    font-size: 9px;
    color: var(--accent);
    margin-left: 4px;
    vertical-align: super;
}

/* Handle autocomplete в поле ввода */
.fed-handle-hint {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: var(--bg-raised);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 6px 0;
    z-index: 200;
    max-height: 200px;
    overflow-y: auto;
}
.fed-handle-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-primary);
}
.fed-handle-item:hover { background: var(--bg-hover); }
.fed-handle-item .fed-domain {
    font-size: 11px;
    color: var(--text-secondary);
}

/* ── Sticker Picker ─────────────────────────────────────── */
.nx-sticker-picker {
    position: fixed;
    z-index: 1200;
    height: 340px;
    background: var(--bg-overlay);
    border: 0.5px solid var(--border-strong);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: nx-ep-fade 0.15s ease-out;
}
.nsp-tabs {
    display: flex;
    gap: 2px;
    padding: 6px 8px;
    border-bottom: 0.5px solid var(--border);
    overflow-x: auto;
    scrollbar-width: none;
    flex-shrink: 0;
}
.nsp-tab {
    background: none;
    border: none;
    padding: 4px;
    border-radius: 6px;
    cursor: pointer;
    opacity: 0.6;
    min-width: 36px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.nsp-tab:hover, .nsp-tab.active { background: var(--accent-dim); opacity: 1; }
.nsp-grid {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 4px;
    align-content: start;
}
.nsp-sticker {
    background: none;
    border: none;
    padding: 4px;
    border-radius: 8px;
    cursor: pointer;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .1s, transform .1s;
}
.nsp-sticker:hover { background: var(--bg-hover); transform: scale(1.1); }
.nsp-sticker img { width: 100%; height: 100%; object-fit: contain; }
.nsp-footer {
    padding: 6px 8px;
    border-top: 0.5px solid var(--border);
    text-align: right;
    flex-shrink: 0;
}
.nsp-browse-btn {
    font-size: 12px;
    color: var(--accent);
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 6px;
}
.nsp-loading, .nsp-empty {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-secondary);
    font-size: 13px;
}

/* Sticker pack cards */
.sticker-pack-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 0.5px solid var(--border);
}
.sticker-pack-card:last-child { border-bottom: none; }
.spc-cover img { border-radius: 8px; width: 48px; height: 48px; object-fit: cover; }
.spc-info { flex: 1; min-width: 0; }
.spc-title { font-size: 14px; font-weight: 500; color: var(--text-primary); }
.spc-meta { font-size: 12px; color: var(--text-secondary); }

/* ── GIF Picker ─────────────────────────────────────────── */
.nx-gif-picker {
    position: fixed;
    z-index: 1200;
    height: 380px;
    background: var(--bg-overlay);
    border: 0.5px solid var(--border-strong);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: nx-ep-fade 0.15s ease-out;
}
.ngp-search-wrap {
    padding: 8px;
    border-bottom: 0.5px solid var(--border);
    flex-shrink: 0;
}
.ngp-search {
    width: 100%;
    padding: 7px 10px;
    font-size: 13px;
    background: var(--bg-secondary);
    border: 0.5px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    outline: none;
}
.ngp-search:focus { border-color: var(--accent); }
.ngp-grid {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    align-content: start;
}
.ngp-item {
    background: none;
    border: none;
    padding: 0;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 4/3;
}
.ngp-item:hover { opacity: 0.85; transform: scale(1.02); }
.ngp-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.ngp-loading {
    grid-column: 1/-1;
    text-align: center;
    padding: 24px;
    color: var(--text-secondary);
    font-size: 13px;
}

/* ── Keyboard shortcuts modal ───────────────────────────── */
#kb-shortcuts-overlay table tr:nth-child(odd) td:first-child {
    color: var(--accent);
}
