/* track-list.css */

/* ---- root ---- */
.track-list {
  font-family: sans-serif;
  user-select: none;
  width: 100%;
  max-width: 320px;
  border: 1px solid red;
}

/* ---- header ---- */
.track-list__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  background: #20232a;
  color: #ffffff;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  transition: background 0.15s ease;
}

.track-list__header:hover {
  background: #282c34;
}

.track-list__arrow {
  width: 0;
  height: 0;
  border-left: 0.4rem solid transparent;
  border-right: 0.4rem solid transparent;
  border-top: 0.45rem solid #ffffff;
  transition: transform 0.2s ease;
}

.track-list__header.is-open .track-list__arrow {
  transform: rotate(180deg); /* point up when open */
}

.track-list__caption {
  font-weight: 600;
  flex: 1;
}

/* ---- list ---- */
.track-list__items {
  list-style: none;
  margin: 0.25rem 0 0;
  padding: 0;
  border-radius: 0.375rem;
  max-height: 240px;          /* scroll if long */
  overflow-y: auto;
  display: block;             /* toggled to none by JS */
}

.track-list__item {
  padding: 0.4rem 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.track-list__item:hover,
.track-list__item.is-active {
  background: #333;
  outline: none;
}

.track-list__item:focus-visible {
  outline: 2px solid #0078d4;
}
