$igd_color: #2FB44B;
$igd_color_light: lighten($igd_color, 10%);
$igd_color_dark: darken($igd_color, 10%);

.igd-btn {
  cursor: pointer;
  width: max-content;
  display: flex;
  align-items: center;
  color: #fff;
  padding: 8px 12px;
  border-radius: 30px;
  border: 1px solid transparent;
  line-height: 1;
  text-decoration: none;
  transition: all .2s ease-in-out;
  font-size: .875rem;
  gap: 7px;

  .igd-spinner {
    margin: 2px 10px 0 0;
  }

  &.btn-primary {
    background-color: $igd_color;

    &:hover {
      color: #fff;
      background-color: $igd_color_dark;
    }
  }

  &.btn-secondary {
    background-color: #5c637e;
    border-color: #5c637e;
    color: #FFF;

    &:hover {
      background-color: #4b5266;
    }
  }

  &.btn-success {
    background-color: #00d084;
    border-color: #00d084;

    &:hover {
      color: #fff;
      background-color: #00c674;
    }
  }

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

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

  &.btn-danger {
    background-color: #fee2e2; // soft red background
    color: #dc2626; // lighter danger text
    border: 1px solid #fca5a5;

    &:hover,
    &:focus {
      background-color: #fecaca;
      color: #b91c1c; // slightly darker on hover
      border-color: #f87171;
    }

    &:active {
      background-color: #fca5a5;
      color: #991b1b;
    }
  }


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

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

  &.btn-light {
    background-color: #f1f1f1;
    border-color: #f1f1f1;

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

  &.btn-dark {
    background-color: #0071e6;
    border-color: #0071e6;

    &:hover {
      background-color: #0058c6;
      color: #fff;
    }
  }

  &.btn-link {
    background-color: transparent;
    border-color: transparent;
    color: #0071e6;

    &:hover {
      color: #0058c6;
    }
  }

  &.btn-outline-primary {
    background-color: transparent;
    border-color: var(--color-primary);
    color: var(--color-primary);

    &:hover {
      background-color: var(--color-primary);
      color: #fff;
    }
  }

  &.btn-outline-secondary {
    background-color: transparent;
    border-color: #f1f1f1;
    color: #f1f1f1;

    &:hover {
      background-color: #f1f1f1;
      color: #fff;
    }
  }

  &.btn-outline-success {
    background-color: transparent;
    border-color: #00d084;
    color: #00d084;

    &:hover {
      background-color: #00d084;
      color: #fff;
    }
  }

  &.btn-outline-warning {
    background-color: transparent;
    border-color: #ffc800;
    color: #ffc800;

    &:hover {
      background-color: #ffc800;
      color: #fff;
    }
  }

  &.btn-outline-danger {
    background-color: transparent;
    border-color: #ff5b5b;
    color: #ff5b5b;

    &:hover {
      background-color: #ff5b5b;
      color: #fff;
    }
  }

  &.btn-outline-info {
    background-color: transparent;
    border-color: #00b5ff;
    color: #00b5ff;

    &:hover {
      background-color: #00b5ff;
      color: #fff;
    }
  }

  &.btn-outline-light {
    background-color: transparent;
    border-color: #f1f1f1;
    color: #f1f1f1;

    &:hover {
      background-color: #f1f1f1;
      color: #fff;
    }
  }

  &.btn-outline-dark {
    background-color: transparent;
    border-color: #0071e6;
    color: #0071e6;

    &:hover {
      background-color: #0071e6;
      color: #fff;
    }
  }

  &.btn-outline-link {
    background-color: transparent;
    border-color: #0071e6;
    color: #0071e6;

    &:hover {
      background-color: #0071e6;
      color: #fff;
    }
  }

  &.disabled {
    color: #999;
    cursor: not-allowed;
    background: #f1f1f1 !important;
    border-color: #ccc;
  }

}

.igd-tooltip {
  z-index: 9999999 !important;

  &:before {
    z-index: -1 !important;
  }

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

}

.igd-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 12px;
  margin: 10px 0;
  display: flex;

  .igd-notice-content {
    margin: 0;
    text-align: left;
    font-size: 13px;
    line-height: 1.5;
    color: #757575;

    p {
      margin: 7px 0;
      line-height: normal;
    }

    h5 {
      margin: 5px 0;
      font-weight: 500;
      font-size: 14px;
      line-height: normal;
    }

    code {
      padding: 2px 4px;
      border-radius: 3px;
      font-family: monospace;
      font-size: 13px;
      background-color: rgba(0, 0, 0, 0.05);
    }

    a {
      color: #0071e6;
      text-decoration: none;
      font-weight: 500;

      &:hover {
        color: #0058c6;
      }
    }

    ul {
    }

  }

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

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

  &.loading-method-info {
    .igd-notice-content {
      .description {
        display: block;
      }
    }
  }

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

}

.igd-hidden {
  display: none !important;
}

