@use '../../../css/_config/_mixins';
@use '../../../css/_config/_vars';

.wrap {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 555;
  // background: rgba(255, 0, 0, 0.1);

  @include mixins.electron-no-drag;

  &Inline {
    position: relative;
    top: 0;
    left: 0;
    right: auto;
    z-index: auto;
  }

  &WithoutLibrary {
    :global(html.electron.electron-platform-win) & {
      // left: 20px;
      // right: auto;
      top: 50px;
      right: 20px;
    }
  }

  &WithQueue {
    right: 300px;

    @media (min-width: 1024px) {
      right: 340px;
    }
  }
}

.overlay {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 554;

  .wrapInline & {
    z-index: auto;
  }
}

//
//
//

.status {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 6px;
  margin: 0 0 0 auto;
  background: var(--color-secondary-background);
  border: 1px solid var(--color-secondary-border);
  border-radius: 9px;
  box-shadow: var(--shadow-md);

  :global(.layout-content.cq-800) & {
    padding: 6px 6px 6px 15px;
  }

  @include mixins.focus-self-outline;

  &:hover {
    background: var(--color-secondary-hover);
  }

  .wrapInline & {
    flex-direction: row-reverse;
    width: 100%;
    background: var(--color-tertiary-background);
    border: 1px solid var(--color-tertiary-border);
    border-radius: 6px;
    box-shadow: none;
  }

  .wrapWithoutLibrary & {
    :global(html.electron.electron-platform-win) & {
      justify-content: flex-start;
      margin: 0 auto 0 0;
    }
  }
}

.thumb {
  overflow: hidden;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  background: var(--color-opacity-01);
  border-radius: 4px;

  :global(.layout-content.cq-800) & {
    margin-left: 12px;
  }

  .wrapInline & {
    width: 36px;
    height: 36px;
    margin-right: 12px;
  }

  img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

.thumbIcon {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 28px;
  height: 28px;
  opacity: var(--opacity-02);
}

.content {
  max-width: 160px;
  font-weight: 500;
  text-align: right;

  :global(.layout-content) & {
    display: none;
  }
  :global(.layout-content.cq-800) & {
    display: block;
  }

  .wrapInline & {
    flex: 0 0 auto;
    width: calc(100% - 48px);
    text-align: left;
  }
}

.library {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--color-opacity-05);
}

//
// DROPDOWN
//

.menu {
  overflow-y: auto;
  min-width: 100%;
  max-height: calc(100vh - 95px);
  max-height: calc(100svh - 95px);
  padding: 6px;
  margin: 5px 0 0 auto;
  background: var(--color-secondary-background);
  border: 1px solid var(--color-secondary-border);
  border-radius: 9px;
  box-shadow: var(--shadow-md);
  z-index: 555;
  font-size: 13px;
  line-height: 16px;
  text-align: left;

  &Inline {
    margin: 0 auto 0 6px;
    border-radius: 6px;
  }
}

.label {
  padding: 0 7px 2px;
  font-size: 9px;
  font-weight: bold;
  text-transform: uppercase;
  color: var(--color-opacity-04);

  .group:first-child & {
    padding-top: 4px;
  }

  :global(.electron-platform-win) & {
    font-weight: 600;
    letter-spacing: 0.04em;
  }
}

.group {
}

.separator {
  height: 1px;
  margin: 6px 6px;
  background: var(--color-secondary-border);
}

.button {
  display: flex;
  position: relative;
  align-items: center;
  width: 100%;
  min-width: 186px;
  // min-width: 206px;
  padding: 6px 40px 6px 8px;
  background: var(--color-secondary-background);
  border-radius: 4px;
  text-align: left;

  @include mixins.focus-self-fill;

  // &:first-child {
  //   border-top-left-radius: 9px;
  //   border-top-right-radius: 9px;

  //   .wrapInline & {
  //     border-top-left-radius: 6px;
  //     border-top-right-radius: 6px;
  //   }
  // }
  // &:last-child {
  //   border-bottom-left-radius: 9px;
  //   border-bottom-right-radius: 9px;

  //   .wrapInline & {
  //     border-bottom-left-radius: 6px;
  //     border-bottom-right-radius: 6px;
  //   }
  // }

  &.buttonLibrary {
    padding-left: 18px;
  }

  &.buttonCurrent {
    color: var(--color-core);
  }

  &:hover,
  &:focus {
    background: var(--color-secondary-hover);
  }

  .wrapInline & {
    padding-right: 36px;
    background: var(--color-opacity-0025);
    border-color: var(--color-opacity-01);

    &:hover,
    &:focus {
      background: var(--color-secondary-hover);
    }
  }
}

// .button + .button {
//   border-top: none;
// }

.iconBefore {
  display: block;
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  margin-right: 10px;
  opacity: var(--opacity-05);

  .buttonCurrent & {
    opacity: 1;
  }
}

.iconAfter {
  display: block;
  position: absolute;
  top: 50%;
  right: 9px;
  width: 14px;
  height: 14px;
  opacity: var(--opacity-05);
  transform: translateY(-50%);
}

.iconArrow {
  display: block;
  position: absolute;
  top: 50%;
  right: 8px;
  width: 10px;
  height: 10px;
  opacity: var(--opacity-05);
  transform: translateY(-50%);
}

.iconCurrent {
  opacity: 1;
  color: var(--color-core);
}

.iconHover {
  display: none;

  .button:hover &,
  .button:focus & {
    display: block;
  }
}
