/**=====================
    5.6 Select2 CSS Start
==========================**/

.dropzone {
  background: unset;

  &.dropzone-secondary {
    border: 2px dashed $secondary-color;

    i {
      color: $secondary-color;
    }
  }

  .note {
    @media (max-width:360px) {
      min-width: unset !important;
    }
  }

  .dz-preview {
    margin: 28px 18px !important;
    box-shadow: unset;

    .dz-details {
      top: unset;
      bottom: -6px;
      position: relative;
      padding-bottom: 6px;
      background-color: unset;

      [dir="rtl"] & {
        left: unset;
        right: 32px;
      }
    }

    &:hover {
      .dz-error-message {
        display: none !important;
      }
    }
  }

  .dz-error-mark {
    .dz-remove {
      position: relative;

    }
  }
}

.dz-preview {
  .dz-remove {
    cursor: pointer;
  }
}

.dropzone-secondary {
  .dz-preview {
    .dz-remove {
      color: $secondary-color;
    }
  }
}

.select2 {
  max-width: 100%;
}

.add-post {
  #cke_text-box {
    border: 1px dashed $light-semi-gray;
  }

  form {
    .m-checkbox-inline {
      label {
        margin-bottom: 0;
      }
    }

    .form-control {
      border: 1px dashed $light-semi-gray;
    }

    .col-form-label {
      padding-bottom: 0;
      padding-top: 0;

      .select2-container--default {
        margin-top: 10px;
        max-width: 100%;

        .selection {
          .select2-selection {
            .select2-search__field {
              padding: 2px;
            }
          }
        }

        .select2-selection--multiple {
          border: 1px dashed $light-semi-gray;
          max-width: 100%;

          .select2-selection__rendered {
            li {
              margin-top: 6px !important;
            }
          }
        }
      }
    }
  }

  .select2-container--default {
    .select2-selection--multiple {
      .select2-selection__choice {
        background-color: var(--theme-deafult);
        border: 1px dashed var(--theme-deafult);
        color: var(--white);

        .select2-selection__choice__remove {
          color: var(--white);
          float: right;
          margin-left: 0.5rem;

          [dir="rtl"] & {
            float: left;
            margin-left: unset;
            margin-right: 0.5rem;
          }
        }
      }
    }
  }

  .dropzone {
    margin-bottom: 30px;
  }
}

.select2-container--open {
  .select2-dropdown {
    z-index: 7;
  }
}

.select2-container {
  width: 100% !important;

  &.select2 {
    .selection {
      display: block !important;
    }
  }
}

.select2-drpdwn {
  .select2-selection {
    border-radius: 0 !important;
    border-color: $light-color  !important;
    height: 40px !important;
    padding: 5px;
  }

  .form-control {
    border-radius: 5px;
  }

  .form-control-primary {
    border-color: var(--theme-deafult);
    color: var(--theme-deafult);
  }

  .form-control-secondary {
    border-color: var(--theme-secondary);
    color: var(--theme-secondary);
  }

  .form-control-success {
    border-color: $success-color;
    color: $success-color;
  }

  .form-control-info {
    border-color: $info-color;
    color: $info-color;
  }

  .form-control-warning {
    border-color: $warning-color;
    color: $warning-color;
  }

  .form-control-danger {
    border-color: $danger-color;
    color: $danger-color;
  }

  .form-control-inverse {
    border-color: $dark-color;
    color: $dark-color;
  }

  .form-control-primary-fill {
    background-color: var(--theme-deafult);
    color: $white;
  }

  .form-control-secondary-fill {
    background-color: var(--theme-secondary);
    color: $white;
  }

  .form-control-success-fill {
    background-color: $success-color;
    color: $white;
  }

  .form-control-info-fill {
    background-color: $info-color;
    color: $white;
  }

  .form-control-warning-fill {
    background-color: $warning-color;
    color: $white;
  }

  .form-control-danger-fill {
    background-color: $danger-color;
    color: $white;
  }

  .form-control-inverse-fill {
    background-color: $dark-color;
    color: $white;
  }
}

