/* ============================================================
   Multi-Select Dropdown Component - Styles
   ============================================================ */

.multi-select-dropdown {
  position: relative;
  width: 100%;
  max-width: 500px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Campo Principal (Trigger) */
.multi-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 36px;
  font-size: 13px;
}

.multi-select-trigger:hover {
  border-color: #1a56db;
  box-shadow: 0 0 0 2px rgba(26, 86, 219, 0.1);
}

.multi-select-trigger.active {
  border-color: #1a56db;
  box-shadow: 0 0 0 2px rgba(26, 86, 219, 0.1);
}

.multi-select-display {
  flex: 1;
  font-size: 13px;
  color: #9ca3af;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.multi-select-display.has-selection {
  color: #111827;
  font-weight: 500;
}

.multi-select-arrow {
  margin-left: 8px;
  font-size: 9px;
  color: #6b7280;
  transition: transform 0.2s;
}

.multi-select-trigger.active .multi-select-arrow {
  transform: rotate(180deg);
}

/* Dropdown Panel */
.multi-select-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  max-height: 320px;
  display: flex;
  flex-direction: column;
}

/* Campo de Busca */
.multi-select-search {
  padding: 8px;
  border-bottom: 1px solid #e5e7eb;
}

.multi-select-search-input {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

.multi-select-search-input:focus {
  border-color: #1a56db;
  box-shadow: 0 0 0 2px rgba(26, 86, 219, 0.1);
}

.multi-select-search-input::placeholder {
  color: #9ca3af;
}

/* Botões de Ação */
.multi-select-actions {
  display: flex;
  gap: 6px;
  padding: 6px 8px;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
}

.multi-select-btn {
  flex: 1;
  padding: 5px 10px;
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s;
}

.multi-select-btn:hover {
  background: #f3f4f6;
  border-color: #1a56db;
  color: #1a56db;
}

.multi-select-btn:active {
  transform: scale(0.98);
}

/* Lista de Opções */
.multi-select-options {
  overflow-y: auto;
  max-height: 200px;
}

.multi-select-option {
  display: flex;
  align-items: center;
  padding: 7px 10px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid #f3f4f6;
}

.multi-select-option:last-child {
  border-bottom: none;
}

.multi-select-option:hover {
  background: #f0f7ff;
}

.multi-select-checkbox {
  width: 16px;
  height: 16px;
  margin: 0;
  margin-right: 8px;
  cursor: pointer;
  flex-shrink: 0;
  accent-color: #1a56db;
}

.multi-select-label {
  font-size: 13px;
  color: #374151;
  user-select: none;
  flex: 1;
  line-height: 1.3;
}

.multi-select-option:hover .multi-select-label {
  color: #1a56db;
  font-weight: 500;
}

/* Scrollbar Customizada */
.multi-select-options::-webkit-scrollbar {
  width: 8px;
}

.multi-select-options::-webkit-scrollbar-track {
  background: #f3f4f6;
  border-radius: 0 6px 6px 0;
}

.multi-select-options::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 4px;
}

.multi-select-options::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* Estado Vazio */
.multi-select-empty {
  padding: 20px;
  text-align: center;
  color: #9ca3af;
  font-size: 13px;
}

/* Responsividade */
@media (max-width: 768px) {
  .multi-select-dropdown {
    max-width: 100%;
  }

  .multi-select-panel {
    max-height: 300px;
  }

  .multi-select-options {
    max-height: 180px;
  }

  .multi-select-actions {
    flex-direction: column;
  }

  .multi-select-btn {
    width: 100%;
  }
}

/* Animações */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.multi-select-panel {
  animation: slideDown 0.2s ease;
}

/* Estados de Foco */
.multi-select-trigger:focus-within {
  outline: 2px solid #1a56db;
  outline-offset: 2px;
}

/* Acessibilidade */
.multi-select-checkbox:focus {
  outline: 2px solid #1a56db;
  outline-offset: 2px;
}

.multi-select-option:focus-within {
  background: #f0f7ff;
}
