/**
 * SheetSelector Styles
 * 
 * Dropdown selector for switching between component sheets
 * Using design tokens for proper theming support
 */

.SheetSelector {
  position: relative;
  display: flex;
  align-items: center;
}

.TriggerButton {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background-color: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--theme-color-fg-default);
  font: 11px var(--font-family-regular);
  cursor: pointer;
  transition: all var(--speed-turbo);

  &:hover {
    background-color: var(--theme-color-bg-2);
    border-color: var(--theme-color-border-default);
  }

  &.Open {
    background-color: var(--theme-color-bg-2);
    border-color: var(--theme-color-primary);
  }
}

.SheetName {
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ChevronIcon {
  width: 10px;
  height: 10px;
  transition: transform var(--speed-turbo);

  &.Open {
    transform: rotate(180deg);
  }
}

.Dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 160px;
  max-width: 200px;
  background-color: var(--theme-color-bg-2);
  border: 1px solid var(--theme-color-border-default);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  overflow: hidden;
}

.SheetList {
  max-height: 200px;
  overflow-y: auto;
  padding: 4px 0;
}

.SheetItem {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font: 11px var(--font-family-regular);
  color: var(--theme-color-fg-default);
  transition: background-color var(--speed-turbo);

  &:hover {
    background-color: var(--theme-color-bg-3);
  }

  &.Selected {
    background-color: var(--theme-color-primary-transparent);
    color: var(--theme-color-primary);
  }

  &.AllSheets {
    color: var(--theme-color-fg-default-shy);
    font-style: italic;
  }
}

.RadioIndicator {
  width: 12px;
  height: 12px;
  border: 1px solid var(--theme-color-border-default);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;

  &.Selected {
    border-color: var(--theme-color-primary);

    &::after {
      content: '';
      width: 6px;
      height: 6px;
      background-color: var(--theme-color-primary);
      border-radius: 50%;
    }
  }
}

.SheetLabel {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.SheetCount {
  color: var(--theme-color-fg-muted);
  font-size: 10px;
}

.Divider {
  height: 1px;
  background-color: var(--theme-color-border-default);
  margin: 4px 0;
}

.AddSheetButton {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  background-color: transparent;
  border: none;
  cursor: pointer;
  font: 11px var(--font-family-regular);
  color: var(--theme-color-fg-default);
  transition: background-color var(--speed-turbo);

  &:hover {
    background-color: var(--theme-color-bg-3);
  }
}

.AddIcon {
  width: 12px;
  height: 12px;
  color: var(--theme-color-fg-default);
}

/* Sheet Actions (three-dot menu) */
.SheetActions {
  position: relative;
  margin-left: auto;
  opacity: 0;
  transition: opacity var(--speed-turbo);

  &.Visible {
    opacity: 1;
  }
}

.SheetItem.HasActions:hover .SheetActions {
  opacity: 1;
}

.ActionButton {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  background-color: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  color: var(--theme-color-fg-default);
  transition: background-color var(--speed-turbo);

  &:hover {
    background-color: var(--theme-color-bg-3);
  }
}

.ActionMenu {
  position: absolute;
  bottom: 100%;
  right: 0;
  min-width: 100px;
  background-color: var(--theme-color-bg-2);
  border: 1px solid var(--theme-color-border-default);
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  z-index: 1001;
  overflow: hidden;
}

.ActionMenuItem {
  display: block;
  width: 100%;
  padding: 6px 12px;
  background-color: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  font: 11px var(--font-family-regular);
  color: var(--theme-color-fg-default);
  transition: background-color var(--speed-turbo);

  &:hover {
    background-color: var(--theme-color-bg-3);
  }

  &.Danger {
    color: var(--theme-color-danger);

    &:hover {
      background-color: var(--theme-color-danger-transparent);
    }
  }
}