.file-item-checkbox {
  cursor: pointer;
  display: none;
  border-radius: 5px;
  width: max-content;
  padding: 4px;

  .box {
    width: 20px;
    height: 20px;
    border: 1px solid #DDD;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .3s ease;
    position: relative;
    box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;

    &:after {
      content: "";
      display: none;
      width: 6px;
      height: 11px;
      border: solid var(--color-primary);
      border-width: 0 2px 2px 0;
      transform: rotate(45deg);
      box-sizing: border-box;
      margin-top: -2px;
    }

    &:hover {
      border-color: var(--color-primary);
      box-shadow: 0 0 0 2px var(--color-primary-lighter);

      &:after {
        display: block;
        border-color: #999;
      }

    }
  }

  &:hover {
    background-color: rgba(0, 0, 0, 0.15);

    .box {
      box-shadow: 0 0 0 2px var(--color-primary-lighter);
    }
  }

  &.checked {
    background-color: rgba(0, 0, 0, 0.15);

    .box {
      border-color: var(--color-primary-lighter);
      color: var(--color-primary);
      background: #fff;
      box-shadow: 0 0 0 1px var(--color-primary-lighter);

      &:after {
        display: block;
      }

    }
  }
}

.igd-swal {
  z-index: 99999999 !important;

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

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

    }
  }

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

  &.save-settings-toast {
    .swal2-popup {
      display: flex !important;
      padding: 10px;

      .swal2-html-container {
        margin-left: 5px;
      }

    }
  }

  &.igd-swal-toast {
    .swal2-popup {
      display: flex !important;
      padding: 10px;

      .swal2-html-container {
        margin-left: 5px;
      }

    }
  }

  .swal2-input {
    width: auto !important;
  }

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

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

  .swal2-textarea {
    &:focus {
      border-color: #ddd !important;
      box-shadow: none !important;
    }
  }

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

  .swal2-validation-message {
    display: block;
    text-align: center;
  }

  &-reverse {
    .swal2-deny,
    .swal2-cancel, {
      background-color: $igd_color !important;
    }

    .swal2-confirm {
      background-color: #F08080 !important;
    }

  }

  &.igd-import-swal {
    .swal2-modal {
      padding: 10px;

      .swal2-title {
        margin-bottom: 10px;
      }
    }
  }

  &.proof-swal {
    .swal2-textarea {
      font-size: 14px;
      font-weight: normal;
    }
  }

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

  &.migration-swal {

    .migration-status {
      display: flex;
      flex-direction: column;

      p {
        margin: 5px 0;

        span {
          font-weight: bold;
        }

      }

    }

    .migration-progress {
      display: flex;
      align-items: center;
      justify-content: center;
      flex-direction: column;

      .progress-message.completed {
        color: $igd_color;
        font-weight: 600;
      }

    }
  }

  &.igd-pro-video-swal {
    .swal2-popup {
      background: #111;

      .swal2-title {
        color: #fff;
      }
    }
  }


}

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

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

.igd-divi-loading-spinner {
  display: flex;
  justify-content: center;

  svg {
    width: 100px;
    height: 100px;
  }
}

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

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

}

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

.igd-disabled {
  pointer-events: none !important;
}

.igd-select {
  max-width: 700px;
  text-align: left;
  font-size: 14px;
  font-weight: normal;

  &__input {
    height: auto !important;
    min-height: auto !important;

    &:focus {
      box-shadow: none !important;
    }
  }

  /* Main control */
  &__control {
    border: 1px solid #ccc;
    border-radius: 10px !important;
    box-shadow: none;
    transition: all 0.2s ease;
    font-size: 14px;
  }

  &__control--is-focused {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
  }

  &__value-container {
    padding: 4px 15px;
  }


  /* Value and placeholder */
  &__single-value,
  &__placeholder {
    display: flex;
    align-items: center;
    font-size: 14px;
  }

  /* Image in selected value */
  &__single-value img {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    object-fit: contain;
    border-radius: 4px;
    z-index: 9;
  }

  /* Dropdown menu */
  &__menu {
    z-index: 1000;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
  }

  /* Option item */
  &__option {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    background-color: #fff;
    transition: all 0.2s ease;

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

  }

  &__option {

    img {
      width: 20px;
      height: 20px;
      margin-right: 8px;
      object-fit: contain;
      border-radius: 4px;
    }

    .shortcode-id {
      margin-right: 8px;
      white-space: nowrap;
      color: #666;
    }

    .shortcode-title {
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      display: block;
    }
  }

  /* Hover and selected states */
  &__option--is-focused {
    background-color: #f0f8ff;
  }

  &__option--is-selected {
    background-color: #2271b1;
    color: #fff;

    img {
      filter: brightness(1.2);
    }
  }

  &.select-shortcode {
    width: 100%;
    z-index: 9;
  }

}

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

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

    &__thumb {
      background: #5C6377;
      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: $igd_color;
      }
    }

    &.disabled {
      opacity: .3;
    }

  }

  .components-checkbox-control {
    .components-h-stack {
      align-items: center;
    }
  }
}

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

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

}

.igd-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;

  .igd-icon {
    background: #fff;
    margin: 0;
  }
}