/* ═══════════════════════════════════════════════
   nexus-modals.css  —  Overlay, panel, avatar/name
   ═══════════════════════════════════════════════ */

/* ── Overlay ── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(7,6,16,0.82);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    overflow-y: auto;
}
.modal-overlay.active { display: flex; }

/* ── Panel ── */
.modal-panel {
    background: #0f0e24;
    border: 1px solid rgba(99,102,241,0.25);
    border-radius: 20px;
    padding: 2rem;
    width: 100%;
    max-width: 820px;
    max-height: calc(100dvh - 2rem);
    overflow-y: auto;
    box-shadow: 0 24px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(99,102,241,0.1);
    position: relative;
    animation: modalIn 0.3s ease-out;
    scrollbar-width: thin;
    scrollbar-color: rgba(99,102,241,0.4) transparent;
}
.modal-panel::-webkit-scrollbar       { width: 4px; }
.modal-panel::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.4); border-radius: 4px; }

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.94) translateY(16px) }
    to   { opacity: 1; transform: scale(1)    translateY(0) }
}

/* ── Header ── */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.75rem;
}
.modal-title { font-size: 1.5rem; font-weight: 700; color: #fff; }
.modal-title .accent {
    background: linear-gradient(90deg, #818cf8, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.modal-close {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: #94a3b8;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.modal-close:hover { background: rgba(255,255,255,0.12); color: #fff; }

/* ── Section labels ── */
.setup-label {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #818cf8;
    margin-bottom: 0.65rem;
    display: block;
}

/* ── Avatar + name top row ── */
.setup-top-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.name-section { display: flex; flex-direction: column; justify-content: center; min-width: 180px; }

.host-name-input {
    background: rgba(255,255,255,0.05);
    border: 1.5px solid rgba(99,102,241,0.3);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    color: #e6eef8;
    font-family: inherit;
    font-size: 1rem;
    width: 100%;
    outline: none;
    transition: border-color 0.2s;
}
.host-name-input:focus       { border-color: #6366f1; }
.host-name-input::placeholder { color: #4b5563; }

/* ── Avatar arrow picker ── */
.avatar-picker {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.avatar-arrow {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    border: 1.5px solid rgba(99,102,241,0.35);
    color: #818cf8;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.15s;
    flex-shrink: 0;
}
.avatar-arrow:hover  { background: rgba(99,102,241,0.18); transform: scale(1.1); color: #fff; }
.avatar-arrow:active { transform: scale(0.95); }

.avatar-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}
.avatar-display img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2.5px solid #818cf8;
    box-shadow: 0 0 0 3px rgba(129,140,248,0.25);
    background: rgba(99,102,241,0.1);
    transition: opacity 0.15s;
}
.avatar-counter {
    font-size: 0.72rem;
    color: #64748b;
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* ── Mobile overrides (modal system + avatar/name) ── */
@media (max-width: 600px) {
    .modal-overlay  { padding: 0.5rem; align-items: flex-start; padding-top: max(0.5rem, env(safe-area-inset-top)); }
    .modal-panel    { padding: 1.1rem 1rem; border-radius: 16px; max-height: calc(100dvh - 1rem); }
    .modal-header   { margin-bottom: 1rem; }
    .modal-title    { font-size: 1.2rem; }
    .setup-top-row  { grid-template-columns: auto 1fr; gap: 0.85rem; margin-bottom: 1rem; align-items: center; }
    .name-section   { min-width: 0; }
    .avatar-display img { width: 62px; height: 62px; }
    .avatar-arrow   { width: 30px; height: 30px; font-size: 0.75rem; }
    .setup-label    { margin-bottom: 0.4rem; font-size: 0.72rem; }
}
