/* =========================================
   BUTTONS.CSS - Estilo Twenty CRM
   HUB Consultores - Dark Mode Only
   ========================================= */

/* ==========================================
   1. RESET Y BASE
   ========================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
  font-weight: 500;
  font-size: 0.875rem;
  line-height: 1.5;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.6rem 1.25rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:focus {
  outline: none;
}

.btn:disabled,
.btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ==========================================
   2. BOTÓN PRIMARIO (Filled)
   ========================================== */
.btn-primary {
  background: #6366f1;
  border-color: #6366f1;
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
  background: #4f46e5;
  border-color: #4f46e5;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
  transform: translateY(-1px);
}

.btn-primary:active {
  background: #4338ca;
  border-color: #4338ca;
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-primary:focus-visible {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.4);
}

/* ==========================================
   3. BOTÓN SECUNDARIO (Outlined Dark)
   ========================================== */
.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #e2e8f0;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

.btn-secondary:active {
  background: rgba(255, 255, 255, 0.08);
}

.btn-secondary:focus-visible {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15);
}

/* ==========================================
   4. BOTÓN OUTLINE (Twenty Style)
   ========================================== */
.btn-outline,
.btn-outline-primary {
  background: transparent;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  color: #e2e8f0;
  border-radius: 10px;
}

.btn-outline:hover,
.btn-outline-primary:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: #6366f1;
  color: #a5b4fc;
}

.btn-outline:active,
.btn-outline-primary:active {
  background: rgba(99, 102, 241, 0.15);
}

.btn-outline:focus-visible,
.btn-outline-primary:focus-visible {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

/* ==========================================
   5. BOTÓN OUTLINE SECUNDARIO (Twenty Style)
   ========================================== */
.btn-outline-secondary {
  background: transparent;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  color: #94a3b8;
  border-radius: 10px;
}

.btn-outline-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.35);
  color: #e2e8f0;
}

.btn-outline-secondary:active {
  background: rgba(255, 255, 255, 0.08);
}

.btn-outline-secondary:focus-visible {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

/* ==========================================
   6. BOTÓN GHOST (Sin borde)
   ========================================== */
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: #94a3b8;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
}

.btn-ghost:active {
  background: rgba(255, 255, 255, 0.12);
}

/* ==========================================
   7. BOTÓN DANGER
   ========================================== */
.btn-danger {
  background: #ef4444;
  border-color: #ef4444;
  color: #ffffff;
}

.btn-danger:hover {
  background: #dc2626;
  border-color: #dc2626;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
  transform: translateY(-1px);
}

.btn-danger:active {
  background: #b91c1c;
  transform: translateY(0);
}

.btn-outline-danger {
  background: transparent;
  border: 1.5px solid rgba(239, 68, 68, 0.5);
  color: #f87171;
}

.btn-outline-danger:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
  color: #fca5a5;
}

/* ==========================================
   8. BOTÓN SUCCESS
   ========================================== */
.btn-success {
  background: #10b981;
  border-color: #10b981;
  color: #ffffff;
}

.btn-success:hover {
  background: #059669;
  border-color: #059669;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
  transform: translateY(-1px);
}

.btn-success:active {
  background: #047857;
  transform: translateY(0);
}

.btn-outline-success {
  background: transparent;
  border: 1.5px solid rgba(16, 185, 129, 0.5);
  color: #34d399;
}

.btn-outline-success:hover {
  background: rgba(16, 185, 129, 0.1);
  border-color: #10b981;
  color: #6ee7b7;
}

/* ==========================================
   9. TAMAÑOS
   ========================================== */
.btn-sm {
  font-size: 0.8rem;
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  gap: 0.35rem;
}

.btn-lg {
  font-size: 0.95rem;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  gap: 0.6rem;
}

.btn-xl {
  font-size: 1rem;
  padding: 0.875rem 2rem;
  border-radius: 12px;
  gap: 0.75rem;
}

/* ==========================================
   10. VARIANTES ESPECIALES
   ========================================== */

/* Botón con icono solamente */
.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 10px;
}

.btn-icon.btn-sm {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.btn-icon.btn-lg {
  width: 48px;
  height: 48px;
  border-radius: 12px;
}

/* Botón pill (bordes muy redondeados) */
.btn-pill {
  border-radius: 50px;
}

/* Botón block (ancho completo) */
.btn-block {
  width: 100%;
}

/* ==========================================
   11. GRUPO DE BOTONES (Twenty Style)
   ========================================== */
.btn-group {
  display: inline-flex;
  gap: 0;
}

.btn-group .btn {
  border-radius: 0;
}

.btn-group .btn:first-child {
  border-radius: 8px 0 0 8px;
}

.btn-group .btn:last-child {
  border-radius: 0 8px 8px 0;
}

.btn-group .btn:not(:first-child) {
  margin-left: -1px;
}

/* Grupo separado */
.btn-group-separated {
  display: inline-flex;
  gap: 0.5rem;
}

.btn-group-separated .btn {
  border-radius: 8px;
}

/* ==========================================
   12. ESTADOS DE CARGA
   ========================================== */
.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: btnSpinner 0.6s linear infinite;
}

.btn-primary.btn-loading::after {
  border-color: rgba(255, 255, 255, 0.3);
  border-right-color: transparent;
  border-top-color: #fff;
}

@keyframes btnSpinner {
  to {
    transform: rotate(360deg);
  }
}

/* ==========================================
   13. BOTONES CON ICONOS
   ========================================== */
.btn i,
.btn svg {
  font-size: 1em;
  flex-shrink: 0;
}

.btn-sm i,
.btn-sm svg {
  font-size: 0.85em;
}

.btn-lg i,
.btn-lg svg {
  font-size: 1.1em;
}

/* Icono a la derecha */
.btn-icon-right {
  flex-direction: row-reverse;
}

/* ==========================================
   14. ESTILOS ESPECÍFICOS FORMULARIOS
   ========================================== */

/* Botones de acción en formularios */
.form-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.form-actions-right {
  justify-content: flex-end;
}

.form-actions-between {
  justify-content: space-between;
}

.form-actions-center {
  justify-content: center;
}

/* ==========================================
   15. BOTONES EN CARDS/MODALES
   ========================================== */
.card-actions,
.modal-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 1rem;
}

.card-actions-right,
.modal-actions-right {
  justify-content: flex-end;
}

/* ==========================================
   16. EFECTOS HOVER ESPECIALES
   ========================================== */

/* Efecto glow */
.btn-glow:hover {
  box-shadow: 0 0 20px currentColor;
}

.btn-primary.btn-glow:hover {
  box-shadow: 0 0 25px rgba(99, 102, 241, 0.5);
}

/* Efecto scale */
.btn-scale:hover {
  transform: scale(1.02);
}

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