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

.ui-lp-faq {
  padding: $semantic-spacing-layout-section-lg 0;
  
  &__header {
    text-align: center;
    margin-bottom: $semantic-spacing-layout-section-md;
  }
  
  &__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;
    max-width: 600px;
    margin: 0 auto;
  }
  
  &__search {
    max-width: 500px;
    margin: 0 auto $semantic-spacing-layout-section-sm auto;
  }
  
  &__items {
    max-width: 800px;
    margin: 0 auto;
  }
  
  &__item {
    border-bottom: 1px solid $semantic-color-border-subtle;
    
    &:last-child {
      border-bottom: none;
    }
  }
  
  &__question {
    width: 100%;
    padding: $semantic-spacing-component-lg $semantic-spacing-component-md;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all $semantic-motion-duration-fast $semantic-motion-easing-ease;
    
    &:hover {
      background: $semantic-color-surface-elevated;
    }
    
    &:focus-visible {
      outline: 2px solid $semantic-color-focus-ring;
      outline-offset: -2px;
    }
  }
  
  &__question-text {
    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-right: $semantic-spacing-component-md;
  }
  
  &__toggle-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: $semantic-color-text-secondary;
    transition: transform $semantic-motion-duration-fast $semantic-motion-easing-ease;
    flex-shrink: 0;
    
    svg {
      transform: rotate(180deg);
    }
  }
  
  &__item--open &__toggle-icon svg {
    transform: rotate(0deg);
  }
  
  &__answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height $semantic-motion-duration-normal $semantic-motion-easing-ease;
  }
  
  &__item--open &__answer {
    max-height: 500px; // Adjust based on content needs
  }
  
  &__answer-content {
    padding: 0 $semantic-spacing-component-md $semantic-spacing-component-lg $semantic-spacing-component-md;
    
    p {
      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;
    }
  }
  
  &__empty {
    text-align: center;
    padding: $semantic-spacing-layout-section-sm 0;
    
    p {
      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;
    }
  }
  
  // Theme Variants
  &--bordered {
    .ui-lp-faq__item {
      border: 1px solid $semantic-color-border-subtle;
      border-radius: $semantic-border-card-radius;
      margin-bottom: $semantic-spacing-component-md;
      
      &:last-child {
        margin-bottom: 0;
      }
    }
    
    .ui-lp-faq__question:hover {
      background: $semantic-color-surface-hover;
    }
  }
  
  &--minimal {
    .ui-lp-faq__question {
      padding: $semantic-spacing-component-md 0;
      
      &:hover {
        background: none;
        color: $semantic-color-primary;
      }
    }
    
    .ui-lp-faq__answer-content {
      padding: 0 0 $semantic-spacing-component-md 0;
    }
    
    .ui-lp-faq__item {
      border-bottom: 1px solid $semantic-color-border-subtle;
    }
  }
  
  // Responsive Design
  @media (max-width: $semantic-breakpoint-md - 1) {
    &__title {
      font-family: map-get($semantic-typography-heading-h3, font-family);
      font-size: map-get($semantic-typography-heading-h3, font-size);
      font-weight: map-get($semantic-typography-heading-h3, font-weight);
      line-height: map-get($semantic-typography-heading-h3, line-height);
    }
    
    &__question {
      padding: $semantic-spacing-component-md $semantic-spacing-component-sm;
    }
    
    &__question-text {
      font-family: map-get($semantic-typography-heading-h5, font-family);
      font-size: map-get($semantic-typography-heading-h5, font-size);
      font-weight: map-get($semantic-typography-heading-h5, font-weight);
      line-height: map-get($semantic-typography-heading-h5, line-height);
    }
    
    &__answer-content {
      padding: 0 $semantic-spacing-component-sm $semantic-spacing-component-md $semantic-spacing-component-sm;
    }
  }
}