/* 
  Button component styles
  Core styling for buttons throughout the application
*/
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  font-weight: var(--semibold);
  white-space: nowrap;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--duration-normal) var(--easing-ease-out);

  // Default states
  &:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
  }

  &:active {
    transform: translateY(0);
    box-shadow: var(--shadow-standard);
  }

  &:disabled,
  &.disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: var(--shadow-standard) !important;
  }

  // Sizing
  &.btn-sm {
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
    gap: 0.3rem;
  }

  &.btn-md {
    font-size: 0.875rem;
    padding: 0.6rem 1.2rem;
    gap: 0.5rem;
  }

  &.btn-lg {
    font-size: 1rem;
    padding: 0.8rem 1.5rem;
    gap: 0.6rem;
  }

  // Variants
  &.btn-primary {
    background-color: var(--primary-color);
    color: var(--text-heavy);

    &:hover {
      background-color: var(--primary-color);
      box-shadow: 0 6px 14px rgba(var(--primary-color), 0.3);
    }
  }

  &.btn-secondary {
    background-color: var(--border-soft);
    color: var(--text-primary);

    &:hover {
      background-color: var(--border);
      box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
    }
  }

  &.btn-success {
    background-color: var(--success);
    color: var(--text-heavy);

    &:hover {
      background-color: var(--success-light);
      box-shadow: 0 6px 14px rgba(var(--success), 0.3);
    }
  }

  &.btn-danger {
    background-color: var(--danger);
    color: var(--text-heavy);

    &:hover {
      background-color: var(--danger-light);
      box-shadow: 0 6px 14px rgba(var(--danger), 0.3);
    }
  }

  &.btn-warning {
    background-color: var(--warning);
    color: var(--text-heavy);

    &:hover {
      background-color: var(--warning-light);
      box-shadow: 0 6px 14px rgba(var(--warning), 0.3);
    }
  }

  // Loading state
  &.btn-loading {
    position: relative;

    .btn-spinner {
      width: 1em;
      height: 1em;
      position: relative;
      margin-right: 0.5rem;

      .spinner {
        width: 100%;
        height: 100%;
        border: 2px solid rgba(255, 255, 255, 0.3);
        border-top-color: currentColor;
        border-radius: 50%;
        animation: spin 0.8s linear infinite;
      }
    }

    .btn-text {
      opacity: 0.7;
    }
  }

  // Icons
  .btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    &.btn-icon-left {
      margin-right: 0.1rem;
    }

    &.btn-icon-right {
      margin-left: 0.1rem;
    }
  }

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

// Animation for spinner
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
