@import '../../src/scss/knoks-theme';
@import '../../src/scss/common/font-sizes';
@import '../../src/scss/common/font-family';
@import '~bootstrap/dist/css/bootstrap.min.css';
@import "~nouislider/distribute/nouislider.min.css";
@import '~normalize.css/normalize.css';
@import '~quill/dist/quill.snow.css';
@import "variables";
@import "functions";
@import "mixins";
@import "material_cdk";
@import "mvp";
@import "forms";
@import "expanded_knok";
@import "create_knok";
@import "search";

html {
  height: 100%;
}

body {
  overflow: auto;
  min-height: 100%;
  height: auto;
  margin: 0;
  padding: 0;
  font-family: $page-font-family;
}

*::-webkit-scrollbar-track {
  -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  background-color: #F4F8F9;
}

*::-webkit-scrollbar {
  width: 12px;
  background-color: #F4F8F9;
}

*::-webkit-scrollbar-thumb {
  border-radius: 10px;
  -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .3);
  background-color: #Ffff;
}

.mat-menu-panel {
  @include theming($if: night) {
    background-color: theme-get('color-secondary');
    box-shadow: 0px 3px 1px -2px rgba(theme-get('color-shadow'), 0.2), 0px 2px 2px 0px rgba(theme-get('color-shadow'), 0.14), 0px 1px 5px 0px rgba(theme-get('color-shadow'), 0.12)
  }
}

.mat-menu-item {
  @include theming($if: night) {
    color: theme-get('color-font');
  }
  .mat-icon {
    @include theming($if: night) {
      color: theme-get('color-font');
    }
  }
}

* {
  @include knk-prop-alias(box-sizing, border-box);
}

a {
  outline: 0;
}

.clearfix {
  @include knk-clearfix();
}

i.material-icons {
  outline: 0;
  @include theming($if: night) {
    color: theme-get('color-font');
  }
}

[data-mdc-tooltip]:before {
  position: absolute;
  background-color: #616161;
  opacity: .9;
  color: white;
  height: 16px;
  border-radius: 2px;
  padding: 4px 8px;
  font-weight: 400;
  font-size: .75em;
  font-family: Roboto;
  margin-top: 22px;
  content: attr(data-mdc-tooltip);
  visibility: hidden;
}

@keyframes fadeIn {
  0% {
    opacity: 0;
    border-bottom-left-radius: 50%;
    border-bottom-right-radius: 50%;
    margin-top: 0px;
    transform: scale(0.5)
  }
  100% {
    opacity: .9;
    border-bottom-left-radius: 2px;
    border-bottom-right-radius: 2px;
    margin-top: 22px;
    transform: scale(1)
  }
}

[data-mdc-tooltip]:hover:before {
  visibility: visible;
  animation: .30s fadeIn;
}

.cdk-global-overlay-wrapper,
.cdk-overlay-container,
.cdk-overlay-backdrop,
.cdk-overlay-pane,
bs-dropdown-container,
bs-dropdown-container .dropdown,
bs-tooltip-container,
bs-tooltip-container .tooltip {
  z-index: 100;
}

.material-icons.knk-overlay-icon {
  cursor: pointer;
  font-size: 36px;
  color: #ffffff;
  transition: color 0.25s ease-in-out;
  will-change: color;

  &:hover {
    color: $knk-color-primary;
  }
}

.knk-base-card {
  padding: 20px 35px 25px 30px;
  box-shadow: 0 1px 9px 0 rgba(0, 0, 0, 0.1);
  // background-color: #ffffff;
  @include theming() {
    background-color: theme-get('color-surface');
  }
}

.knk-base-splitter {
  position: relative;
  height: 10px;
  padding: 5px 0;

  &:before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    margin-top: 5px;
    border-top: dashed 1px #979797;
  }
}

.flip-horizontal {
  -moz-transform: scale(-1, 1);
  -webkit-transform: scale(-1, 1);
  -o-transform: scale(-1, 1);
  transform: scale(-1, 1);
  filter: FlipH;
  -ms-filter: "FlipH";
}

