/* Accordion Component Styles */

.ast-accordion {
  border-radius: 4px;
  overflow: hidden;
}

.ast-accordion--default {
  border: 1px solid #e0e0e0;
}

.ast-accordion--bordered .ast-accordion__item {
  border: 1px solid #e0e0e0;
  margin-bottom: 0.5rem;
  border-radius: 4px;
  overflow: hidden;

  &:last-child {
    margin-bottom: 0;
  }
}

.ast-accordion--flush {
  border: none;
}

.ast-accordion__item {
  position: relative;
  // Base item styles - extend as needed
}

.ast-accordion--default .ast-accordion__item:not(:last-child) {
  border-bottom: 1px solid #e0e0e0;
}

.ast-accordion--flush .ast-accordion__item:not(:last-child) {
  border-bottom: 1px solid #e0e0e0;
}

.ast-accordion__header {
  margin: 0;
}

.ast-accordion__trigger {
  width: 100%;
  padding: 1rem;
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1rem;
  font-weight: 500;
  color: #333;
  transition: all 0.2s ease;

  &:hover {
    background-color: #f8f9fa;
  }

  &:focus {
    outline: 2px solid #007bff;
    outline-offset: -2px;
    background-color: #f8f9fa;
  }

  &[aria-expanded="true"] {
    background-color: #f8f9fa;

    .ast-accordion__icon {
      transform: rotate(45deg);
    }
  }
}

.ast-accordion__title {
  flex: 1;
}

.ast-accordion__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  transition: transform 0.2s ease;
  color: #666;
}

.ast-accordion__content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;

  &[data-expanded="true"] {
    max-height: 1000px;
    /* Adjust based on your content needs */
  }
}

.ast-accordion__body {
  padding: 0 1rem 1rem 1rem;
  color: #666;
  line-height: 1.6;

  p {
    margin: 0;

    &:not(:last-child) {
      margin-bottom: 1rem;
    }
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .ast-accordion__trigger:focus {
    outline: 3px solid;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {

  .ast-accordion__trigger,
  .ast-accordion__icon,
  .ast-accordion__content {
    transition: none;
  }
}