$radio_player_color: #40CE87;
$radio_player_color_dark: darken(#40CE87, 10%);
$radio_player_color_light: lighten(#40CE87, 10%);

.radio-player-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  color: #fff;
  font-size: .875rem;
  border-radius: 5px;
  text-decoration: none;
  transition: all .3s ease;
  border: none;
  cursor: pointer;
  line-height: 1;
  background: $radio_player_color;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;

  i {
    margin-right: 5px;
  }

  .radio-player-spinner {
    margin-right: 10px;
  }

  &:hover {
    background: $radio_player_color_dark;
  }

  &.btn-primary {
    background: #007bff;
    color: #fff;

    &:hover {
      background: #0069d9;
      color: #fff;
    }
  }

  &.btn-secondary {
    background: #fff;
    color: #1E7CA3;
    border: 1px solid #1E7CA3;

    &:hover {
      background: #1E7CA3;
      color: #fff;
    }
  }

  &.btn-success {
    background: #00ff00;
    color: #fff;

    &:hover {
      background: #00ff00;
      color: #fff;
    }
  }

  &.btn-warning {
    background-color: #f9d6b7;
    color: #a65300;

    &:hover {
      background-color: #ffcc99;
    }
  }

  &.btn-danger {
    background-color: #f8d7da;
    color: #d8000c;

    &:hover {
      background-color: #f5c6cb;
    }
  }

  &.btn-info {
    background-color: #b4d8e7;
    color: #1f4e6e;

    &:hover {
      background-color: #00a5e6;
    }
  }

  @media (max-width: 767px) {
    font-size: .75rem;
    padding: 8px 12px;
  }

}

.radio-player-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  background-color: currentColor;

  &.icon-pro {
    mask: url('../images/pro.svg') no-repeat center;
  }

}

.radio-player-swal {

  &.embed-code-swal {
    .embed-code-title {
      margin: 0;
    }

    textarea {
      margin-top: 15px;
      width: 99%;
      height: 100px;
      resize: none;
      padding: 10px;
      border: 1px solid #e5e5e5;
      border-radius: 5px;
      font-size: 14px;
      font-family: monospace;
      color: #333;
      word-break: break-all;
    }
  }

  z-index: 99999 !important;

  .swal2-confirm {
    background-color: $radio_player_color !important;
  }

  .swal2-close {
    &:focus {
      background: transparent;
      color: inherit;
      box-shadow: none;

    }
  }

  .swal2-deny,
  .swal2-cancel, {
    background-color: #F08080 !important;
  }

  // Title
  .swal2-title {
    font-size: 1.2rem;
    color: #333;
    font-weight: 500;
  }

  // Text
  .swal2-html-container {
    font-size: 1rem;
    color: #555;
  }

  &.no-icon {
    .swal2-title {
      margin-top: 15px;
    }
  }

  &.radio-player-review-remind-swal {
    .swal2-deny, {
      background-color: #999 !important;
    }
  }

  &.radio-player-popup-play {
    background: rgba(0, 0, 0, .7);

    .swal2-popup {
      width: 700px;
      max-width: 100%;
      padding: 0;
      background: transparent;

      .swal2-close {
        color: #fff;
        background: transparent !important;
        top: -10px;
        right: -30px;
        border: 1px solid #fff;
        border-radius: 50%;
        width: 30px;
        height: 30px;
        font-size: 20px;
        line-height: 28px;
        box-shadow: none;
        transition: all .3s ease;

        &:hover {
          background: #fff !important;
          color: #000;
        }
      }

      .swal2-title {
        padding: 0;
        color: #fff;
        margin: 10px 0;
      }

      iframe {
        border-radius: 10px;
        width: 100%;
        aspect-ratio: 16 / 9;
      }

    }
  }

}

.radio-player-tooltip {
  z-index: 9999999 !important;

  &.react-tooltip__show {
    opacity: 1 !important;
    visibility: visible !important;
  }

  &.color-picker-tooltip {
    padding: 10px 10px 15px 10px;
  }

  &.floating-tooltip {
    font-size: 13px;
  }

}

.loading-spinner {
  display: flex;
  justify-content: center;
  margin-top: 3rem;

  svg {
    width: 2.5rem;
    height: 2.5rem;
  }
}

