/**
 * GESFEDECAT - Búsqueda Intel·ligent de Municipis de Catalunya
 * Estils per a l'autocomplete dels 947 municipis
 */

.gesf-mun-autocomplete-wrap {
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.gesf-mun-input-container {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.gesf-mun-icon-search {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    font-size: 14px;
    line-height: 1;
    z-index: 2;
}

.gesf-mun-autocomplete-wrap input.gesf-mun-input {
    width: 100% !important;
    padding-left: 36px !important;
    padding-right: 32px !important;
    box-sizing: border-box !important;
    transition: all 0.2s ease-in-out;
}

.gesf-mun-autocomplete-wrap input.gesf-mun-input:focus {
    outline: none;
    border-color: #4f46e5 !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15) !important;
}

.gesf-mun-clear-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: #e2e8f0;
    color: #64748b;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: all 0.15s ease;
    z-index: 2;
}

.gesf-mun-clear-btn:hover {
    background: #cbd5e1;
    color: #0f172a;
    transform: translateY(-50%) scale(1.1);
}

/* Floating Dropdown */
.gesf-mun-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.18), 0 8px 10px -6px rgba(15, 23, 42, 0.08);
    max-height: 270px;
    overflow-y: auto;
    z-index: 100005;
    margin: 0;
    padding: 6px 0;
    list-style: none;
    display: none;
    font-family: inherit;
    animation: gesfMunFadeIn 0.15s ease-out;
}

.gesf-mun-dropdown.gesf-mun-dropup {
    top: auto;
    bottom: calc(100% + 4px);
    box-shadow: 0 -10px 25px -5px rgba(15, 23, 42, 0.18), 0 -8px 10px -6px rgba(15, 23, 42, 0.08);
}

@keyframes gesfMunFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Custom Scrollbar */
.gesf-mun-dropdown::-webkit-scrollbar {
    width: 6px;
}
.gesf-mun-dropdown::-webkit-scrollbar-track {
    background: #f8fafc;
    border-radius: 0 12px 12px 0;
}
.gesf-mun-dropdown::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
.gesf-mun-dropdown::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Dropdown Item */
.gesf-mun-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 14px;
    cursor: pointer;
    font-size: 13.5px;
    color: #1e293b;
    transition: background-color 0.12s ease;
    border-left: 3px solid transparent;
}

.gesf-mun-item:hover,
.gesf-mun-item.gesf-mun-selected {
    background-color: #f1f5f9;
    border-left-color: #4f46e5;
    color: #0f172a;
}

.gesf-mun-name {
    font-weight: 500;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 10px;
}

.gesf-mun-match {
    font-weight: 800;
    color: #4338ca;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Province Badges */
.gesf-mun-badge {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 2.5px 8px;
    border-radius: 6px;
    white-space: nowrap;
    display: inline-block;
}

.gesf-mun-prov-barcelona {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.gesf-mun-prov-girona {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.gesf-mun-prov-lleida {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
}

.gesf-mun-prov-tarragona {
    background: #faf5ff;
    color: #7e22ce;
    border: 1px solid #e9d5ff;
}

/* Empty or Hint message */
.gesf-mun-empty {
    padding: 14px 16px;
    color: #64748b;
    font-size: 13px;
    text-align: center;
    font-style: italic;
}

.gesf-mun-hint {
    padding: 10px 14px;
    color: #64748b;
    font-size: 12px;
    background: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gesf-mun-count {
    background: #e2e8f0;
    color: #475569;
    font-weight: 700;
    font-size: 10.5px;
    padding: 1px 6px;
    border-radius: 10px;
}
