@use 'variables' as *;

// Button base mixin
@mixin button-base {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: $border-radius-sm;
  
  &:focus {
    outline: none;
    box-shadow: var(--box-shadow-sm);
  }
}

// Card hover effect mixin
@mixin card-hover {
  transition: all 0.3s ease;
  
  &:hover {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-lg);
  }
}

// Gradient text mixin
@mixin gradient-text($gradient) {
  background: $gradient;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

// Flex center mixin
@mixin flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

// Aspect ratio mixin
@mixin aspect-ratio($ratio: 1) {
  aspect-ratio: $ratio;
  
  @supports not (aspect-ratio: 1) {
    &::before {
      content: '';
      float: left;
      padding-top: calc(100% / #{$ratio});
    }
    
    &::after {
      content: '';
      display: table;
      clear: both;
    }
  }
}

// Responsive breakpoint mixins
@mixin mobile-only {
  @media (max-width: $mobile-breakpoint) { 
    @content;
  }
}

@mixin desktop-only {
  @media (min-width: $desktop-breakpoint) { 
    @content;
  }
}

// Common section patterns
@mixin section-container {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1rem;

  @include desktop-only {
    padding: 0 1.5rem;
  }
}

@mixin section-header {
  text-align: center;
  margin-bottom: 4rem;
}

@mixin section-title {
  font-size: 1.875rem;
  font-weight: bold;
  margin-bottom: 1rem;
  color: var(--color-text);

  @include desktop-only {
    font-size: 2.25rem;
  }
}

@mixin section-subtitle {
  font-size: 1.25rem;
  color: var(--color-text-muted);
  max-width: 48rem;
  margin: 0 auto;
}