@use 'ui-design-system/src/styles/semantic/index' as *;

.ui-lp-feature-grid {
  padding: $semantic-spacing-layout-section-lg 0;
  background: $semantic-color-surface-primary;
  
  // Header Section
  &__header {
    text-align: center;
    margin-bottom: $semantic-spacing-layout-section-md;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
  }
  
  &__title {
    font-family: map-get($semantic-typography-heading-h2, font-family);
    font-size: map-get($semantic-typography-heading-h2, font-size);
    font-weight: map-get($semantic-typography-heading-h2, font-weight);
    line-height: map-get($semantic-typography-heading-h2, line-height);
    color: $semantic-color-text-primary;
    margin-bottom: $semantic-spacing-content-heading;
  }
  
  &__subtitle {
    font-family: map-get($semantic-typography-body-large, font-family);
    font-size: map-get($semantic-typography-body-large, font-size);
    font-weight: map-get($semantic-typography-body-large, font-weight);
    line-height: map-get($semantic-typography-body-large, line-height);
    color: $semantic-color-text-secondary;
    margin: 0;
  }
  
  // Grid Container
  &__items {
    display: grid;
    gap: $semantic-spacing-grid-gap-lg;
    
    // Column Variants
    &--auto {
      grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
    
    &--2 {
      grid-template-columns: repeat(2, 1fr);
    }
    
    &--3 {
      grid-template-columns: repeat(3, 1fr);
    }
    
    &--4 {
      grid-template-columns: repeat(4, 1fr);
    }
    
    // Responsive breakdowns
    @media (max-width: $semantic-breakpoint-lg - 1) {
      &--4 {
        grid-template-columns: repeat(2, 1fr);
      }
      
      &--3 {
        grid-template-columns: repeat(2, 1fr);
      }
    }
    
    @media (max-width: $semantic-breakpoint-md - 1) {
      &--2,
      &--3,
      &--4 {
        grid-template-columns: 1fr;
      }
      
      gap: $semantic-spacing-grid-gap-md;
    }
  }
  
  // Individual Item
  &__item {
    position: relative;
    cursor: pointer;
    transition: all $semantic-motion-duration-normal $semantic-motion-easing-ease;
    
    &:hover {
      transform: translateY(-2px);
    }
  }
  
  // Card Variant
  &--card &__item {
    padding: $semantic-spacing-component-xl;
    background: $semantic-color-surface-elevated;
    border-radius: $semantic-border-card-radius;
    box-shadow: $semantic-shadow-card-rest;
    
    &:hover {
      box-shadow: $semantic-shadow-card-hover;
    }
  }
  
  // Minimal Variant
  &--minimal &__item {
    padding: $semantic-spacing-component-lg;
    background: transparent;
    
    &:hover {
      background: $semantic-color-surface-hover;
      border-radius: $semantic-border-card-radius;
    }
  }
  
  // Bordered Variant
  &--bordered &__item {
    padding: $semantic-spacing-component-lg;
    background: $semantic-color-surface-primary;
    border: $semantic-border-width-1 solid $semantic-color-border-subtle;
    border-radius: $semantic-border-card-radius;
    
    &:hover {
      border-color: $semantic-color-primary;
    }
  }
  
  // Icon Styling
  &__icon {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: $semantic-sizing-icon-navigation;
    height: $semantic-sizing-icon-navigation;
    margin-bottom: $semantic-spacing-component-md;
    
    fa-icon,
    i {
      font-size: $semantic-sizing-icon-navigation;
      color: $semantic-color-primary;
    }
    
    .ui-lp-feature-grid--minimal & {
      margin-bottom: $semantic-spacing-component-sm;
    }
  }
  
  // Image Styling
  &__image {
    margin-bottom: $semantic-spacing-component-md;
    border-radius: $semantic-border-image-radius;
    overflow: hidden;
    
    img {
      width: 100%;
      height: 200px;
      object-fit: cover;
      transition: transform $semantic-motion-duration-normal $semantic-motion-easing-ease;
    }
    
    .ui-lp-feature-grid__item:hover & img {
      transform: scale(1.05);
    }
  }
  
  // Content Area
  &__content {
    display: flex;
    flex-direction: column;
    gap: $semantic-spacing-component-sm;
  }
  
  &__item-title {
    font-family: map-get($semantic-typography-heading-h4, font-family);
    font-size: map-get($semantic-typography-heading-h4, font-size);
    font-weight: map-get($semantic-typography-heading-h4, font-weight);
    line-height: map-get($semantic-typography-heading-h4, line-height);
    color: $semantic-color-text-primary;
    margin: 0;
  }
  
  &__description {
    font-family: map-get($semantic-typography-body-medium, font-family);
    font-size: map-get($semantic-typography-body-medium, font-size);
    font-weight: map-get($semantic-typography-body-medium, font-weight);
    line-height: map-get($semantic-typography-body-medium, line-height);
    color: $semantic-color-text-secondary;
    margin: 0;
    flex-grow: 1;
  }
  
  // Link Styling
  &__link {
    display: inline-flex;
    align-items: center;
    gap: $semantic-spacing-component-xs;
    font-family: map-get($semantic-typography-button-medium, font-family);
    font-size: map-get($semantic-typography-button-medium, font-size);
    font-weight: map-get($semantic-typography-button-medium, font-weight);
    line-height: map-get($semantic-typography-button-medium, line-height);
    color: $semantic-color-primary;
    text-decoration: none;
    margin-top: $semantic-spacing-component-sm;
    transition: all $semantic-motion-duration-fast $semantic-motion-easing-ease;
    
    &:hover {
      color: $semantic-color-primary-hover;
      gap: $semantic-spacing-component-sm;
    }
    
    &:focus-visible {
      outline: 2px solid $semantic-color-primary;
      outline-offset: 2px;
      border-radius: $semantic-border-button-radius;
    }
  }
  
  &__link-icon {
    font-size: $semantic-sizing-icon-button;
    transition: transform $semantic-motion-duration-fast $semantic-motion-easing-ease;
    
    .ui-lp-feature-grid__link:hover & {
      transform: translateX(2px);
    }
  }
  
  // Spacing Variants
  &--tight &__items {
    gap: $semantic-spacing-grid-gap-md;
  }
  
  &--loose &__items {
    gap: $semantic-spacing-grid-gap-xl;
  }
  
  // List Layout Variant
  &--list &__items {
    display: flex;
    flex-direction: column;
    gap: $semantic-spacing-component-lg;
  }
  
  &--list &__item {
    display: flex;
    align-items: flex-start;
    gap: $semantic-spacing-component-lg;
    
    .ui-lp-feature-grid__icon {
      flex-shrink: 0;
      margin-bottom: 0;
    }
    
    .ui-lp-feature-grid__content {
      flex: 1;
    }
  }
  
  // Animation States
  @media (prefers-reduced-motion: no-preference) {
    &__item {
      opacity: 0;
      transform: translateY(20px);
      animation: fadeInUp $semantic-motion-duration-slow $semantic-motion-easing-ease forwards;
      animation-delay: var(--animation-delay, 0ms);
    }
  }
  
  @media (prefers-reduced-motion: reduce) {
    &__item {
      opacity: 1;
      transform: none;
      animation: none;
    }
  }
}

// Animation Keyframes
@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}