@use "../../scss/globals.scss";

.settings-general {
  display: flex;
  flex-direction: column;
  gap: globals.$spacing-unit * 2;

  &__section-title {
    margin-top: calc(globals.$spacing-unit * 2);
    margin-bottom: globals.$spacing-unit;
  }

  &__common-redist-button {
    align-self: flex-start;
  }

  &__test-achievement-notification-button {
    align-self: flex-start;
  }

  &__disabled-hint {
    font-size: 13px;
    color: globals.$muted-color;
    margin-top: calc(globals.$spacing-unit * -1);
    font-style: italic;
  }

  &__volume-control {
    display: flex;
    flex-direction: column;
    gap: 12px;

    label {
      font-size: 14px;
      color: globals.$muted-color;
    }
  }

  &__volume-slider-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 200px;
    position: relative;
    --volume-percent: 0%;
  }

  &__volume-icon {
    color: globals.$muted-color;
    flex-shrink: 0;
  }

  &__volume-value {
    font-size: 14px;
    color: globals.$body-color;
    font-weight: 500;
    min-width: 40px;
    text-align: right;
    flex-shrink: 0;
  }

  &__volume-slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: globals.$dark-background-color;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: background 0.2s;

    &::-webkit-slider-thumb {
      -webkit-appearance: none;
      appearance: none;
      width: 18px;
      height: 18px;
      border-radius: 50%;
      background: globals.$muted-color;
      cursor: pointer;
      border: 2px solid globals.$background-color;
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
      transition: all 0.2s;
      margin-top: -6px;

      &:hover {
        transform: scale(1.1);
        box-shadow: 0 2px 6px rgba(255, 255, 255, 0.4);
      }

      &:active {
        transform: scale(1.05);
      }
    }

    &::-moz-range-thumb {
      width: 18px;
      height: 18px;
      border-radius: 50%;
      background: globals.$muted-color;
      cursor: pointer;
      border: 2px solid globals.$background-color;
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
      transition: all 0.2s;
      margin-top: -6px;

      &:hover {
        transform: scale(1.1);
        box-shadow: 0 2px 6px rgba(255, 255, 255, 0.4);
      }

      &:active {
        transform: scale(1.05);
      }
    }

    &::-webkit-slider-runnable-track {
      width: 100%;
      height: 6px;
      border-radius: 3px;
      background: linear-gradient(
        to right,
        globals.$muted-color 0%,
        globals.$muted-color var(--volume-percent),
        globals.$dark-background-color var(--volume-percent),
        globals.$dark-background-color 100%
      );
    }

    &::-moz-range-track {
      width: 100%;
      height: 6px;
      border-radius: 3px;
      background: globals.$dark-background-color;
    }

    &::-moz-range-progress {
      height: 6px;
      border-radius: 3px;
      background: globals.$muted-color;
    }

    &:focus {
      outline: none;

      &::-webkit-slider-thumb {
        box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
      }

      &::-moz-range-thumb {
        box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
      }
    }

    &::-ms-thumb {
      width: 18px;
      height: 18px;
      border-radius: 50%;
      background: globals.$muted-color;
      cursor: pointer;
      border: 2px solid globals.$background-color;
    }

    &::-ms-track {
      width: 100%;
      height: 6px;
      background: transparent;
      border-color: transparent;
      color: transparent;
    }

    &::-ms-fill-lower {
      background: globals.$muted-color;
      border-radius: 3px;
    }

    &::-ms-fill-upper {
      background: globals.$dark-background-color;
      border-radius: 3px;
    }
  }
}
