/* ════════════════════════════════════════════════════════════════
   institutionsearchauto.css
   Estilos del componente $.fn.findInstitution (autocomplete de
   instituciones). Mirror visual de citysearchauto.css con el
   ícono y palette para universidades.
═══════════════════════════════════════════════════════════════════ */

.schinst-container {
    width: 100%;
    position: relative;
    font-family: 'Inter','Segoe UI','Open Sans',system-ui,sans-serif;
}

.schinst-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.schinst-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary, #2a3a58);
    letter-spacing: .2px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.schinst-label i { color: var(--primary, #1565c0); font-size: 12px; }

.schinst-control {
    position: relative;
    width: 100%;
}

.schinst-input-main {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 36px 9px 34px;
    border: 1px solid var(--border, #e8ecf4);
    background: var(--bg-page, #f4f7fb);
    border-radius: 8px;
    font-size: 13.5px;
    color: var(--text-primary, #2a3a58);
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.schinst-input-main:focus {
    border-color: var(--primary, #1565c0);
    background: var(--bg-surface, #fff);
    box-shadow: 0 0 0 3px var(--primary-soft, #e3f2fd);
}
.schinst-input-main::placeholder { color: var(--text-muted, #90a0bd); }

.schinst-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted, #90a0bd);
    font-size: 13px;
    pointer-events: none;
}
.schinst-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted, #90a0bd);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    transition: color .15s ease;
}
.schinst-clear:hover { color: var(--danger, #d33); }

/* Estado seleccionado (chip compacto) */
.schinst-selected-view {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 38px 9px 14px;
    background: var(--bg-surface, #fff);
    border: 1px solid var(--primary-soft, #e3f2fd);
    border-radius: 8px;
    position: relative;
    box-shadow: var(--shadow-sm, 0 2px 6px rgba(20,25,40,.06));
}
.schinst-selected-view .schinst-sel-pin {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--primary-soft, #e3f2fd);
    color: var(--primary, #1565c0);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}
.schinst-selected-view .schinst-sel-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1;
}
.schinst-selected-view .schinst-sel-name {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-primary, #2a3a58);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.schinst-selected-view .schinst-sel-loc {
    font-size: 11px;
    color: var(--text-secondary, #7a8aa3);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.schinst-selected-view .schinst-sel-loc i { font-size: 9px; margin-right: 3px; opacity: .8; }

/* Dropdown de resultados */
.schinst-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 1050;
    background: var(--bg-surface, #fff);
    border: 1px solid var(--border, #e8ecf4);
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(20,25,40,.14);
    max-height: 320px;
    overflow: hidden;
}
.schinst-dropdown.hidden { display: none; }

.schinst-results {
    max-height: 320px;
    overflow-y: auto;
}
.schinst-results::-webkit-scrollbar { width: 6px; }
.schinst-results::-webkit-scrollbar-thumb {
    background: var(--border, #e8ecf4);
    border-radius: 3px;
}

.schinst-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-soft, #eef0f5);
    transition: background .12s ease;
}
.schinst-item:last-child { border-bottom: none; }
.schinst-item:hover, .schinst-item.is-active {
    background: var(--primary-soft, #e3f2fd);
}
.schinst-item-pin {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--bg-page, #f4f7fb);
    color: var(--primary, #1565c0);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}
.schinst-item-body {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.schinst-item-name {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary, #2a3a58);
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.schinst-item-meta {
    font-size: 11px;
    color: var(--text-secondary, #7a8aa3);
    line-height: 1.25;
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
}
.schinst-item-meta span { display: inline-flex; align-items: center; gap: 4px; }
.schinst-item-meta i { font-size: 9px; opacity: .8; }

/* Vacío / Cargando */
.schinst-empty, .schinst-loading {
    padding: 18px 14px;
    text-align: center;
    color: var(--text-muted, #90a0bd);
    font-size: 12.5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.schinst-empty i, .schinst-loading i {
    font-size: 22px;
    color: var(--primary, #1565c0);
    opacity: .5;
}
.schinst-loading i { animation: schinstSpin 1s linear infinite; }
@keyframes schinstSpin {
    to { transform: rotate(360deg); }
}
