@import '../../../styles/common.scss';

.row {
  display: grid;
  grid-template-columns: 50px auto;
  align-items: center;
  background-color: var(--accordion-item-row-background-color, $accordion-item-row-background-color);
  margin-top: 4px;
  height: 50px;
  cursor: pointer;
  color: var(--accordion-item-text-color, $accordion-item-text-color);
  transition: background-color 200ms cubic-bezier(0.4, 0, 0.2, 1) 0s;

  &:hover {
    background-color: var(
      --accordion-item-hover-color,
      $accordion-item-hover-color
    );
  }

  &.rowExpanded {
    background-color: var(--accordion-item-row-expanded-background-color, $accordion-item-row-expanded-background-color);
  }

  &.sticky {
    z-index: 1;
    position: sticky;
    top: 50px;
  }
}

.container {
  display: grid;
  transition: grid-template-rows 200ms cubic-bezier(0.4, 0, 0.2, 1);
  grid-template-rows: 0fr;

  &.expanded {
    grid-template-rows: 1fr;
    border-bottom: var(--accordion-item-border, $accordion-item-border);
    margin-top: 1px;
  }
}

.content {
  display: grid;
  grid-template-columns: 50px 1fr;
  align-items: center;
  background-color: var(
    --accordion-item-background-color,
    $accordion-item-background-color
  );
  color: var(--accordion-item-text-color, $accordion-item-text-color);
  overflow: hidden;
}

.button {
  svg {
    height: 40%;
    transition: transform 200ms cubic-bezier(0.4, 0, 0.2, 1);
  }

  svg * {
    stroke: var(--accordion-item-arrow-color, $accordion-item-arrow-color);
  }

  &.rotated > svg {
    transform: rotate(90deg);
  }
}