.flip-vertical {
  -moz-transform: scale(1,-1);
  -webkit-transform: scale(1, -1);
  -o-transform: scale(1, -1);
  transform: scale(1, -1);
  filter: FlipV;
  -ms-filter: "FlipV";
}

.knk-icon-analysis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 15px;
  border-radius: 50.5px;
  @include theming($if: default) {
    background-color: #e2e2e2;
  }
  @include theming($if: night) {
    background-color: theme-get('color-background');
  }
  @include knk-font-default;
  font-size: 16px;
  font-weight: bold;
  color: #ffffff;
  cursor: default;

  &#{&}--control {
    cursor: pointer;
  }

  &#{&}--dense {
    padding: 3.5px 10.5px;
    font-size: 11px;
  }

  &#{&}--technical {
    background: linear-gradient(120deg, #4275ff, #82a3ff);
  }

  &#{&}--fundamental {
    background: linear-gradient(120deg, #3bb3eb, #70d1fe);
  }
}

.knk-card {
  @include knk-card;

  &__headline {
    &#{&}--colourful {
      @include theming {
        z-index: 22;
        border: solid 1px theme-get('color-primary');
        background-color: theme-get('color-primary');
        color: #ffffff;
      }
    }
  }

  &__title {
    @include knk-font-default;
    font-size: 24px;
    font-weight: bold;
    color: inherit;
  }

  &__hint {
    @include knk-font-default;
    @include theming($if: default) {
      color: rgba(theme-get('color-font'), 0.5);
    }
    @include theming($if: night) {
      color: theme-get('color-font');
    }

    &#{&}--clear {
      font-size: 18px;
      @include theming {
        color: theme-get(color-font);
      }
    }
  }

  &#{&}--feedback-knok &__content {
    padding: 30px 150px 35px 35px;
  }

  &#{&}--feedback-ended &__content {
    padding: 30px 135px 35px 35px;
  }
}

.knk-card-label {
  margin-bottom: 15px;
  opacity: 0.5;
  @include knk-font-default;
  font-size: 13px;
  letter-spacing: 1px;
  @include theming {
    color: theme-get('color-ongoing-label');
  }
  text-transform: uppercase;
}

.knk-svg-icon {
  cursor: pointer;
  &__stroke {
    stroke: none;
  }

  &__fill {
    fill: #000000;
  }

  &#{&}--save &__stroke {
    stroke: #000000;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1;
  }

  &#{&}--save &__fill {
    fill: #ffffff;
  }

  &#{&}--pressed#{&}--save &__stroke {
    stroke: $knk-color-primary;
  }

  &#{&}--pressed#{&}--save &__fill {
    fill: $knk-color-primary;
  }
}

.knk-tab-group {
  @include knk-tab-group;

  &#{&}--analysis {
    .mat-tab-body-content {
      padding: 35px 40px 35px 30px;
      @include theming {
        background-color: theme-get('color-surface');
      }
    }
  }
}

.knk-tab-nav {
  @include theming {
    border-bottom: 1px solid rgba(theme-get('color-surface'), 0.12);
  }

  .mat-tab-link {
    opacity: 1;
    min-width: 252px;
    height: 38px;
    margin-right: 3px;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
    box-shadow: 0 2px 9px 0 rgba(0, 0, 0, 0.02);
    @include knk-font-default;
    font-size: 13px;
    line-height: 2;
    @include theming($if: default) {
      background-color: rgba(theme-get('color-surface'), 0.8);
      color: #9b9b9b;
    }
    @include theming($if: night) {
      background-color: rgba(theme-get('color-surface'), 0.8);
      color: theme-get('color-font');
    }

    &.mat-tab-label-active {
      font-weight: bold;
      @include theming {
        background-color: theme-get('color-surface');
        color: $knk-color-primary;
      }
    }
  }

  &.mat-primary .mat-tab-label:not(.mat-tab-disabled):focus,
  &.mat-primary .mat-tab-link:not(.mat-tab-disabled):focus,
  & .mat-tab-nav-bar.mat-primary .mat-tab-label:not(.mat-tab-disabled):focus,
  & .mat-tab-nav-bar.mat-primary .mat-tab-link:not(.mat-tab-disabled):focus {
    @include theming {
      background-color: rgba(theme-get('color-primary'), 0.3);
    }
  }

  .mat-ink-bar {
    height: 4px;
    border-radius: 0;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
    background-color: $knk-color-primary;
    box-shadow: 0 0 12px 0 transparentize($knk-color-primary, 0.5);
    transform: scale(0.95);
  }

  &.mat-primary .mat-ink-bar,
  & .mat-tab-nav-bar.mat-primary .mat-ink-bar {
    background-color: $knk-color-primary;
  }
}

