/*!
 * MyTh Ahmed Faiz Copyright © 2016-2024 All rights reserved.
 * Email: mythpe@gmail.com
 * Mobile: +966590470092
 * Website: https://www.4myth.com
 * Github: https://github.com/mythpe
 */
@use 'sass:map';

.m--datatable-component {
  .m--control-cell > * {
    margin-left: 5px;
    margin-bottom: 5px;
  }
}

.touch {
  .m--dt-btn-tooltip {
    display: none !important;
  }
}

$text-light-color: #111111 !default;
$text-dark-color: #ffffff !default;
.body--light {
  color: $text-light-color;

  .text-color {
    color: $text-light-color !important;
  }
}

.body--dark {
  color: $text-dark-color;

  .text-color {
    color: $text-dark-color !important;
  }
}

$m-space-base: $space-base !default;
$container-padding: $m-space-base !default;
$row-margins: .5;
$container-fluid-width: 1024px !default;
$m--select__popup__height: 250px !default;
$m--input-helpers-margin: 5px !default;

.m--container__fluid {
  max-width: $container-fluid-width !important;
  margin: auto !important;
}

.m--input__top-label,
.m--input__hint {
  margin-bottom: $m--input-helpers-margin;
}

.m--input__caption {
  margin-bottom: $m--input-helpers-margin;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.25rem;
  letter-spacing: 0.03333em;
}

.m--row, .m--column, .m--flex {
  display: flex;
  flex-wrap: wrap;
}

.m--row + .m--row,
.m--column + .m--column {
  margin-top: $m-space-base * $row-margins;
}

.m--container {
  &:not(.m--container__dense):not(.dense) {
    padding: $container-padding;
  }
}

.m--select__popup__content {
  max-height: $m--select__popup__height !important;
}

.flex-break {
  flex: 1 0 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}

.row, .m--row {
  > {
    .flex-break {
      height: 0 !important
    }
  }
}

.column, .m--column {
  > {
    .flex-break {
      width: 0 !important
    }
  }
}


.ltr {
  html[dir=rtl] & {
    direction: rtl;
  }

  html[dir=ltr] & {
    direction: ltr;
  }
}

.rtl {
  html[dir=rtl] & {
    direction: ltr;
  }

  html[dir=ltr] & {
    direction: rtl;
  }
}

$text-decorations: ('none': none, 'overline': overline, 'underline': underline, 'line-through': line-through);
@each $name, $value in $text-decorations {
  .text-decoration-#{$name} {
    text-decoration: map.get($text-decorations, $value) !important;
  }
}

$text-wraps: ('wrap': wrap, 'nowrap': nowrap, 'balance': balance, 'pretty': pretty, 'stable': stable);
@each $name, $value in $text-wraps {
  .text-wrap-#{$name} {
    text-wrap: map.get($text-wraps, $value) !important;
  }
}

$breaks: ('inside', 'after', 'before');
@each $break in $breaks {
  .break-#{$break}-avoid {
    page-break-#{$break}: avoid;
  }
}

@each $break in $breaks {
  .break-#{$break}-always {
    page-break-#{$break}: always;
  }
}

$maxes: ('width', 'height') !default;
@each $max in $maxes {
  .max-#{$max} {
    max-#{$max}: 100% !important;
  }
}


.m--confirm.actions-between {
  .q-card__actions {
    justify-content: space-between !important;
  }
}

.pre-text {
  white-space-collapse: preserve-breaks;
  white-space: pre-line;
}

pre {
  max-width: 100%;

  html[dir=rtl] & {
    direction: rtl;
  }
}

$alignsX: ('top', 'bottom') !default;
$alignsY: ('left', 'right') !default;
$radius-class-name: 'border-rounded' !default;
$radius-value: $generic-border-radius !default;
$bordered-class-name: 'bordered' !default;
$bordered-size: 1px !default;
$bordered-style: $bordered-size solid $primary !default;

.#{$radius-class-name} {
  border-radius: $radius-value;
}

.#{$bordered-class-name} {
  border: $bordered-style;
}

@each $x in $alignsX {
  .bordered-#{$x} {
    border-#{$x}: $bordered-style;
  }
  .#{$radius-class-name}-#{$x} {
    border-#{$x}-left-radius: $radius-value;
    border-#{$x}-right-radius: $radius-value;
  }

  @each $y in $alignsY {
    .#{$radius-class-name}-#{$x}-#{$y} {
      border-#{$x}-#{$y}-radius: $radius-value;
    }

    .#{$radius-class-name}-#{$y} {
      border-bottom-#{$y}-radius: $radius-value;
      border-top-#{$y}-radius: $radius-value;
    }

    .bordered-#{$y} {
      border-#{$y}: $bordered-style;
    }
  }
}

@media print {
  .q-notifications {
    display: none !important;
  }
  .print-shadow-none {
    box-shadow: none !important;
    border: 0 !important;
  }
  .print-no-padding {
    padding: 0 !important;
  }
  .print-no-margin {
    margin: 0 !important;
  }
}

[data-input-name].m--input__error {
  > .q-field {
    &:not(.q-field--disabled) {
      .q-field__label::after {
        color: var(--q-negative);
      }
    }
  }

  .m--input__top-label__content {
    color: var(--q-negative);
  }
}

[data-input-name].m--input__required {
  &:not(.m--input__is-top-label) {
    > .q-field {
      &:not(.q-field--disabled) {
        .q-field__label::after {
          content: ' *';
        }
      }
    }
  }

  .m--input__top-label__content::after {
    content: ' *';
  }

}

.m--input__color-preview {
  border: 1px solid var(--q-primary);
  border-radius: $radius-value;
}

// ckeditor5
.ck.ck-block-toolbar-button {
  transform: translateX(-10px)
}

.ck[dir="rtl"] .ck-block-toolbar-button {
  transform: translateX(10px) !important
}

.m--control-cell.text-right {
  .m--dt-context_menu_items {
    justify-content: flex-end;
  }
}

.m--control-cell.text-left {
  .m--dt-context_menu_items {
    justify-content: flex-start;
  }
}
