/* ==========================================================================
   AIRH Buttons — Futuristic Neumorphism
   ========================================================================== */

/* ---------------------------------------------------------------------------
   Base Button — Neumorphic raised
   --------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-family);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  border: none;
  border-radius: var(--radius-md);
  padding: 0 var(--space-4);
  height: 36px;
  background: var(--color-bg-primary);
  color: var(--color-text-primary);
  box-shadow: var(--neu-raised-sm);
  transition: all 0.25s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  position: relative;
  text-decoration: none;
}

.btn:hover {
  box-shadow: var(--neu-raised);
  transform: translateY(-1px);
}

.btn:active {
  box-shadow: var(--neu-pressed);
  transform: translateY(0);
}

.btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------------------
   Primary — Gradient accent, raised
   --------------------------------------------------------------------------- */
.btn--primary {
  background: linear-gradient(135deg, var(--color-accent), #6366f1);
  color: #fff;
  box-shadow: var(--neu-raised-sm);
}

.btn--primary:hover {
  box-shadow: var(--neu-raised), 0 4px 14px rgba(35, 131, 226, 0.3);
  transform: translateY(-1px);
}

.btn--primary:active {
  box-shadow: inset 2px 2px 4px rgba(0,0,0,0.2), inset -2px -2px 4px rgba(255,255,255,0.1);
  transform: translateY(0);
}

/* ---------------------------------------------------------------------------
   Secondary — Soft raised
   --------------------------------------------------------------------------- */
.btn--secondary {
  background: var(--color-bg-primary);
  color: var(--color-text-primary);
  box-shadow: var(--neu-raised-sm);
}

.btn--secondary:hover {
  box-shadow: var(--neu-raised);
}

.btn--secondary:active {
  box-shadow: var(--neu-pressed);
}

/* ---------------------------------------------------------------------------
   Ghost — Flat, pressed on hover
   --------------------------------------------------------------------------- */
.btn--ghost {
  background: transparent;
  color: var(--color-text-secondary);
  box-shadow: none;
}

.btn--ghost:hover {
  box-shadow: var(--neu-inset-sm);
  color: var(--color-text-primary);
  transform: none;
}

.btn--ghost:active {
  box-shadow: var(--neu-pressed);
}

/* ---------------------------------------------------------------------------
   Outline — Inset look
   --------------------------------------------------------------------------- */
.btn--outline {
  background: var(--color-bg-primary);
  color: var(--color-accent);
  box-shadow: var(--neu-inset-sm);
}

.btn--outline:hover {
  box-shadow: var(--neu-inset);
  transform: none;
}

.btn--outline:active {
  box-shadow: var(--neu-pressed);
}

/* ---------------------------------------------------------------------------
   Danger — Red gradient
   --------------------------------------------------------------------------- */
.btn--danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #ffffff;
  box-shadow: var(--neu-raised-sm);
}

.btn--danger:hover {
  box-shadow: var(--neu-raised), 0 4px 14px rgba(239, 68, 68, 0.3);
  transform: translateY(-1px);
}

.btn--danger:active {
  box-shadow: inset 2px 2px 4px rgba(0,0,0,0.2);
  transform: translateY(0);
}

.btn--danger-outline {
  background: var(--color-bg-primary);
  color: var(--color-error);
  box-shadow: var(--neu-inset-sm);
}

.btn--danger-outline:hover {
  box-shadow: var(--neu-inset);
  transform: none;
}

/* ---------------------------------------------------------------------------
   Sizes
   --------------------------------------------------------------------------- */
.btn--sm {
  height: 30px;
  padding: 0 var(--space-3);
  font-size: var(--text-xs);
  border-radius: var(--radius-sm);
  gap: var(--space-1);
}

.btn--lg {
  height: 46px;
  padding: 0 var(--space-6);
  font-size: var(--text-md);
  border-radius: var(--radius-lg);
  gap: var(--space-3);
}

/* ---------------------------------------------------------------------------
   Icon Button
   --------------------------------------------------------------------------- */
.btn--icon {
  width: 36px;
  height: 36px;
  padding: 0;
}

.btn--icon.btn--sm { width: 30px; height: 30px; }
.btn--icon.btn--lg { width: 46px; height: 46px; }

.btn__icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn--lg .btn__icon { width: 20px; height: 20px; }
.btn--sm .btn__icon { width: 14px; height: 14px; }

/* ---------------------------------------------------------------------------
   Loading State
   --------------------------------------------------------------------------- */
.btn.is-loading {
  color: transparent !important;
  pointer-events: none;
}

.btn.is-loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-left-color: currentColor;
  border-radius: var(--radius-full);
  animation: btnSpinner 600ms linear infinite;
}

.btn--primary.is-loading::after {
  border-top-color: #fff;
  border-left-color: #fff;
}

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

/* ---------------------------------------------------------------------------
   Disabled
   --------------------------------------------------------------------------- */
.btn:disabled,
.btn.is-disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* Full Width */
.btn--full { width: 100%; }

/* ---------------------------------------------------------------------------
   Button Group
   --------------------------------------------------------------------------- */
.btn-group {
  display: inline-flex;
  align-items: center;
  box-shadow: var(--neu-raised-sm);
  border-radius: var(--radius-md);
}

.btn-group .btn {
  border-radius: 0;
  box-shadow: none;
}

.btn-group .btn:first-child { border-radius: var(--radius-md) 0 0 var(--radius-md); }
.btn-group .btn:last-child { border-radius: 0 var(--radius-md) var(--radius-md) 0; }
.btn-group .btn:hover { box-shadow: var(--neu-inset-sm); transform: none; }

/* ---------------------------------------------------------------------------
   FAB — Neumorphic floating
   --------------------------------------------------------------------------- */
.fab {
  position: fixed;
  bottom: calc(var(--space-6) + env(safe-area-inset-bottom, 0));
  right: var(--space-6);
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--color-accent), #6366f1);
  color: #fff;
  border: none;
  box-shadow: var(--neu-raised-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: var(--z-sticky);
  transition: all 0.25s ease;
}

.fab:hover {
  box-shadow: var(--neu-raised-lg), 0 6px 20px rgba(35, 131, 226, 0.35);
  transform: scale(1.06);
}

.fab:active {
  transform: scale(0.98);
}

.fab__icon { width: 24px; height: 24px; }

@media (max-width: 1023px) {
  .fab {
    bottom: calc(var(--bottom-nav-height) + var(--space-4) + env(safe-area-inset-bottom, 0));
  }
}

@media (max-width: 639px) {
  .btn--responsive-full { width: 100%; }
}
