.modalOverlay {
  position: fixed;
  inset: 0;
  background-color: rgb(0 0 0 / 70%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal {
  background: var(--spice-card);
  border-radius: 8px;
  width: 90%;
  max-width: 700px;
  max-height: 75vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalSlideIn 0.2s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modalHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px 12px;
  border-bottom: 1px solid var(--spice-button-disabled);
}

.modalTitle {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--spice-text);
}

.modalBody {
  padding: 8px 24px 24px;
  overflow-y: auto;
  max-height: calc(90vh - 70px);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sectionTitle {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--spice-text);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.statsOverview {
  margin-bottom: 12px;
}

.statItem {
  background: var(--spice-main);
  padding: 12px;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.statLabel {
  font-size: 12px;
  color: var(--spice-subtext);
  margin-bottom: 4px;
}

.statValue {
  font-size: 24px;
  font-weight: 700;
  color: var(--spice-text);
}

.tagDistribution {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.distributionItem {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tagName {
  width: 120px;
  font-size: 13px;
  font-weight: 500;
  color: var(--spice-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tagCount {
  width: 40px;
  font-size: 13px;
  color: var(--spice-subtext);
  text-align: right;
}

.tagBar {
  flex: 1;
  height: 8px;
  background: var(--spice-button-disabled);
  border-radius: 4px;
  overflow: hidden;
}

.tagBarFill {
  height: 100%;
  background: var(--spice-notification);
  border-radius: 4px;
}

.infoText {
  margin: 0;
  font-size: 14px;
  color: var(--spice-subtext);
}

.chartSection {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.bpmDistribution,
.energyDistribution {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rangeName,
.energyLevel {
  width: 80px;
  font-size: 13px;
  font-weight: 500;
  color: var(--spice-text);
  white-space: nowrap;
}

.rangeCount,
.energyCount {
  width: 40px;
  font-size: 13px;
  color: var(--spice-subtext);
  text-align: right;
}

.rangeBar,
.energyBar {
  flex: 1;
  height: 8px;
  background: var(--spice-button-disabled);
  border-radius: 4px;
  overflow: hidden;
}

.rangeBarFill {
  height: 100%;
  background: #612eec;
  border-radius: 4px;
}

.energyBarFill {
  height: 100%;
  background: var(--spice-notification);
  border-radius: 4px;
}

.result {
  margin-top: 10px;
  margin-bottom: 16px;
  padding: 12px;
  border-radius: 4px;
  font-size: 14px;
}

.error {
  background-color: rgb(255 0 0 / 10%);
  color: #e74c3c;
}

/* Tab Navigation */
.navigationTabs {
  display: flex;
  border-bottom: 1px solid var(--spice-button-disabled);
}

.tabButton {
  background: transparent;
  border: none;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--spice-subtext);
  cursor: pointer;
  position: relative;
}

.activeTab {
  color: var(--spice-text);
}

.activeTab::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--spice-notification);
}

/* Primary action at the top */

.info {
  margin: 0;
  font-size: 14px;
  color: var(--spice-subtext);
  margin-bottom: 8px;
}

/* Tag sorting and filtering controls */
.tagControls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.tagSearch {
  flex: 1;
  max-width: 300px;
}

.tagSearchInput {
  width: 100%;
  padding: 8px 12px;
  border-radius: 4px;
  border: 1px solid var(--spice-button-disabled);
  background: var(--spice-main);
  color: var(--spice-text);
  font-size: 14px;
}

.tagSortControls {
  display: flex;
  align-items: center;
}

.sortLabel {
  font-size: 14px;
  color: var(--spice-subtext);
  margin-right: 8px;
}

.sortButton {
  background: transparent;
  border: 1px solid var(--spice-button-disabled);
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--spice-subtext);
  cursor: pointer;
  margin-left: 4px;
}

.activeSort {
  background: var(--spice-card);
  color: var(--spice-text);
  border-color: var(--spice-notification);
}

.tagResultsHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.tagResultsCount {
  font-size: 13px;
  color: var(--spice-subtext);
  margin: 0;
}

/* Pagination controls */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 20px;
}

.paginationButton {
  background-color: rgb(0 0 0 / 20%);
  color: var(--spice-text);
  flex: 1;
  max-width: 100px;
  text-align: center;
  border: none;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.paginationButton:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.paginationButton:hover:not(:disabled) {
  background-color: rgb(255 255 255 / 10%);
}

.pageInfo {
  margin: 0 16px;
  font-size: 14px;
  color: var(--spice-text);
}

.noResults {
  padding: 20px;
  text-align: center;
  color: var(--spice-subtext);
  font-style: italic;
}

/* Rating visualization */
.ratingDistribution {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ratingLevel {
  width: 80px;
  font-size: 13px;
  color: var(--spice-text);
  white-space: nowrap;
}

.ratingCount {
  width: 40px;
  font-size: 13px;
  color: var(--spice-subtext);
  text-align: right;
}

.ratingBar {
  flex: 1;
  height: 8px;
  background: var(--spice-button-disabled);
  border-radius: 4px;
  overflow: hidden;
}

.ratingBarFill {
  height: 100%;
  background: #f1c40f;
  border-radius: 4px;
}
