#sidebar-left {
  container-type: inline-size;
  container-name: sidebar;
  position: relative;
  background-color: #121212;
  color: white;
  padding: 0px;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  scrollbar-width: none; /* Firefox */
  transition: all 0.4s;
}

.sidebar-container {
  padding: 10px;
}

#sidebar-left::-webkit-scrollbar {
  display: none;
}

.top {
  top: 0;
  left: 0;
  right: 0;
  position: sticky;
  padding: 5px 0;
  background-color: #121212;
  width: 100%;
  z-index: 2;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  font-weight: 600;
}

.sidebar-header > div:nth-of-type(1) {
  margin-left: 5px;
}

.sidebar-main {
  margin-top: 0;
  overflow-y: auto; /* ✅ scroll only inside sections */
  -ms-overflow-style: none; /* IE/Edge scrollbar hidden */
  scrollbar-width: auto; /* Firefox */
  scrollbar-color: #1b1b1b #121212; /* Firefox thumb + track */
  transition: all 0.3s ease-in-out;
  position: relative;
}

.library-btn {
  /* display: flex; */
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: none;
  display: none;
}

.collapse-library-btn svg {
  width: 18px !important;
}

.icon-wrapper svg {
  width: 26px;
  height: 26px;
  /* transform: translate(-6px, -1px); */
}

.library-actions {
  margin-right: 15px;
}

.library-actions button {
  background-color: #1f1f1f;
  color: white;
  font-size: 15px;
  margin-left: 10px;
  cursor: pointer;
  width: auto;
  padding: 8px 10px;
  color: white;
  -webkit-text-stroke: 0;
}

.library-actions > button:nth-of-type(2) {
  background: none;
}

.library-actions > button:nth-of-type(1) > span {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  padding: 0 5px;
  display: none;
}

.library-filters {
  margin: 0;
  padding: 0;
  margin-top: 15px;
  display: flex;
  gap: 10px;
}

.chip {
  background-color: #1f1f1f;
  color: white;
  padding: 6px 10px;
  border-radius: 16px;
  cursor: pointer;
  font-size: 14px;
}

.library-view {
  display: flex;
  justify-content: space-between;
}

.library-search {
  display: flex;
  margin-top: 10px;
  max-width: 256px;
  /* background-color: #1f1f1f; */
  border-radius: 5px;
}

.library-search input {
  width: 100%;
  padding: 8px;
  border: none;
  color: white;
  border: 2px solid #2f2f2f;
  border-radius: 5px;
  display: inline-block;
}

.library-sort {
  margin-top: 10px;
}

.library-item:hover .play-button {
  display: flex; /* 👀 THIS LINE is what was missing */
}

.play-button:hover {
  background-color: #ffffff29;
}

.play-button:hover svg {
  background: none;
  transform: scale(1.5);
  transition: all 0.3s;
}

.sort-button,
.library-search-icon {
  display: flex;
  background: none;
  color: white;
  border: none;
  cursor: pointer;
  gap: 8px;
  opacity: 0.6;
  font-size: 14px;
}

.library-search-icon {
  padding: 0 11px;
  min-width: 18px;
  margin-right: 5px;
}

.library-items {
  margin-top: 5px;
  list-style: none;
  padding: 5px 0;
}

.library-item {
  position: relative;
  display: flex;
  gap: 10px;
  align-items: center;
  cursor: pointer;
  padding: 8px;
  border-radius: 5px;
}

.library-item:hover {
  background-color: #2f2f2f;
}

.library-item:hover img {
  opacity: 0.6;
}

.active-song {
  background-color: #1f1f1f;
}

.library-item img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 5px;
}

.play-button {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: none;
  border: none;
  padding: 12px;
  border-radius: 5px;
  cursor: pointer;
  display: none; /* 🫥 Hidden by default */
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.play-button .play-icon {
  width: 24px;
  height: 24px;
  fill: white;
}

.play-button svg {
  fill: white;
}

.icon-wrapper .item-info .title {
  font-weight: bold;
}

.item-info .subtitle {
  font-size: 12px;
  color: #aaa;
}

.collapse-library-btn {
  opacity: 0;
  transform: translate(-20px, 0);
  pointer-events: none;
  transition: all 0.3s ease;
  display: flex;
}

.top-title {
  transform: translate(-40px, 0);
  transition: all 0.3s ease;
  /* display: none; */
  display: flex;
  justify-content: start;
  align-items: center;
  height: 44px;
}

@container sidebar (min-width: 73px) {
  #sidebar-left:hover .collapse-library-btn {
    opacity: 1;
    transform: translate(-10px, 0);
    pointer-events: auto;
  }
  #sidebar-left:hover .top-title {
    transform: translate(-10px, 0);
  }
}

@container sidebar (min-width: 350px) {
  .library-actions > button:nth-of-type(1) > span {
    display: inline-block;
  }
}

@container sidebar (max-width: 349px) {
  .library-actions > button:nth-of-type(1) {
    padding: 8px;
    margin-left: 8px;
    margin-top: 0;
  }
  .library-actions {
    margin-top: 0;
  }
}

@container sidebar (max-width: 384px) {
  .library-search input {
    display: none;
  }
}

@container sidebar (max-width: 72px) {
  .collapse-library-btn {
    display: none !important;
  }
  .sidebar-container {
    padding: 5px;
    padding-bottom: 15px;
  }

  .sidebar-header {
    display: flex;
    flex-direction: column;
    gap: 5px;
  }

  .library-btn {
    display: flex;
  }

  .library-btn:hover #l-icon {
    display: none;
  }

  .library-btn:hover #l-exp {
    display: block;
  }

  .library-item {
    padding: 5px 2px;
    margin: 0;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    /* padding-top: 7px; */
    margin-bottom: 5px;
  }
  .library-items {
    margin-top: 0;
    padding-top: 0;
  }
  #l-exp,
  .item-info,
  .top-title,
  .resize,
  .library-filters,
  .library-view {
    display: none;
  }
  .library-actions {
    margin-top: 36px;
    margin: 0;
  }
  .library-actions > button:nth-of-type(1) {
    margin: 0;
  }
}
