/**
 * MODAIS.CSS — Estilos Padrão para Componentes Modal
 */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-dialog {
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  max-width: 500px;
  width: 90%;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-lg {
  max-width: 700px;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #212529;
}

.btn-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #6c757d;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.btn-close:hover {
  color: #212529;
}

.modal-body {
  padding: 20px;
}

.search-input {
  border-radius: 6px;
  border: 1px solid #dee2e6;
  padding: 10px 14px;
  font-size: 14px;
  transition: all 0.2s;
}

.search-input:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
  outline: none;
}

.lista-resultados {
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 0;
}

.item-buscar {
  padding: 12px 16px;
  border: none;
  border-bottom: 1px solid #f1f3f5;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s;
  background: white;
}

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

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

.item-buscar.active {
  background-color: #e7f1ff;
  color: #0d6efd;
  font-weight: 500;
}

.item-buscar strong {
  display: block;
  margin-bottom: 4px;
}

.item-buscar small {
  display: block;
}

.alert {
  margin: 0;
  padding: 12px 14px;
  font-size: 13px;
}

.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}

.badge-info {
  background-color: #d1ecf1;
  color: #0c5460;
}

.badge-light {
  background-color: #e9ecef;
  color: #383d41;
}

.btn-criar-novo {
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-criar-novo:hover {
  background-color: #e7f1ff;
  border-color: #0d6efd;
  color: #0d6efd;
}

/* Responsivo */
@media (max-width: 768px) {
  .modal-dialog {
    max-width: 100%;
    border-radius: 8px 8px 0 0;
  }

  .modal-lg {
    max-width: 100%;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .modal-dialog {
    background: #2d2d2d;
    color: #e0e0e0;
  }

  .modal-header {
    border-bottom-color: #404040;
  }

  .modal-title {
    color: #e0e0e0;
  }

  .btn-close {
    color: #999;
  }

  .btn-close:hover {
    color: #e0e0e0;
  }

  .search-input {
    background-color: #3a3a3a;
    border-color: #404040;
    color: #e0e0e0;
  }

  .search-input::placeholder {
    color: #999;
  }

  .search-input:focus {
    border-color: #4a9eff;
  }

  .lista-resultados {
    border-color: #404040;
  }

  .item-buscar {
    background: #3a3a3a;
    border-bottom-color: #404040;
    color: #e0e0e0;
  }

  .item-buscar:hover {
    background-color: #454545;
  }

  .item-buscar.active {
    background-color: #1a3a52;
  }
}
