@import 'bootstrap/scss/functions';
@import 'bootstrap/scss/variables';
@import 'bootstrap/scss/mixins';

:host {
  display: block;
  width: 100%;
}

.section-container {
  display: flex;
  width: 100%;
  margin-bottom: 2rem;
  align-items: baseline;
}

// Desktop version styles
.desktop-version {
  .section-header {
    display: flex;
    align-items: center;
    margin-right: 2rem;
    cursor: default;
  }
}

// Mobile version styles
.mobile-version {
  flex-direction: column;
  margin-bottom: 0;
  border: 1px solid #dee2e6;

  .section-header {
    all: unset;
    width: 100%;
    background-color: #ffc107;
    padding: 0.5rem 1rem;
    margin: 0;
    justify-content: space-between;
    align-items: center;
    border: none;
    display: flex;
    box-sizing: border-box;
    cursor: pointer;
  }

  .chevron-icon {
    display: flex;
    align-items: center;

    svg {
      width: 20px;
      height: 20px;
      transition: transform 0.3s ease-in-out;
    }
  }

  .section-nav {
    max-height: 0;
    overflow: hidden;
    transition:
      max-height 0.3s ease-in-out,
      padding 0.3s ease-in-out;
    background-color: #fff;
    width: 100%;
    padding: 0 1rem;
    margin: 0;
    box-sizing: border-box;

    ul {
      flex-direction: column;
      gap: 0;
    }
  }

  &.expanded {
    .section-nav {
      max-height: 500px;
      padding: 0.5rem 1rem;
    }

    .chevron-icon svg {
      transform: rotate(180deg);
    }
  }
}

// Shared styles
.section-nav {
  flex-grow: 1;

  ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 2rem;
    list-style-type: none;
    padding: 0;
    margin: 0;
  }

  li {
    margin: 0;
    padding: 0;
  }
}

// Header slot styling
::slotted([slot='header']) {
  // Desktop styling
  .desktop-version & {
    padding-left: 0.5rem;
    border-left: 4px solid #ffc107;
  }

  // Mobile styling (no border/padding)
  .mobile-version & {
    padding-left: 0;
    border-left: none;
  }
}

// Nav items styling for mobile
.mobile-version ::slotted([slot='nav-items']) {
  margin-bottom: 0.5rem;
}