.radio-player-spinner {
  border: 2px solid #f3f3f3; /* Light grey */
  border-top: 2px solid #3498db; /* Blue */
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: radio-player-spin 2s linear infinite;
  display: flex;

  &.spinner-large {
    border-width: 4px;
    width: 50px;
    height: 50px;
    animation: radio-player-spin 1s linear infinite;
    margin: 30px auto;
  }

}

.radio-player-pro-icon {
  width: 30px;
  height: 30px;
  margin-left: 5px;
  background: #ffc300;
  padding: 3px 5px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;

  .radio-player-icon {
    background: #fff;
  }
}

.pro-disabled {
  opacity: .6;
}

@keyframes radio-player-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.radio-player-app,
.radio-player-settings, {
  .components-form-toggle {
    width: max-content;
    background: #fff;
    padding: 3px;
    border-radius: 15px;
    height: auto;

    &__track {
      width: 44px;
      height: 22px;
      border-radius: 22px;
      border-color: $radio_player_color;
    }

    &__thumb {
      background: $radio_player_color;
      border: none;
      width: 15px;
      height: 15px;
      border-radius: 25px;
      top: 6px;
      left: 6px;
    }

    &.is-checked {
      .components-form-toggle__thumb {
        background: #FFF;
        transform: translateX(22px);
      }

      .components-form-toggle__track {
        background: $radio_player_color;
      }
    }

  }

  input[type="text"],
  input[type="number"],
  input[type="email"],
  input[type="url"], {
    border: 1px solid #e5e5e5;
    border-radius: 7px;
    padding: 5px 10px;
    max-width: 100%;
    font-size: .875rem;
    color: #5C637E;
    width: 350px;
    height: 40px;
  }

  .components-range-control {
    max-width: 350px;

    .components-base-control__field {
      margin-bottom: 0;
    }

    .components-input-control__input,
    .components-input-control__backdrop {
      border: 1px solid #e5e5e5 !important;
      border-radius: 7px !important;
      padding: 5px 10px;
      width: 100%;
      font-size: .875rem !important;
      color: #5C637E !important;
    }

    &__track {
      background: $radio_player_color_light;

      & + span {
        span {
          background: $radio_player_color_dark;
        }
      }
    }

    &__reset {
      background: #FFF;
      border-radius: 7px;
      padding: 5px 10px;
      color: #FF8000;
      box-shadow: none;
      border: 1px solid rgba(#FF8000, .25);
      transition: all .3s ease;

      &:hover {
        background: darken(#FF8000, 5%);
        color: #FFF !important;
        box-shadow: none !important;
        border-color: darken(#FF8000, 5%) !important;
        outline: none !important;
      }

    }

  }

  .components-button-group {
    background: #fff;
    padding: 7px 5px;
    width: max-content;
    border-radius: 10px;

    button {
      color: #5C637E;
      box-shadow: inset 0 0 0 1px rgba(#675ED5, .25) !important;
      margin: 0 5px;
      border-radius: 5px !important;

      &.is-primary {
        z-index: auto;
        background: $radio_player_color;
        color: #fff;

        svg, path {
          fill: #FFF;
        }

        &:hover {
          background: $radio_player_color_dark;
        }

      }

      i, svg {
        margin-right: 5px;
      }

      &:hover {
        color: $radio_player_color !important;
      }

    }

    &.disabled {
      opacity: .5;
    }
  }

  .radio-player-color-palette {
    width: 300px;
    max-width: 100%;
    position: relative;

    legend {
      display: none;
    }

    .components-dropdown {
      width: max-content;

      .components-color-palette__custom-color-wrapper {
        width: 300px;
        max-width: 100%;
        height: 50px;
        overflow: hidden;

        button {
          width: 100%;
          height: 100%;
          border-radius: 4px;

          .components-truncate {
            display: none;
          }

          .components-color-palette__custom-color-value {
            text-overflow: ellipsis;
            white-space: nowrap;
            overflow: hidden;
          }
        }

        .components-color-palette__custom-color-text-wrapper {
          position: absolute;
          width: 100%;
          pointer-events: none;
          box-shadow: none;
        }

      }
    }

    .components-circular-option-picker__custom-clear-wrapper {
      position: absolute;
      margin: 0;
      right: -60px;
      top: 6px;

      button {
        background: #FFF;
        color: #FF8000;
        border: 1px solid rgba(#FF8000, .25);
        box-shadow: none !important;
        font-size: .75rem;
        height: 28px;
        width: 50px;
        border-radius: 5px;
        justify-content: center;
        transition: all .3s ease;

        &:hover {
          color: #FFF;
          background: darken(#FF8000, 5%);
        }
      }

    }

    .components-circular-option-picker__option {
      &:before,
      &:after {
        width: auto;
        height: auto;
      }
    }

    &.disabled {
      opacity: .5;
    }

  }

  .components-custom-gradient-picker__ui-line {
    & > .components-flex-item {
      flex: none;
    }

    .components-input-control__container,
    .components-select-control__input,
    .components-input-control__backdrop {
      width: 200px;
    }

    .components-input-control__container {
      &:has(.components-input-control__input) {
        width: 100px;

        .components-select-control__input,
        .components-input-control__backdrop {
          width: 100px;
        }
      }
    }

    .components-custom-gradient-picker__type-picker {
      width: auto;
    }

    .components-input-control__input {
      height: 45px !important;
      padding: 0 !important;
      padding-left: 15px !important;
      width: 100px;
    }

    .components-input-control__backdrop {
      border-radius: 7px !important;
      border-color: #e5e5e5 !important;
      height: 45px;
    }

  }

  .components-spacer {
    position: relative;
    max-width: 500px;

    .components-custom-gradient-picker__gradient-bar {
      border-radius: 30px;
      z-index: 5;
    }

    .components-circular-option-picker__custom-clear-wrapper {
      position: absolute;
      margin: 0;
      right: 0;
      bottom: 0;

      button {
        color: #FFF;
        background: #FF8000;
        border: 1px solid rgba(#675ED5, .25);
        box-shadow: none;
        font-size: .875rem;
        height: 32px;
        width: 60px;
        text-align: center;
        border-radius: 5px;
        padding: 5px 12px;

        &:hover {
          color: #FFF;
          background: darken(#FF8000, 5%);
          border: 1px solid rgba(#675ED5, .25);
        }
      }

    }

    .components-custom-gradient-picker__type-picker,
    .components-angle-picker-control__input-field, {
      display: flex;
      flex-direction: row;
      align-items: center;

      .components-flex-item {
        margin-right: 7px;
      }

      .components-input-control__container {
        border-radius: 7px;
      }

      .components-input-control__backdrop {
        border-color: #e5e5e5;
      }
    }

    .components-custom-gradient-picker__type-picker {
      justify-content: flex-start;

      .components-input-control__container {
        width: 120px;
        flex: none;
      }
    }

    .components-angle-picker-control__input-field {
      justify-content: flex-end;
      margin-right: 15px;

      .components-input-control__container {
        width: 80px;
        flex: none;
      }
    }

  }

  .components-select-control {
    width: 350px;

    .components-select-control__input {
      height: 40px !important;
      padding: 0 !important;
      padding-left: 15px !important;
      margin-top: 0 !important;
    }

    .components-input-control__backdrop {
      border-radius: 7px !important;
      border-color: #e5e5e5 !important;
      height: 40px;
    }

    .components-input-control__suffix {
      cursor: pointer;
      position: relative;
      right: 10px;
      pointer-events: none;
    }

    @media (max-width: 767px) {
      width: 100%;
    }

  }

  .components-color-picker {
    .components-select-control {
      width: auto;

      &__input {
        width: 100px !important;
        padding: 0 15px !important;
      }

      .components-input-control__container {
        border: 1px solid #e5e5e5;
        border-radius: 5px;
      }
    }

    .components-input-control {

      &__container {
        width: 100%;
        padding-left: 10px;
      }

      &__backdrop {
        border-color: #e5e5e5 !important;
        border-radius: 5px !important;
      }
    }

  }
}

.radio-player-select {
  width: 400px;
  text-align: left;
  font-weight: normal;
  font-size: 14px;

  &__control {
    &.radio-player-select__control--is-focused {
      border-color: $radio_player_color;
      box-shadow: none;
    }
  }

  &__input {
    input {
      height: 35px;

      &:focus {
        border: none;
        box-shadow: none;
      }
    }
  }

  &__menu {
    border-radius: 7px;
    border: 1px solid rgba(#2fb44b, .3);
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);

    .radio-player-select__option {
      padding: 10px 15px;
      font-size: 0.8rem;
      cursor: pointer;

      &:hover {
        background: rgba(#2fb44b, .1);
      }

      &--is-focused {
        background: rgba(#2fb44b, .1);
      }

    }

  }

  &__multi-value {

    .radio-player-select__multi-value__label {
    }
  }

  @media (max-width: 1199px) {
    width: 320px;
  }

  @media (max-width: 767px) {
    width: 100%;
  }

}

.rp-notice {
  border-radius: 5px;
  border: 1px solid #f1f1f1;
  border-left-width: 5px;
  background: #fff;
  box-shadow: 0 1px 1px 0 rgba(0, 0, 0, .1);
  padding: 10px;
  margin: 10px 0 0;
  display: flex;

  .rp-notice-content {
    margin: 0;
    text-align: left;
    font-size: .9rem;
    line-height: 1.5;
    color: #757575;
    max-width: 100%;
  }

  &.rp-notice-info {
    border-color: rgba(#00b5ff, .5);
    background: rgba(#00b5ff, .1);
    border-left-color: #00b5ff;
  }

  &.rp-notice-warning {
    border-color: rgba(#ffc800, .5);
    background: rgba(#ffc800, .1);
    border-left-color: #ffc800;
  }

  @media (max-width: 767px) {
    .rp-notice-content {
      flex-wrap: wrap;
    }
  }

}

/**---- Color Picker ----**/
.radio-player-color-picker-wrapper {
  .color-holder-wrap {
    display: flex;
    align-items: center;

    .color-holder {
      width: 40px;
      height: 40px;
      border-radius: 50%;
      margin-right: 10px;
      border: 1px solid #ddd;
      cursor: pointer;
      position: relative;
      z-index: 1;
      overflow: hidden;
      background: repeating-linear-gradient(45deg, #e0e0e0 25%, #0000 0, #0000 75%, #e0e0e0 0, #e0e0e0) 0 0 / 24px 24px,
      repeating-linear-gradient(45deg, #e0e0e0 25%, #0000 0, #0000 75%, #e0e0e0 0, #e0e0e0) 12px 12px / 24px 24px;

    }

    .color-input {
      width: 120px !important;
      height: 38px !important;
      padding: 5px 7px;
      border: 1px solid #ddd;
      border-radius: 5px;
      margin-right: 10px;
    }

    .dashicons-edit {
      color: #777;
      border: 1px solid #ddd;
      padding: 4px;
      height: 24px;
      width: 24px;
      font-size: 24px;
      box-sizing: content-box !important;
      cursor: pointer;
      background: #fff;
      border-radius: 3px;
      transition: all 0.2s ease-in-out;

      &-wrap {
        display: flex;
        align-items: center;
      }

      &:hover {
        background: #f9f9f9;
      }

    }

    .dashicons-image-rotate {
      color: #777;
      height: 20px;
      width: 20px;
      font-size: 20px;
      margin-left: 15px;
      cursor: pointer;
      transition: all 0.2s ease-in-out;

      &-wrap {
        display: flex;
        align-items: center;
      }

      &:hover {
        background: #f9f9f9;
      }
    }

  }

  .components-color-picker {

    .components-select-control {
      width: auto;
      margin-left: 0;

      .components-input-control__container {
        width: 100%;

        select {
          height: 35px !important;
        }

        .components-input-control__backdrop {
          border-color: #ddd;
          height: 35px;
        }

      }
    }

    .components-input-control__input {
      height: 35px !important;
      min-height: auto !important;
    }

    .components-h-stack {
      padding: 0;
      margin-bottom: 7px;

      & + .components-flex {
        padding: 0;

        .components-input-control__container {
          width: 100%;

          .components-input-control__backdrop {
            border-color: #ddd;
            height: 40px;
          }

        }
      }
    }

    .react-colorful__saturation {
      height: 130px;
    }

  }

}