﻿/* Container principal - ESSENCIAL para posicionamento correto */
.angucomplete-holder {
    position: relative !important;
    display: inline-block; /* Evita problemas de width em tabelas */
    width: 100%;
}

/* Dropdown principal */
.angucomplete-dropdown {
    position: absolute !important;
    top: 100% !important; /* Removido o calc() desnecessário */
    left: 0 !important;
    right: 0 !important; /* Usar right ao invés de width para melhor responsividade */
    z-index: 999999 !important;
    background: white;
    border: 1px solid #ccc;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-height: 200px;
    overflow-y: auto;
    margin-top: 2px; /* Pequeno espaçamento do input */
    min-width: 250px; /* Largura mínima mais razoável */
}

/* Regra específica para quando o dropdown é reposicionado */
.angucomplete-alt .angucomplete-dropdown.repositioned {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
}

/* Regras específicas para tabelas */
td .angucomplete-holder,
th .angucomplete-holder {
    position: relative !important;
}

td .angucomplete-dropdown,
th .angucomplete-dropdown {
    z-index: 10000 !important;
    /* Garante que não vai quebrar o layout da tabela */
    white-space: nowrap;
}

/* Para células de tabela que contêm o componente */
td:has(.angucomplete-holder),
th:has(.angucomplete-holder) {
    position: relative;
    overflow: visible !important; /* Permite que o dropdown saia da célula */
}

/* Estados e elementos do dropdown */
.angucomplete-searching {
    color: #acacac;
    font-size: 14px;
    padding: 8px 12px;
    font-style: italic;
}

.angucomplete-description {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

.angucomplete-row {
    padding: 8px 12px;
    color: #000000;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

    .angucomplete-row:hover {
        background-color: #f8f9fa;
    }

    .angucomplete-row:last-child {
        border-bottom: none;
    }

.angucomplete-selected-row {
    background-color: #007bff !important;
    color: #ffffff !important;
}

    .angucomplete-selected-row:hover {
        background-color: #0056b3 !important;
    }

/* Elementos de imagem */
.angucomplete-image-holder {
    padding-top: 2px;
    float: left;
    margin-right: 10px;
    margin-left: 0;
}

.angucomplete-image {
    height: 34px;
    width: 34px;
    border-radius: 50%;
    border: 1px solid #ececec;
    object-fit: cover;
}

.angucomplete-image-default {
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    height: 34px;
    width: 34px;
    border-radius: 50%;
    border: 1px solid #ececec;
    background-color: #f8f9fa;
}

/* Fix para casos específicos onde o dropdown aparece fora do lugar */
.angucomplete-dropdown[style*="position: fixed"] {
    position: absolute !important;
}

/* Responsividade */
@media (max-width: 768px) {
    .angucomplete-dropdown {
        min-width: 200px;
        max-width: 90vw;
    }
}