.knk-page-content {
  position: relative;
  left: 20px;
  max-width: 1280px;
  width: 100%;
  margin: 30px auto;

  &__outlet {
    padding: 30px 60px 40px 60px;
    @include theming {
      background-color: rgba(theme-get('color-surface'), 0.8);
    }
  }
}

bs-tooltip-container.knk-tooltip {
  &.tooltip {
    .tooltip-inner {
      max-width: 180px;
      min-width: 100px;
      padding: 10px 10px;
      // border: solid 1px rgba(38, 40, 59, 0.1);
      // background-color: #ffffff;
      // box-shadow: 0 0 9px 0 rgba(0, 0, 0, 0.3);
      @include knk-font-default;
      font-size: 11px;
      line-height: 1.45;
      text-align: center;
      @include theming {
        border: solid 1px rgba(theme-get('color-primary'), 0.16);
        box-shadow: 0 0 12px 0 rgba(theme-get('color-black'), 0.3);
        background-color: theme-get('color-secondary');
        // color: theme-get('color-ongoing-label'); // rgba(38, 40, 59, 0.7);
        color: theme-get('color-menu-label');
      }
    }
  }

  &.tooltip.bs-tooltip-bottom {
    // transform: translateY(5px);
    transform: translateY(0);

    .tooltip-arrow.arrow {
      left: 50%;
      width: 0;
      height: 0;
      margin-left: -10px;

      &:before,
      &:after {
        content: '';
        position: absolute;
        pointer-events: none;
        border: solid transparent;
        height: 0;
        width: 0;
        left: auto;
        right: auto;
        bottom: 0;
      }

      &:before {
        border-width: 0 .8rem .8rem;
        margin: -7px 0;
        @include theming {
          border-bottom-color: rgba(theme-get('color-primary'), 0.16);
        }
      }

      &:after {
        border-width: 0 .8rem .8rem;
        margin: -8px 0;
        @include theming {
          border-bottom-color: theme-get('color-secondary');
        }
      }
    }
  }

  &.tooltip.bs-tooltip-top {
    // transform: translateY(-5px);
    transform: translateY(0);

    .tooltip-arrow.arrow {
      left: 50%;
      width: 0;
      height: 0;
      margin-left: -10px;

      &:before,
      &:after {
        content: '';
        position: absolute;
        pointer-events: none;
        border: solid transparent;
        height: 0;
        width: 0;
        left: auto;
        right: auto;
        top: 0;
      }

      &:before {
        border-width: .8rem .8rem 0;
        margin: -7px 0;
        @include theming {
          border-top-color: rgba(theme-get('color-primary'), 0.16);
        }
      }

      &:after {
        border-width: .8rem .8rem 0;
        margin: -8px 0;
        @include theming {
          border-top-color: theme-get('color-secondary');
        }
      }
    }
  }
}

bs-tooltip-container.knk-tooltip--align-left.knk-tooltip {
  &.tooltip {
    .tooltip-inner {
      text-align: left;
    }
  }
}

.mdc-menu-anchor.knk-dropdown,
.knk-dropdown {
  @include knk-dropdown;
}

ng-svg-icon.knk-knok-grade {
  svg {
    max-width: 24px;
    max-height: 22px;
    width: auto;
    height: auto;
    fill-rule: evenodd;
    clip-rule: evenodd;
  }

  &--transparent svg {
    fill-opacity: 0.25;
  }
}

