// border left, right, top, bottom none
$positions: (
  "b": "bottom",
  "t": "top",
  "l": "left",
  "r": "right",
);

@each $key, $position in $positions {
  .b-#{$key}-n {
    border-#{$position}: none !important;
  }
}

// border position 1px
@each $key, $position in $positions {
  .b-#{$key}-1 {
    border-#{$position}: 1px solid $color-border;
  }
}

// border 1px
.b-1 {
  border: 1px solid $color-border;
}

// Border radius utilities
$radius-values: (0, 2, 4, 8, 12, 16, 50);
@each $value in $radius-values {
  .is-rounded-#{$value} {
    border-radius: #{$value}px;
  }
}

// Full width and height utilities
.is-fullwidth {
  width: 100%;
}
.is-fullheight {
  height: 100%;
}

// Ellipsis utilities
@for $i from 0 through 10 {
  .is-ellipsis-#{$i} {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    line-clamp: #{$i};
    -webkit-line-clamp: #{$i};
    -webkit-box-orient: vertical;
  }
}

.ac-navbar-area {
  .brand-tag {
    color: $color-heading;
    background-color: $white-100;
    border: 1px solid $color-border;
  }
}
.sidebar-collapsed:not(.is-hoverable) {
  .ac-left-sidebar {
    .brand-tag {
      display: none;
    }
  }
}
.brand-tag {
  color: $white-100;
  background-color: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-weight: 600;
  font-size: 14px;
  border-radius: 2px;
  margin-left: 4px;
  padding: 4px;
  display: flex;
  line-height: 1;
  white-space: nowrap;
}

.form-content {
  width: 800px;
}

// color swatch start
input[type="color"] {
  -webkit-appearance: none;
  border: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid #777;
  margin-left: 3px;
  padding: 2px;
  cursor: pointer;
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

// input[type="color"]::-moz-color-swatch,
input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 50%;
}

input[type="color"]::-moz-color-swatch {
  border: none;
  border-radius: 50%;
}

hr {
  background-color: $color-border;
}

.is-auto-hight {
  height: auto !important;
  min-height: auto !important;
}

// Additional utilities
.is-auto-height {
  height: auto !important;
  min-height: auto !important;
}
.is-fixed {
  position: fixed !important;
}
.is-not-fixed {
  position: inherit !important;
}
.is-border-none {
  border: none !important;
}
.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.no-data-image {
  img {
    width: 250px;
    height: auto;
    padding: 20px;
  }
}

// toast css third-party

.toasted-container {
  .ac-toast-action.mr-10 {
    text-decoration: underline !important;
  }

  .has-report-issue {
    padding-right: 140px !important;
  }
}

.is-dark-theme {
  .toasted-container {
    i.fa {
      color: $white-100 !important;
    }
  }
}

// flex start
.is-middle-alignment {
  display: flex;
  align-items: center;
  vertical-align: middle;
}

