/* Token Multi-Select — Coinbase-style searchable token picker (multi-select).
 *
 * Self-contained: borrows the visual language of the /swap token modal but uses
 * a `tms-` class prefix so it never collides with swap.html's `.td-*` styles and
 * carries no dependency on swap.css. Drop the markup + this stylesheet + the
 * token-multiselect.js component onto any page that needs to pick several tokens.
 *
 * Colors follow the frontend rules: BG #0a0e17/#0d1520, accent #00cfff,
 * borders rgba(0,150,255,0.15). No purple/indigo/amber.
 */

/* ---- Trigger + selected chips ---- */
.tms-field { display: flex; flex-direction: column; gap: 8px; }
.tms-trigger {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    width: 100%; padding: 10px 12px; min-height: 44px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 150, 255, 0.15);
    border-radius: 10px;
    color: #00cfff; cursor: pointer; font-size: 0.85rem; text-align: left;
    transition: border-color 0.15s, background 0.15s;
}
.tms-trigger:hover { border-color: #00cfff; }
.tms-trigger-label { color: rgba(0, 207, 255, 0.6); }
.tms-trigger-count {
    font-size: 0.75rem; padding: 2px 8px; border-radius: 10px;
    background: rgba(0, 207, 255, 0.12); border: 1px solid rgba(0, 207, 255, 0.25);
    color: #00cfff; white-space: nowrap;
}
.tms-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tms-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 6px 4px 4px; border-radius: 14px;
    background: rgba(0, 207, 255, 0.08); border: 1px solid rgba(0, 207, 255, 0.2);
    color: #fff; font-size: 0.78rem;
}
.tms-chip-icon {
    width: 18px; height: 18px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
    background: rgba(255, 255, 255, 0.06);
    display: flex; align-items: center; justify-content: center;
}
.tms-chip-icon img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.tms-chip-icon-fb { font-size: 0.6rem; font-weight: 700; color: #00cfff; }
.tms-chip-x {
    background: none; border: none; color: rgba(0, 207, 255, 0.6);
    cursor: pointer; font-size: 0.95rem; line-height: 1; padding: 0 2px;
}
.tms-chip-x:hover { color: #ff4444; }
.tms-chips-empty { color: rgba(0, 207, 255, 0.4); font-size: 0.8rem; }

/* ---- Modal ---- */
.tms-modal {
    display: none; position: fixed; inset: 0; z-index: 9998;
    background: rgba(0, 0, 0, 0.7);
    align-items: center; justify-content: center;
}
.tms-modal.active { display: flex; }
.tms-modal-inner {
    background: #0d1520;
    border: 1px solid rgba(0, 150, 255, 0.25);
    border-radius: 16px;
    width: 90%; max-width: 440px; max-height: 72vh;
    display: flex; flex-direction: column;
    box-shadow: 0 0 60px rgba(0, 207, 255, 0.06);
}
.tms-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1rem 1.25rem; border-bottom: 1px solid rgba(0, 150, 255, 0.12);
}
.tms-header h3 { color: #fff; font-size: 1rem; margin: 0; }
.tms-close {
    background: none; border: none; color: rgba(0, 207, 255, 0.4);
    font-size: 1.3rem; cursor: pointer; line-height: 1;
}
.tms-close:hover { color: #fff; }
.tms-search {
    margin: 0.75rem 1.25rem; padding: 0.6rem 0.85rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 150, 255, 0.15);
    border-radius: 10px; color: #fff; font-size: 0.85rem;
}
.tms-search:focus { border-color: #00cfff; outline: none; }
.tms-search::placeholder { color: rgba(0, 207, 255, 0.4); }
.tms-toolbar {
    display: flex; gap: 0.5rem; padding: 0 1.25rem 0.5rem; flex-wrap: wrap;
}
.tms-toolbar-btn {
    padding: 0.3rem 0.7rem; font-size: 0.75rem; min-height: 32px;
    background: rgba(17, 24, 39, 0.6);
    border: 1px solid rgba(0, 150, 255, 0.15);
    border-radius: 14px; color: rgba(0, 207, 255, 0.6); cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}
.tms-toolbar-btn:hover { border-color: #00cfff; color: #fff; }
.tms-list { flex: 1; overflow-y: auto; padding: 0 0.5rem 0.75rem; }
.tms-item {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.55rem 0.75rem; cursor: pointer;
    border-radius: 8px; transition: background 0.15s;
}
.tms-item:hover { background: rgba(0, 207, 255, 0.06); }
.tms-item.selected { background: rgba(0, 207, 255, 0.1); }
.tms-item-check {
    width: 18px; height: 18px; flex-shrink: 0; border-radius: 5px;
    border: 1px solid rgba(0, 150, 255, 0.3);
    display: flex; align-items: center; justify-content: center;
    color: #00cfff; font-size: 0.8rem;
}
.tms-item.selected .tms-item-check {
    background: rgba(0, 207, 255, 0.18); border-color: #00cfff;
}
.tms-item-icon {
    width: 32px; height: 32px; border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; flex-shrink: 0;
}
.tms-item-icon img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.tms-item-icon-fb { font-size: 0.75rem; font-weight: 700; color: #00cfff; }
.tms-item-info { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.tms-item-symbol { color: #fff; font-weight: 600; font-size: 0.9rem; }
.tms-item-name { color: rgba(0, 207, 255, 0.4); font-size: 0.75rem; }
.tms-status {
    padding: 0.5rem 1.25rem; font-size: 0.78rem; color: rgba(0, 207, 255, 0.4);
}
.tms-footer {
    padding: 0.75rem 1.25rem; border-top: 1px solid rgba(0, 150, 255, 0.12);
}
.tms-done-btn {
    width: 100%; padding: 0.7rem; border-radius: 10px; cursor: pointer;
    background: linear-gradient(135deg, #00cfff 0%, #007ab8 100%);
    border: none; color: #04121d; font-weight: 700; font-size: 0.9rem;
}
.tms-done-btn:hover { box-shadow: 0 4px 16px rgba(0, 207, 255, 0.25); }

@media (max-width: 640px) {
    .tms-item { min-height: 48px; }
    .tms-modal-inner { max-width: 100%; width: 100%; max-height: 100vh; border-radius: 0; height: 100%; }
    .tms-list { max-height: calc(100vh - 240px); }
}
