/* ============================================================
   CUSTOM DROPDOWN - Visual consistente com autocomplete
   Substitui <select> nativos por dropdowns customizados
   ============================================================ */

.custom-dropdown-wrapper {
    position: relative;
}

.custom-dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    cursor: pointer;
    text-align: left;
    min-height: calc(1.5em + 0.5rem + 2px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.custom-dropdown-trigger:hover {
    border-color: #86b7fe;
}

.custom-dropdown-trigger:focus,
.custom-dropdown-trigger.active {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.custom-dropdown-trigger .dropdown-arrow {
    margin-left: 0.5rem;
    font-size: 0.65rem;
    color: #6c757d;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.custom-dropdown-trigger.active .dropdown-arrow {
    transform: rotate(180deg);
}

.custom-dropdown-trigger .trigger-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-dropdown-trigger .trigger-text.placeholder-text {
    color: #6c757d;
}

.custom-dropdown-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1060;
    max-height: 280px;
    overflow-y: auto;
    background: white;
    border: 1px solid #ced4da;
    border-top: none;
    border-radius: 0 0 0.375rem 0.375rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: none;
}

.custom-dropdown-panel.show {
    display: block;
}

.custom-dropdown-group-header {
    padding: 6px 12px;
    font-weight: 600;
    font-size: 0.8rem;
    color: #495057;
    background-color: #e9ecef;
    border-bottom: 1px solid #dee2e6;
    pointer-events: none;
    user-select: none;
}

.custom-dropdown-item {
    padding: 7px 15px 7px 20px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.15s;
    font-size: 0.875rem;
    color: #212529;
}

.custom-dropdown-item:last-child {
    border-bottom: none;
}

.custom-dropdown-item:hover {
    background-color: #f8f9fa;
}

.custom-dropdown-item.selected {
    background-color: #e8f0fe;
    font-weight: 500;
}

.custom-dropdown-item-placeholder {
    padding: 7px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.15s;
    font-size: 0.875rem;
    color: #6c757d;
}

.custom-dropdown-item-placeholder:hover {
    background-color: #f8f9fa;
}

/* Scrollbar sutil */
.custom-dropdown-panel::-webkit-scrollbar {
    width: 6px;
}

.custom-dropdown-panel::-webkit-scrollbar-track {
    background: transparent;
}

.custom-dropdown-panel::-webkit-scrollbar-thumb {
    background-color: #ced4da;
    border-radius: 3px;
}

.custom-dropdown-panel::-webkit-scrollbar-thumb:hover {
    background-color: #adb5bd;
}