// Filepond

.filepond--drop-label {
  .filepond--label-action {
    color: $danger-color;
    text-decoration: none;
  }
}

.filepond--list {
  .filepond--file {
    background-color: $primary-color;
  }
}

// Tagify
/* Do not show the "remove tag" (x) button when only a single tag remains */
.customLook {
  display: inline-block;
  min-width: 0;
  border: none;

  .tagify__tag {
    margin-top: 0;

    &:only-of-type {
      .tagify__tag__removeBtn {
        display: none;
      }
    }

    &:hover {
      .tagify__tag__removeBtn {
        transform: none;
        opacity: 1;
        margin-left: -1ch;
      }
    }
  }

  .tagify__tag__removeBtn {
    opacity: 0;
    transform: translateX(-6px) scale(.5);
    margin-left: -3ch;
    transition: .12s;
  }

  + {
    button {
      color: var(--theme-deafult);
      font: bold 1.4em/1.65 Arial;
      border: 0;
      background: none;
      box-shadow: 0 0 0 2px inset var(--theme-deafult);
      border-radius: 50%;
      width: 1.65em;
      height: 1.65em;
      cursor: pointer;
      outline: none;
      transition: .1s ease-out;
      margin: 0 0 0 5px;
      vertical-align: top;

      &:hover {
        box-shadow: 0 0 0 5px inset var(--theme-deafult);
      }
    }
  }

  .tagify__input {
    display: none;
  }
}

.tagify--empty {
  .tagify__input {
    &::before {
      color: var(--chart-text-color);
    }
  }
}

.customSuggestionsList {
  >div {
    max-height: 300px;
    min-height: 50px;
    border: 2px dashed var(--chart-dashed-border);
    overflow: auto;
  }

  .empty {
    color: var(--theme-deafult);
    font-size: 20px;
    text-align: center;
    padding: 1em;
  }
}

// Flag tags
.tagify__dropdown.extra-properties {
  .tagify__dropdown__item {
    >img {
      display: inline-block;
      vertical-align: middle;
      height: 20px;
      transform: scale(.75);
      margin-right: 5px;
      border-radius: 2px;
      transition: .12s ease-out;
    }

    &:hover {
      >img {
        transform: none;
        margin-right: 12px;
      }
    }
  }

  .tagify__dropdown__item--active {
    >img {
      transform: none;
      margin-right: 12px;
    }
  }
}

.tagify.countries {
  .tagify__input {
    min-width: 175px;
  }

  tag {
    white-space: nowrap;

    img {
      display: inline-block;
      height: 16px;
      margin-right: 3px;
      border-radius: 2px;
      pointer-events: none;
    }
  }
}

.tagify--select {
  width: 100%;
}

.tagify__dropdown__wrapper {
  background: var(--white);
  border-color: var(--recent-dashed-border);
}

.tagify__dropdown__item--active {
  background-color: $gray-60;
  color: var(--body-font-color);
}

.tagify {
  --tags-focus-border-color: #cccccc;
}

.tagify__input {
  color: $dark-color;
}

.tagify--select {
  &::after {
    [dir="rtl"] & {
      right: unset;
      left: 0;
      transform: translate(150%, -50%) scaleX(1.2) rotate(90deg);
    }

    color: var(--chart-text-color);
  }

  .tagify__tag {
    [dir="rtl"] & {
      right: unset;
      left: 1.8em;
    }
  }
}

.tagify--select[aria-expanded=true]::after {
  [dir="rtl"] & {
    transform: translate(150%, -50%) rotate(270deg) scale(1.2);
  }
}

