@import '@nebular/theme/styles/global/breakpoints';
@import '@nebular/theme/styles/theming';

@mixin truncate($line) {
  -webkit-line-clamp: $line;
  -webkit-box-orient: vertical;
  display: -webkit-box;
  overflow: hidden;
  text-overflow: ellipsis;
}

// Should disappear with bootstrap update to v5. The erroneous unit will be corrected (1 = 0.5, 2 = 0.5, 3 = 1, etc...).
@for $i from 1 through 4 {
  .gap-#{$i} {
    gap: #{$i}rem;
  }
}

// Should disappear with bootstrap update to v5.
.row-gap-1 {
  row-gap: 0.25rem;
}
.row-gap-2 {
  row-gap: 0.5rem;
}
.row-gap-3 {
  row-gap: 1rem;
}
.row-gap-4 {
  row-gap: 1.5rem;
}

.lineHeight-0 {
  line-height: 0;
}

.lineHeight-1 {
  line-height: 1rem;
}

.font-size-small {
  font-size: 12px;
}

// may disappear with the switch to bootstrap 5
.border {
  border-color: var(--border-basic-color-4) !important;
}
.border-top {
  border-color: var(--border-basic-color-4) !important;
}
.border-bottom {
  border-color: var(--border-basic-color-4) !important;
}
.border-left {
  border-color: var(--border-basic-color-4) !important;
}
.border-right {
  border-color: var(--border-basic-color-4) !important;
}

.nb-theme-default .text-mitigated {
  color: #6c757d;
}

.nb-theme-dark .text-mitigated {
  color: nb-theme(color-basic-600);
}

.text-mitigated-light {
  color: nb-theme(color-basic-600);
}

.text-muted {
  color: #8f959b;
}

.pointer {
  cursor: pointer;
}
.cursor-move {
  cursor: move;
}
.cursor-default {
  cursor: default;
}
.initial-capitalize::first-letter {
  text-transform: uppercase;
}

.section-title {
  border-bottom: 2px solid var(--color-basic-transparent-600);
  padding-bottom: 5px;
}

.ellipsis {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

nb-select.appearance-outline .select-button {
  min-width: auto !important;
}

nb-route-tabset .tab-link {
  padding-top: 0;
}

nb-radio.smallHeight {
  label {
    padding-top: 0.1rem !important;
    padding-bottom: 0.1rem !important;
  }
}

// Makes the disabled ghost button more discreet. By default, the background color makes it more visible than the non-deactivated buttons.
.nb-theme-default [nbButton].appearance-ghost.status-basic[disabled],
.nb-theme-default .appearance-ghost.status-basic[disabled][nbButtonToggle],
.nb-theme-dark [nbButton].appearance-ghost.status-basic[disabled],
.nb-theme-dark .appearance-ghost.status-basic[disabled][nbButtonToggle] {
  background-color: unset;
  color: #8f9bb354;
}

.option-list--break-word {
  .option-list > * {
    word-break: break-word;
  }
}

.cdk-overlay-backdrop {
  backdrop-filter: blur(3px);
}

.cdk-overlay-pane {
  nb-option-list {
    min-width: 15rem;
  }
}

nb-card.selected {
  border-left: 0.5rem solid var(--success);
  nb-card-body {
    padding-left: 1rem;
  }
}

.nb-theme-default nb-tabset .tab-link,
.nb-theme-dark nb-tabset .tab-link {
  padding: 1rem 1.5rem;
}

.divider {
  background-color: var(--card-divider-color);
}

.unselectable {
  user-select: none;
}

.unClickable {
  pointer-events: none;
}

.card-footer-actions {
  display: flex;
  flex-direction: column;
  grid-gap: 0.5rem;
}

@media screen and (min-width: 400px) {
  .card-footer-actions {
    flex-direction: row;
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }
}

.cdk-global-overlay-wrapper nb-dialog-container nb-card {
  max-width: 95vw;
  max-height: 95vh;
  margin: 0;
}

.nb-toggle-reset-label-margin {
  LABEL {
    margin-bottom: 0;
  }
}

.shader {
  position: absolute;
  bottom: -0.5rem;
  left: 0;
  right: 0;

  padding: 1rem;

  pointer-events: none;

  background: linear-gradient(0deg, rgba(255, 255, 255, 1) 10%, rgba(255, 255, 255, 0) 100%);
}

.nb-theme-dark .shader {
  background: linear-gradient(0deg, #222b45 10%, #222b4500 100%);
}

nb-menu {
  .menu-item {
    .menu-icon {
      min-width: 1em;
    }
  }
}

.min-width-5 {
  min-width: 5em;
}

.min-width-10 {
  min-width: 10em;
}

.min-width-15 {
  min-width: 15em;
}

.min-width-20 {
  min-width: 20em;
}

.min-width-90vw {
  min-width: 90vw;
}

.max-width-15em {
  max-width: 15em !important;
}

.list-group-item {
  background-color: unset;
}

[nbButton].size-small nb-icon {
  font-size: 0.95rem;
}

[nbButton].size-medium nb-icon {
  font-size: 1rem;
}

[nbButton].size-large nb-icon {
  font-size: 1.4rem;
}

[nbInput].status-basic:read-only {
  background-color: var(--input-basic-disabled-background-color);
  border-color: var(--input-basic-disabled-border-color);
  color: var(--input-basic-disabled-text-color);
}

.nb-spinner-container {
  // prevent spinners from being displayed over the application header
  z-index: 1020;
}

.opacity-100 {
  opacity: 1 !important;
}
.opacity-75 {
  opacity: 0.75 !important;
}
.opacity-50 {
  opacity: 0.5 !important;
}
.opacity-25 {
  opacity: 0.25 !important;
}
.opacity-0 {
  opacity: 0 !important;
}

.test-dialog-window {
  margin: 0 1rem !important;

  nb-card {
    box-shadow: 0px 2px 10px #00000025;
    background-color: var(--background-basic-color-2);
  }

  &.maximized {
    nb-card {
      max-width: 55vw;
    }
  }
  &.full-screen {
    nb-card {
      width: 90vw;
    }
  }
}