.knk-feedback-benefit {
  position: relative;

  &:after {
    content: "";
    z-index: -1;
    position: absolute;
    top: calc(50% + 10px);
    left: 0;
    right: 0;
    transform: scaleX(0.8);
    @include theming($if: default) {
      border-bottom: 1px solid #f5f5f5;
    }
    @include theming($if: night) {
      border-bottom: 1px solid rgb(91, 92, 108);
    }
  }
}

.knk-feedback-benefit-item {
  position: relative;

  & label {
    margin: 0 auto;
  }

  & input {
    width: 0;
    height: 0;
    margin: 0;
    padding: 0;
    font: 0 none;
    opacity: 0;
  }

  &__model {
    position: relative;
    display: block;
    width: 20px;
    height: 20px;
    margin: 5px auto;
    border: 1.5px solid currentColor;
    border-radius: 50%;
    color: rgba(0,0,0,.87);
    cursor: pointer;
    @include theming {
      background-color: theme-get('color-surface');
    }
  }

  &__icon {
    display: block;
    margin: 0 auto;
  }

  &__note {
    display: block;
    @include knk-font-default;
    font-size: 15px;
    text-align: center;
    @include theming($if: default) {
      color: rgba(theme-get('color-font'), 0.5);
    }
    @include theming($if: night) {
      color: theme-get('color-font');
    }
  }

  & input:checked + &__model:after {
    content: "";
    position: absolute;
    display: block;
    top: 3.5px;
    left: 3.5px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: currentColor none;
    color: inherit;
  }

  &:nth-child(1) &__model {
    @include theming {
      color: rgba(theme-get(color-primary), .87);
    }
  }

  &:nth-child(2) &__model {
    @include theming {
      color: rgba(theme-get(color-aqua-marine), .87);
    }
  }

  &:nth-child(3) &__model {
    @include theming {
      color: rgba(theme-get(color-blowball), .87);
    }
  }

  &:nth-child(4) &__model {
    @include theming {
      color: rgba(theme-get(color-coral), .87);
    }
  }

  &:last-child &__model {
    @include theming($if: default) {
      color: rgba(0,0,0, .87);
    }
    @include theming($if: night) {
      color: #ffffff;
    }
  }
}

ng-svg-icon.knk-feedback-benefit-item__icon svg {
  max-width: 42px;
  max-height: 42px;
  width: auto;
  height: auto;
  fill-rule: evenodd;
  clip-rule: evenodd;
  will-change: fill, stroke;
}

.knk-feedback-benefit-item:last-child ng-svg-icon.knk-feedback-benefit-item__icon svg {
  @include theming($if: default) {
    fill: #000000;
  }
  @include theming($if: night) {
    fill: #ffffff;
  }
}

.knk-page-header {
  @include knk-font-default;
  @include theming($if: night) {
    color: #ffffff;
  }
  font-size: 24px;
}

.knk-profile-card {
  max-width: 550px;
  width: auto;
  margin: 130px auto 0;
}

ng-button-distorted.ng-button-distorted--save.ng-button-distorted {
  max-width: 168px;
  min-width: 168px;
  width: auto;
  max-height: 34px;
  min-height: 34px;
  height: auto;

  .ng-button-distorted__label {
    font-size: 14px;
    line-height: 2.2;
  }

  .circle {
    width: 17px;
    height: 17px;

    &.top-left {
      top: 9px;
      left: 9px;
    }

    &.bottom-right {
      bottom: 9px;
      right: 9px;
    }
  }
}

/*
  Theming
  Sample
  p.s.: ng-theming for angular component styles

  .parent {
    border: 1px solid theme-pull('color-surface', default);

    @include theming {
      color: theme-get('color-font');
    }

    @include theming($if: night) {
      background-color: theme-get('color-background');
    }

    @include theming($not: default) {
      border: 1px solid theme-get('color-surface');
    }

    .child {
      opacity: 1;

      @include theming($if: default night) {
        opacity: 0.5;
      }
    }
  }
*/