.ac-vcentered {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
// Scrollbar mixin
@mixin scrollbar-styles($direction) {
  padding: 16px;
  transition: 0.3s ease-in-out;

  // Handle overflow based on direction
  @if $direction == "x" {
    overflow-x: auto;
  } @else if $direction == "y" {
    overflow-y: auto;
  } @else if $direction == "both" {
    overflow-x: auto;
    overflow-y: auto;
  }

  // Define scrollbar width/height based on direction
  &::-webkit-scrollbar {
    border-radius: 50px;
    @if $direction == "x" {
      height: 4px;
    } @else if $direction == "y" {
      width: 4px;
    } @else if $direction == "both" {
      width: 4px;
      height: 4px;
    }
  }

  &::-webkit-scrollbar:hover {
    @if $direction == "x" {
      height: 8px;
    } @else if $direction == "y" {
      width: 8px;
    } @else if $direction == "both" {
      width: 8px;
      height: 8px;
    }
  }

  &::-webkit-scrollbar-thumb {
    background-color: $gray-80;
    border-radius: 50px;
  }

  &:hover::-webkit-scrollbar-corner {
    width: 40px; // or adjust as needed
  }
}
// Scrollbar utilities
.ac-vscrollbar {
  @include scrollbar-styles("y");
}
.ac-hscrollbar {
  @include scrollbar-styles("x");
}
.ac-scrollbar {
  @include scrollbar-styles("both");
}

// Overflow utilities
.overflow-y-hidden {
  overflow-y: hidden;
}
.overflow-x-hidden {
  overflow-x: hidden;
}
.overflow-y-auto {
  overflow-y: auto;
}
.overflow-x-auto {
  overflow-x: auto;
}

// Background and shadow utilities
.is-bg-white {
  background-color: $white-100 !important;
}
.bg-white {
  background-color: $white-100 !important;
}
.is-shadowless {
  box-shadow: none !important;
}
.is-shadow {
  box-shadow: $ac-shadow-1 !important;
}

.is-transparent-bg {
  background-color: transparent !important;
}
.is-transparent {
  border: none;
  background-color: transparent !important;
}

p.is-danger {
  color: $danger !important;
}

code {
  color: $color-heading;
}

.is-dark-theme {
  code {
    background-color: $gray-80;
    color: $white-100;
  }
}

.has-text-danger {
  color: $danger !important;
}

button {
  &:focus {
    box-shadow: none;
    outline: none;
  }
}

// background color end

// Shake animation
@keyframes shake {
  10%,
  90% {
    transform: translate3d(-1px, 0, 0);
  }

  20%,
  80% {
    transform: translate3d(2px, 0, 0);
  }

  30%,
  50%,
  70% {
    transform: translate3d(-4px, 0, 0);
  }

  40%,
  60% {
    transform: translate3d(4px, 0, 0);
  }
}

.ac-shake {
  animation: shake 0.82s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  perspective: 1000px;
  animation-iteration-count: 20;
}

// tooltip in vue-open-api
.tooltip {
  display: block !important;
  z-index: 10000;

  &.is-button-info {
    .tooltip-inner {
      background: $white-100;
      color: $ac-primary;
      border-radius: 4px;
      padding: 5px 20px 4px;
      box-shadow: $ac-shadow-1;
      font-weight: 500;
      font-size: 1rem;
    }

    .tooltip-arrow {
      width: 0;
      height: 0;
      border-style: solid;
      position: absolute;
      margin: 5px;
      border-color: $white-100;
    }
  }

  &.is-errors-tooltip {
    .tooltip-inner {
      background: $white-100;
      color: $danger;
      border-radius: 4px;
      padding: 5px 20px 4px;
      box-shadow: $ac-shadow-1;
      font-weight: 500;
      font-size: 1rem;

      .errors-wrapper {
        .error-element {
          padding: 5px 0;
        }
      }
    }

    .tooltip-arrow {
      width: 0;
      height: 0;
      border-style: solid;
      position: absolute;
      margin: 5px;
      border-color: $white-100;
    }
  }

  &[x-placement^="top"] {
    margin-bottom: 5px;

    .tooltip-arrow {
      border-width: 5px 5px 0 5px;
      border-left-color: transparent !important;
      border-right-color: transparent !important;
      border-bottom-color: transparent !important;
      bottom: -5px;
      left: calc(50% - 5px);
      margin-top: 0;
      margin-bottom: 0;
    }
  }

  &[x-placement^="bottom"] {
    margin-top: 5px;

    .tooltip-arrow {
      border-width: 0 5px 5px 5px;
      border-left-color: transparent !important;
      border-right-color: transparent !important;
      border-top-color: transparent !important;
      top: -5px;
      left: calc(50% - 5px);
      margin-top: 0;
      margin-bottom: 0;
    }
  }

  &[x-placement^="right"] {
    margin-left: 5px;

    .tooltip-arrow {
      border-width: 5px 5px 5px 0;
      border-left-color: transparent !important;
      border-top-color: transparent !important;
      border-bottom-color: transparent !important;
      left: -5px;
      top: calc(50% - 5px);
      margin-left: 0;
      margin-right: 0;
    }
  }

  &[x-placement^="left"] {
    margin-right: 5px;

    .tooltip-arrow {
      border-width: 5px 0 5px 5px;
      border-top-color: transparent !important;
      border-right-color: transparent !important;
      border-bottom-color: transparent !important;
      right: -5px;
      top: calc(50% - 5px);
      margin-left: 0;
      margin-right: 0;
    }
  }

  &.popover {
    $color: #f9f9f9;

    .popover-inner {
      background: $color;
      color: black;
      padding: 24px;
      border-radius: 4px;
      box-shadow: $ac-shadow-1;
    }

    .popover-arrow {
      border-color: $color;
    }
  }

  &[aria-hidden="true"] {
    visibility: hidden;
    opacity: 0;
    transition:
      opacity 0.15s,
      visibility 0.15s;
  }

  &[aria-hidden="false"] {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.15s;
  }
}

// Customize tooltip end

// status css
.status {
  height: 10px;
  width: 10px;
  border-radius: 50%;
  background-color: $gray-80;
  border: 2px solid $white-100;
  display: inline-flex;

  &.is-success {
    background-color: #27ae60;
  }

  &.is-danger {
    background-color: $danger !important;
  }
}

// Status css
// ac-footer sticky end
body:has(.has-info-content) {
  &:after {
    position: fixed;
    content: "";
    left: 0;
    top: 0;
    width: calc(100% - 550px);
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
  }
}
.information-center {
  height: 100vh;
  overflow-y: auto;
  padding: 20px;
  border-left: 1px solid $color-border;
  width: 550px;
  margin-left: auto;
  position: fixed;
  right: 0;
  background: $white-100;
  top: 0;
  z-index: 99999;
  box-shadow: -3px 2px 10px 3px rgba(0, 0, 0, 0.1);

  .info-title {
    display: flex;
  }
}

.tag:not(body) {
  &.is-primary {
    background-color: $ac-primary;
    color: $white-100;
    &.is-light {
      color: $ac-primary;
      background-color: $primary-95;
    }
  }
}

.tag {
  a {
    color: inherit;
  }
}

em {
  background: $primary-95;
  padding: 2px 4px;
  font-style: normal;
  color: $ac-primary;
  border-radius: 2px;
  font-size: 90%;
  font-weight: 500;
}

.is-absolute {
  position: absolute;
}
.z-1 {
  z-index: 1;
}

@for $i from 0 through 10 {
  .z-#{$i}00 {
    z-index: #{$i}00;
  }
}

