@import '~@angular/material/theming';
@import "../../../../scss/variables";
@import "../../../../scss/mixins";
@import "../../../../scss/palettes";
@import "../../../../../public/css/variables";
@import "../../../../../public/css/functions";
@import "../../../../../public/css/mixins";
@import "~material-components-web/material-components-web";

:host {
  display: block;
  width: 100%;
  min-height: 100%;
  margin: 0;
  padding: 0;
}

.knk-ongoing-knok-card {
  cursor: pointer;
  @include knk-card;
  max-width: 900px;
  min-width: 698px;
  width: 100%;
  @include ng-theming {
    background-color: theme-get('color-surface');
  }

  &__headline {
    @include ng-theming {
      border: solid 1px theme-get('color-spacer');
      background-color: theme-get('color-secondary');
    }
  }

  &__content {
    padding: 0;
    @include ng-theming {
      border: solid 1px theme-get('color-spacer');
      border-top: none;
      background-color: theme-get('color-surface');
    }

    &#{&}--borderless {
      @include ng-theming {
        border-left: none;
        border-right: none;
      }
    }
  }

  &__headline ~ &__content ~ &__content:last-child,
  &__headline ~ &__content ~ &__content#{&}__content--endline {
    @include ng-theming {
      border: solid 1px theme-get('color-spacer');
      border-top: none;
      background-color: theme-get('color-surface');
    }
    box-shadow: 0 1px 5px 0 rgba(0, 0, 0, 0.05);
  }

  &__spacer {
    position: relative;
    width: 1px;
    height: calc(100% - 10px);
    margin: auto;
    @include ng-theming {
      background-color: theme-get('color-spacer');
    }
    transform: scale(1);
  }

  &__hspacer {
    position: relative;
    width: calc(100% - 10px);
    height: 1px;
    margin: auto;
    @include ng-theming {
      background-color: theme-get('color-spacer');
    }
    transform: scale(1);
  }

  &__trading {
    @include knk-font-default;
    font-size: 24px;
    @include ng-theming {
      color: theme-get('color-primary');
    }
  }

  &__exchange {
    opacity: 0.25;
    @include knk-font-default;
    font-size: 24px;
    @include ng-theming {
      color: theme-get('color-ongoing-label');
    }
  }

  &__label {
    opacity: 0.5;
    @include knk-font-default;
    font-size: 13px;
    letter-spacing: 1px;
    text-transform: uppercase;
    @include ng-theming {
      color: theme-get('color-ongoing-label');
    }
    white-space: nowrap;
  }

  &__note {
    @include knk-font-default;
    font-size: 30px;
    @include ng-theming($not: night) {
      color: theme-get('color-charcoal-grey');
    }
    @include ng-theming($if: night) {
      color: theme-get('color-white');
    }

    small {
      font-size: 15px;

      > small {
        font-size: 11px;
      }
    }

    &#{&}--wrong {
      @include ng-theming {
        color: theme-get('color-coral');
      }
    }

    &#{&}--success {
      @include ng-theming {
        color: theme-get('color-aqua-marine');
      }
    }
  }

  &__icon {
    font-size: 1em;

    &#{&}--wrong {
      @include ng-theming {
        color: theme-get('color-coral');
      }
    }

    &#{&}--success {
      @include ng-theming {
        color: theme-get('color-aqua-marine');
      }
    }
  }

  &__chart {
    width: 100%;
    min-height: 65px;
    height: auto;
    position: relative;

    &::ng-deep canvas {
      max-width: 100%;
    }
  }

  &__name {
    @include knk-font-default;
    font-size: 17px;
    @include ng-theming($not: night) {
      color: theme-get('color-charcoal-grey');
    }
    @include ng-theming($if: night) {
      color: theme-get('color-white');
    }
  }

  &__frontside {
    @include ng-theming {
      border-left: solid 1px theme-get('color-spacer');
    }
    box-shadow: 0 -1px 9px 0 rgba(0, 0, 0, 0.07);
  }

  &__cell {
    padding: 20px;

    &#{&}--dense {
      padding: 15px;
    }
  }
}

.knk-avatar {
  @include knk-avatar(52px);
}

.dropdown-menu.dropdown-menu--ongoing {
  z-index: 40;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
  outline: 0;
  border: 0;

  .knk-ongoing-dropdown-menu {
    left: auto;
    right: 100%;

    &__wrapper {
      left: 15px;
      right: auto;
    }
  }
}

.knk-ongoing-dropdown-menu {
  position: relative;
  z-index: 40;

  &__wrapper {
    position: absolute;
    top: 15px;
    z-index: 40;
    margin: 0;
    padding: 0;
    @include ng-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-surface');
    }

    &::before {
      content: '▴';
      position: absolute;
      z-index: 39;
      top: -30px;
      right: 0;
      height: 30px;
      margin-top: 5px;
      margin-right: 20px;
      @include ng-theming {
        color: theme-get('color-surface');
      }
      font-size: 60px;
      @include ng-theming($if: default) {
        text-shadow: 0 0 12px rgba(theme-get('color-primary'), 0.16), 0 0 12px rgba(theme-get('color-black'), 0.3);
      }
      @include ng-theming($if: night) {
        text-shadow: 0 0 12px rgba(theme-get('color-primary'), 0.16), 0 0 12px rgba(theme-get('color-white'), 0.3);
      }
      line-height: 0.5;
    }
  }

  &__list {
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 40;
    overflow-x: hidden;
    overflow-y: auto;
    min-width: 200px;
    max-height: 200px;
    width: auto;
    height: auto;
    margin: 0;
    padding: 5px 0;
    @include ng-theming {
      background-color: theme-get('color-surface');
    }
    list-style: none;
  }

  &__item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin: 0;
    padding: 5px 10px;
    outline: 0;
    border: 0;
    @include ng-theming {
      background-color: theme-get('color-surface');
    }
    cursor: pointer;
    transition: background-color 0.25s linear;
    will-change: background-color;
    @include knk-font-default;
    font-size: 16px;
    line-height: 2.2;
    @include ng-theming($if: default) {
      color: theme-get('color-charcoal-grey');
    }
    @include ng-theming($if: night) {
      color: theme-get('color-white');
    }

    &:hover {
      @include ng-theming {
        background-color: rgba(theme-get('color-primary'), 0.2);
      }
    }

    &#{&}--wrong {
      @include ng-theming {
        color: theme-get('color-coral');
      }
    }
  }
}

.knk-ongoing-user-card {
  @include knk-card;
  @include ng-theming {
    background-color: theme-get('color-surface');
  }

  &__content {
    @include ng-theming {
      background-color: theme-get('color-surface');
    }
  }

  &__name {
    @include knk-font-default;
    font-size: 17px;
    @include ng-theming($if: default) {
      color: theme-get('color-charcoal-grey');
    }
    @include ng-theming($if: night) {
      color: theme-get('color-white');
    }
  }
}

.knk-button {
  @include knk-button;

  &#{&}--feedback {
    max-width: 175px;
    min-width: 150px;
    width: auto;
    height: 26px;
    font-size: 12px;
    line-height: 24px;
    @include ng-theming {
      color: theme-get('color-primary');
    }
  }

  &#{&}--feedback &__icon {
    @include ng-theming {
      color: theme-get('color-primary');
    }
  }
}

ng-svg-icon.knk-ongoing-icon::ng-deep svg {
  max-width: 20px;
  max-height: 20px;
  width: auto;
  height: auto;
  @include ng-theming {
    fill: theme-get('color-font');
  }
  fill-rule: evenodd;
  clip-rule: evenodd;
  fill-opacity: 0.5;
}
