button,
.button,
.hs-button,
.btn {
  cursor: pointer;
  display: inline-block;
  text-align: center;
  transition: var(--transition-fast, 150ms ease);
  white-space: normal;
  /* Mobile-first: Larger touch targets */
  min-height: 44px; /* iOS minimum touch target */
  min-width: 44px;
  padding: 0.625rem 1.25rem; /* Adjusted for 44px height */
  font-weight: 500;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: var(--radius-sm, 0.25rem);
  line-height: 1.5;
  /* Better mobile tap feedback */
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(0, 102, 204, 0.1);
}

@media (min-width: 768px) {
  button,
  .button,
  .hs-button,
  .btn {
    min-height: auto;
    padding: 0.5rem 1.5rem;
  }
}

button:disabled,
.button:disabled,
.hs-button:disabled,
.btn:disabled {
  background-color: var(--color-gray-300, #D0D0D0);
  border-color: var(--color-gray-300, #D0D0D0);
  color: var(--color-gray-200, #E6E6E6);
  cursor: not-allowed;
  opacity: 0.65;
}

/* Button hover effect - Desktop only */
@media (hover: hover) and (min-width: 768px) {
  .btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow, 0 4px 8px rgba(0, 0, 0, 0.1));
  }
}

/* Mobile tap feedback */
.btn:active {
  transform: translateY(0);
  opacity: 0.9;
}

/* Primary Button - Using CSS variables from theme */
.button,
.btn-primary {
  background-color: var(--color-primary);
  color: var(--color-primary-contrast);
  border: 2px solid var(--color-primary);
  font-weight: bold;
  display: inline-block;
  padding: 0.75rem 1.5rem;
  text-decoration: none;
  border-radius: var(--radius, 0.5rem);
  cursor: pointer;
  transition: var(--transition-fast, 150ms ease);
  font-size: 1rem;
  line-height: 1.5;
}

.button:hover,
.button:focus,
.btn-primary:hover,
.btn-primary:focus {
  /* Darken by using filter instead of color calculation */
  filter: brightness(0.85);
  color: var(--color-primary-contrast);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow, 0 4px 8px rgba(0, 0, 0, 0.15));
}

.button:active,
.btn-primary:active {
  /* Darken more for active state */
  filter: brightness(0.75);
  color: var(--color-primary-contrast);
  transform: translateY(0);
}

.btn-secondary {
  background-color: var(--color-secondary);
  color: var(--color-white, white);
  border-color: var(--color-secondary);
}

.btn-secondary:hover,
.btn-secondary:focus {
  filter: brightness(0.85);
  color: var(--color-white, white);
}

.btn-secondary:active {
  filter: brightness(0.75);
}

.btn-success {
  background-color: var(--color-success);
  color: var(--color-white, white);
  border-color: var(--color-success);
}

.btn-success:hover,
.btn-success:focus {
  filter: brightness(0.85);
  color: var(--color-white, white);
}

.btn-success:active {
  filter: brightness(0.75);
}

.btn-warning {
  background-color: var(--color-warning);
  color: var(--color-gray-900);
  border-color: var(--color-warning);
}

.btn-warning:hover,
.btn-warning:focus {
  filter: brightness(0.9);
  color: var(--color-gray-900);
}

.btn-warning:active {
  filter: brightness(0.8);
  color: var(--color-gray-900);
}

.btn-danger {
  background-color: var(--color-danger);
  color: var(--color-white, white);
  border-color: var(--color-danger);
}

.btn-danger:hover,
.btn-danger:focus {
  filter: brightness(0.85);
  color: var(--color-white, white);
}

.btn-danger:active {
  filter: brightness(0.75);
}

/* Button Sizes - Mobile optimized */
.btn-sm {
  min-height: 36px; /* Still touchable on mobile */
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
}

.btn-lg {
  min-height: 52px;
  padding: 0.75rem 1.5rem;
  font-size: 1.125rem;
}

@media (min-width: 768px) {
  .btn-sm {
    min-height: auto;
    padding: 0.25rem 0.75rem;
  }

  .btn-lg {
    min-height: auto;
    padding: 0.75rem 2rem;
  }
}

/* No button */

.no-button,
.no-button:hover,
.no-button:focus,
.no-button:active {
  background: none;
  border: none;
  border-radius: 0;
  color: initial;
  font-family: inherit;
  font-size: inherit;
  font-style: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  margin-bottom: 0;
  padding: 0;
  text-align: left;
  text-decoration: none;
  transition: none;
}