.international-num {
  input {
    width: calc(240px + (250 - 240) * ((100vw - 320px) / (1920 - 320)));
    padding: 10px;
    border-radius: 2px;
    border: 1px dashed $gray-60;

    &:focus {
      outline-color: $gray-60;
    }
  }

  input::placeholder {
    color: $gray-60;
  }

  .results {
    ul {

      border: 1px dashed $gray-60;
      margin-top: 12px;
      padding: 8px;
      line-height: 1.9;
    }
  }
}

.iti--allow-dropdown {
  .iti__flag {
    background-image: url(../../images/forms/flags.png);
  }
}

// Search-box
.select-box {
  position: relative;
  display: flex;
  width: 400px;
  flex-direction: column;

  .options-container {
    background: var(--recent-box-bg);
    color: var(--body-font-color);
    max-height: 0;
    width: 100%;
    opacity: 0;
    transition: all 0.4s;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
    order: 1;

    &::-webkit-scrollbar {
      width: 8px;
      background: var(--view-grid-bg);
      border-radius: 0 8px 8px 0;
    }

    &::-webkit-scrollbar-thumb {
      background: var(--view-grid-bg);
      border-radius: 0 8px 8px 0;
    }

  }

  .options-container.active {
    max-height: 240px;
    opacity: 1;
    overflow-y: scroll;
    margin-top: 53px;

    @media (min-width:1007px) and (max-width:1920px) {
      max-width: calc(265px + (400 - 265) * ((100vw - 1007px) / (1920 - 1007)));
    }

    @media (min-width:768px) and (max-width:1006px) {
      max-width: calc(295px + (350 - 295) * ((100vw - 1007px) / (1006 - 768)));
    }

    @media (max-width:767px) {
      max-width: calc(242px + (415 - 242) * ((100vw - 320px) / (767 - 320)));
      margin-top: 46px;
    }

    + {
      .selected-box {
        &::after {
          transform: rotateX(180deg);
          top: -6px;
        }
      }
    }

    ~ {
      .search-box {
        input {
          opacity: 1;
          pointer-events: auto;
        }
      }
    }

  }

  .selection-option {
    padding: 12px 24px;
    cursor: pointer;

    &:hover {
      background: $gray-60;
    }

    .radio {
      display: none;
    }
  }

  label {
    cursor: pointer;
  }
}

.selected-box {
  background: var(--light2);
  color: $color_1;
  position: relative;
  order: 0;
  padding: 12px 24px;
  cursor: pointer;

  @media (min-width:1007px) and (max-width:1920px) {
    max-width: calc(265px + (400 - 265) * ((100vw - 1007px) / (1920 - 1007)));
  }

  @media (min-width:768px) and (max-width:1006px) {
    max-width: calc(295px + (350 - 295) * ((100vw - 1007px) / (1006 - 768)));
  }

  @media (max-width:767px) {
    max-width: calc(242px + (415 - 242) * ((100vw - 320px) / (767 - 320)));
  }

  &::after {
    content: "\f078";
    font-family: "FontAwesome";
    position: absolute;
    height: 100%;
    width: 32px;
    right: 10px;
    top: 12px;
    transition: all 0.4s;

    [dir="rtl"] & {
      left: 10px;
      right: unset;
    }

  }
}

.search-box {
  input {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    position: absolute;
    z-index: 1;
    border: 2px dashed var(--chart-dashed-border);
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s;
    border-radius: 6px;

    @media (min-width:1007px) and (max-width:1920px) {
      max-width: calc(265px + (400 - 265) * ((100vw - 1007px) / (1920 - 1007)));
    }

    @media (min-width:768px) and (max-width:1006px) {
      max-width: calc(295px + (350 - 295) * ((100vw - 1007px) / (1006 - 768)));
    }

    @media (max-width:767px) {
      max-width: calc(242px + (415 - 242) * ((100vw - 320px) / (767 - 320)));
      padding: 9px 16px;
    }

    &:focus {
      outline: none;
    }
  }
}

/**=====================
    5.6 Select2 CSS Ends
==========================**/