.whats-new-rel {
  min-width: fit-content !important;
  font-size: 11px !important;
  color: #ffff !important;
  margin-left: 4px;
  margin-right: 0 !important;
  padding: 0 4px;
  position: relative;
  &::before,
  &::after {
    content: "";
    position: absolute;
    z-index: -1;
    left: 50%;
    top: 50%;
    transform: translateX(-50%) translateY(-50%);
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 4px;
    background: $ac-primary;
  }
  &:before {
    animation: pulse-border 1500ms ease-out infinite;
  }

  &:after {
    transition: all 200ms;
  }

  @keyframes pulse-border {
    0% {
      transform: translateX(-50%) translateY(-50%) translateZ(0) scale(1);
      opacity: 1;
    }

    100% {
      transform: translateX(-50%) translateY(-50%) translateZ(0) scale(1.4);
      opacity: 0;
    }
  }
}

// white-space
$whitespace-values: normal, nowrap, pre, pre-line, pre-wrap, break-spaces;
@each $value in $whitespace-values {
  .is-whitespace-#{$value} {
    white-space: #{$value} !important;
  }
}
// Whats New
.whats-new {
  --right: -25px;
  --top: 2px;
  --width: 1.5rem;
  --status-color: #cc002a;
  position: absolute;
  z-index: 1;
  top: var(--top);
  right: var(--right);
  font-size: 0.8rem;
  color: $white-100;
  padding: 0.2rem 0.3rem;
  line-height: 1.2;
  display: none;
  border-radius: 8px;

  &:before {
    content: "";
    position: absolute;
    z-index: -1;
    left: 50%;
    top: 50%;
    transform: translateX(-50%) translateY(-50%);
    display: block;
    width: var(--width);
    height: 1.2rem;
    background: var(--status-color);
    border-radius: 8px;
    animation: pulse-border 1500ms ease-out infinite;
  }

  &:after {
    content: "";
    position: absolute;
    z-index: -1;
    left: 50%;
    top: 50%;
    transform: translateX(-50%) translateY(-50%);
    display: block;
    width: var(--width);
    height: 1.2rem;
    background: var(--status-color);
    transition: all 200ms;
    border-radius: 8px;
  }

  @keyframes pulse-border {
    0% {
      transform: translateX(-50%) translateY(-50%) translateZ(0) scale(1);
      opacity: 1;
    }

    100% {
      transform: translateX(-50%) translateY(-50%) translateZ(0) scale(1.5);
      opacity: 0;
    }
  }
}

// text-decoration
.is-line-through {
  text-decoration: line-through !important;
}
.is-no-underlined {
  text-decoration: none !important;
}

.container-sm {
  max-width: 1080px;
  margin: 0 auto;
  &.is-fullwidth {
    max-width: 100%;
  }
}
