@use '../../themes/index' as *;
@use '../../abstracts/index' as *;

/*
  Sidebar component styles
*/
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background-color: var(--secondary-bg);
  border-right: 1px solid var(--border-dark);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  z-index: var(--z-elevate) + 1;
  @include custom-scrollbar;
}

.sidebar-header {
  margin-bottom: 1.5rem;
  padding: 0 0.5rem;

  h2 {
    color: var(--text-primary);
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.2px;
  }
}

.sidebar-section {
  margin-bottom: 0.5rem;
}

.sidebar-section-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 1rem;
  margin-bottom: 0.35rem;
}

.sidebar-section .filter-list {
  margin-bottom: 0.75rem;
}

.filter-list {
  list-style: none;
  margin-bottom: 0;

  li {
    transition:
      background-color var(--duration-normal) var(--easing-ease-out),
      color var(--duration-normal) var(--easing-ease-out);
    border-radius: var(--radius-md);
    padding: 0.65rem 1rem;
    margin-bottom: 0.15rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;

    &:hover {
      background-color: var(--tertiary-bg);
      color: var(--text-primary);
    }

    &.active {
      background-color: color-mix(in srgb, var(--primary-color) 16%, transparent);
      color: var(--primary-color);

      .filter-icon {
        color: var(--primary-color);
      }
    }

    // Ensure icons follow the resting text color when not active
    &:not(.active) .filter-icon {
      color: var(--text-secondary);
    }
  }
}

.filter-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;

  .filter-icon {
    flex-shrink: 0;
  }
}

// App logo styles
.app-logo {
  display: flex;
  align-items: center;
  gap: 10px;

  svg {
    width: 28px;
    height: 28px;
    fill: var(--text-primary);
  }
}

// Pinned to the bottom of the sidebar via margin-top: auto - version/build
// and a repo link, so this doesn't need its own page-section anymore
.sidebar-footer {
  margin-top: auto;
  padding: 0.85rem 1rem 0.25rem;
  border-top: 1px solid var(--border-dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-footer-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.sidebar-footer-version {
  font-family: monospace;
}

.sidebar-footer-link {
  font-size: 0.78rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--duration-normal) var(--easing-ease-out);

  &:hover {
    color: var(--primary-color);
  }
}
