/* /home/bettertech/SrvBetterOxy/oxy_auth/static/oxy_auth/select2-custom.css */
/* ===================================================
   Select2 Customizado - Cliente com Logo
   ================================================== */

/* Container principal do Select2 */
.select2-container--default .select2-selection--single {
    background-color: white;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    height: 48px;
    padding: 8px 12px;
    transition: all 0.2s ease;
}

.select2-container--default .select2-selection--single:hover {
    border-color: #9ca3af;
}

.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: #5829B4;
    box-shadow: 0 0 0 3px rgba(88, 41, 180, 0.1);
    outline: none;
}

/* Texto do placeholder */
.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #9ca3af;
    font-size: 0.875rem;
}

/* Texto selecionado */
.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #1f2937;
    line-height: 32px;
    padding-left: 0;
    font-size: 0.875rem;
}

/* Seta dropdown */
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 46px;
    right: 8px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #6b7280 transparent transparent transparent;
    border-width: 6px 5px 0 5px;
}

.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent #6b7280 transparent;
    border-width: 0 5px 6px 5px;
}

/* Dropdown container */
.select2-dropdown {
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    margin-top: 4px;
}

/* Campo de busca */
.select2-search--dropdown {
    padding: 8px;
    background-color: #f9fafb;
}

.select2-search--dropdown .select2-search__field {
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    padding: 8px 12px;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.select2-search--dropdown .select2-search__field:focus {
    border-color: #5829B4;
    outline: none;
    box-shadow: 0 0 0 3px rgba(88, 41, 180, 0.1);
}

/* Lista de resultados */
.select2-results {
    max-height: 300px;
}

.select2-results__options {
    max-height: 300px;
    overflow-y: auto;
}

/* Item da lista */
.select2-results__option {
    padding: 10px 12px;
    font-size: 0.875rem;
    transition: all 0.15s ease;
}

/* ===================================================
   CUSTOMIZA��O COM LOGO
   ================================================== */

/* Container do item com logo */
.select2-cliente-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 0;
}

/* Container da logo */
.select2-cliente-logo {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 6px;
    overflow: hidden;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
}

.select2-cliente-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}

/* �cone fallback quando n�o h� logo */
.select2-cliente-logo .fa-building {
    font-size: 18px;
    color: #9ca3af;
}

/* Informa��es do cliente */
.select2-cliente-info {
    flex: 1;
    min-width: 0; /* Permite truncar texto */
}

.select2-cliente-nome {
    font-weight: 500;
    color: #1f2937;
    font-size: 0.875rem;
    line-height: 1.4;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.select2-cliente-cnpj {
    font-size: 0.75rem;
    color: #6b7280;
    line-height: 1.2;
}

/* Estados do item */
.select2-results__option--highlighted[aria-selected] .select2-cliente-option {
    background-color: transparent;
}

.select2-results__option--highlighted[aria-selected] .select2-cliente-nome {
    color: white !important;
}

.select2-results__option--highlighted[aria-selected] .select2-cliente-cnpj {
    color: white !important;
    opacity: 0.9;
}

.select2-results__option--highlighted[aria-selected] .select2-cliente-logo {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.15);
}

.select2-results__option--highlighted[aria-selected] .select2-cliente-logo .fa-building {
    color: rgba(255, 255, 255, 0.9);
}

/* Item selecionado */
.select2-results__option[aria-selected="true"] {
    background-color: #f3f4f6 !important;
}

.select2-results__option[aria-selected="true"] .select2-cliente-nome {
    color: #5829B4;
    font-weight: 600;
}

/* Hover e foco */
.select2-results__option--highlighted[aria-selected] {
    background-color: #5829B4 !important;
}

/* Mensagem "Sem resultados" */
.select2-results__message {
    color: #6b7280;
    font-size: 0.875rem;
    padding: 12px;
    text-align: center;
}

/* Loading */
.select2-results__option.loading-results {
    color: #6b7280;
    text-align: center;
    padding: 16px;
}

/* Responsividade */
@media (max-width: 640px) {
    .select2-cliente-logo {
        width: 36px;
        height: 36px;
    }

    .select2-cliente-nome {
        font-size: 0.875rem;
    }

    .select2-cliente-cnpj {
        font-size: 0.75rem;
    }
}

/* Dark mode (se necess�rio no futuro) */
@media (prefers-color-scheme: dark) {
    /* Mant�m light mode mesmo no dark mode do sistema */
}

/* Anima��o de entrada do dropdown */
@keyframes select2-fadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.select2-dropdown {
    animation: select2-fadeIn 0.2s ease;
}

/* Scrollbar customizada */
.select2-results__options::-webkit-scrollbar {
    width: 8px;
}

.select2-results__options::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 4px;
}

.select2-results__options::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.select2-results__options::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Estado de erro */
.select2-container--error .select2-selection--single {
    border-color: #ef4444 !important;
}

.select2-container--error .select2-selection--single:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}
