@import "../variables.less";
@import "../mixins.less";

@import './lib/fontawesome.less';
@import './lib/materialdesign-icons.less';

.VuetifyApp {
  @import './lib/vuetify.less';
  @import './lib/Chart.min.less';

  .v-application {
    background: transparent !important;

    .display-4 {
      font-family: inherit !important;
    }
    .display-3 {
      font-family: inherit !important;
    }
    .display-2 {
      font-family: inherit !important;
    }
    .display-1 {
      font-family: inherit !important;
    }
    .headline {
      font-family: inherit !important;
    }
    .title {
      font-family: inherit !important;
    }

    .v-card__text {
      box-sizing: border-box;
    }

    .container.fluid .layout .flex {
      box-sizing: border-box;
    }
  
    .grid-list-md {
      box-sizing: border-box;
    }

    .v-tooltip__content {
      z-index: @zindexTooltip !important;
    }

    .v-btn--icon {
      border: 0;
    }

    a {
      color: @primaryColor;
    }

    textarea {
      border: Solid 2px @greyColor !important;
      max-width: 100%;
      padding: 3px 10px;
    }

    .border-box-sizing {
      box-sizing: border-box;
    }

    .v-divider--vertical {
      vertical-align: middle;
    }

    .v-select__selections {
      max-width: 80%;
    }

    .layout {
      max-width: 100%;
    }

    .v-messages {
      min-height: auto;
    }

    .v-divider {
      margin: 0;
      border-color: @borderColor;
    }

    .v-timeline::before {
      background: @borderColor;
      width: 1px;
    }

    .v-text-field {
      padding-top: 22px;

      input {
        min-height: auto;
      }
    }

    .v-text-field__details {
      display: contents;
    }
    .v-data-footer__select .v-select {
        padding: 0;
        input {
          padding: 0;
        }
    }
    .v-input.text-center input {
      text-align: center;
    }

    .uiPopup .popupHeader {
      margin-bottom: 22px;
    }

    label {
      margin-bottom: 0;
    }

    textarea {
      margin-bottom: 0;
    }

    code {
      padding: 0;
      max-width: 100%;
      white-space: normal;
    }

    .v-input {
      input {
        margin-bottom: 0;
        border: 0;
        box-shadow: none;
      }

      input::placeholder, i {
        color: @greyColorLighten1;
      }

      i {
        font-size: 16px;
      }
    }

    .paragraph {
      white-space: pre-line;
    }

    .v-dialog {
      transform: translate(0);
      max-width: 100vw !important;
      max-height: 100vh;
      margin: 0;
    }

    .v-dialog.with-overflow {
      overflow-y: auto;
      overflow-x: hidden;
    }
    .v-overlay {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      height: 100vh;
      width: 100vw;
      max-height: 100vh;
      max-width: 100vw;
      overflow: hidden;
    }

    // Apply Custom Branding
    .primary {
      background-color: @primaryColor !important;
      border-color: @primaryColor !important;
    }
    .primary--text {
      color: @primaryColor !important;
      caret-color: @primaryColor !important;
    }
    .primary-border-color {
      border: 1px solid @primaryColor !important;
    }
    .secondary {
      background-color: @textColor !important;
      border-color: @textColor !important;
    }
    .tertiary--text {
      color: @tertiaryColor!important;
    }
    .accent {
      background-color: @primaryColor !important;
      border-color: @primaryColor !important;
    }
    .accent--text {
      color: @primaryColor !important;
      caret-color: @primaryColor !important;
    }
    .btn {
      border: 1px solid @btnBorder !important;
      color: @btnColor !important;
      background-color: @btnBackgroundColor !important;
      background-image: @btnBackgroundImage !important;
      text-shadow: none !important;
      box-shadow: none !important;
      &:hover, &:focus {
        color: @btnColor !important;
      }
      font-weight: normal;
    }

    .v-btn.primary:not(.v-btn--text), .btn-primary:not(.v-btn--text) {
      font-family: @sansBoldFontFamily !important;

      &:not(.v-btn--outlined) {
        font-weight: bold !important;
        .buttonBackgroundEXO(@btnPrimaryBackground, @btnPrimaryBackgroundHighlight, @btnPrimaryBorder, @btnPrimaryColor) !important;
      }

      &.v-btn--outlined {
        border: thin solid @primaryColor !important;
        font-weight: normal;
        .buttonBackgroundEXO(@btnPrimaryColor, @btnPrimaryColor, @btnPrimaryBorder, @btnPrimaryBackground) !important;
      }

      &:hover {
        background-color: @btnPrimaryHoverBackgroundColor !important;
        background-position: @btnPrimaryHoverBackgroundPosition !important;
      }

      &.disabled, &[disabled] {
        background-color: @btnPrimaryDisableBackground !important;

        &:hover {
          background-color: @btnPrimaryDisableHoverBackground !important;
        }
      }
    }

    .uiAction .v-btn.primary.disabled:first-child,
    .uiAction .v-btn.primary[disabled]:first-child ,
    .v-btn.primary[disabled]:first-child,
    .v-btn.primary[disabled],
    .uiAction .btn.disabled:first-child,
    .uiAction .btn[disabled]:first-child,
    .uiAction .btn-primary.disabled:first-child,
    .uiAction .btn-primary[disabled]:first-child ,
    .btn-primary[disabled]:first-child,
    .btn-primary[disabled],
    .uiAction .btn.disabled:first-child,
    .uiAction .btn[disabled]:first-child {
      color: @btnPrimaryColor !important;
    }
    .primary--text {
      color: @primaryColor !important;
    }
    .primary:not([disabled]) {
      background-color: @primaryColor !important;
      color: #fff !important;
    }
    .primary--text {
      color: @primaryColor !important;
      caret-color: @primaryColor !important;
    }
    .v-tab {
      color: @greyColorLighten1 !important;
    }
    .v-tab--active {
      color: @tertiaryColor !important;
    }
    .v-tabs-slider-wrapper {
      .v-tabs-slider.primary {
        background-color: @tertiaryColor !important;
      }
      .v-tabs-slider {
        color: @tertiaryColor !important;
      }
    }
    .row {
      padding: 0;
    }
    .v-text-field .v-input__prepend-inner {
      margin: auto;
    }
    .v-stepper {
      box-shadow: none;

      .v-stepper__step:not(.v-stepper__step--inactive) .v-stepper__step__step {
        background-color: @tertiaryColor !important;
      }
    }
    .v-stepper--vertical {
      margin-left: -23px;
      margin-top: -23px;
    }
    .warning {
      background: @warningBackground !important;
      border-color: @warningBorder !important;
      color: @warningText !important;

      i:before {
        color: @warningColor !important;
      }
    }
    .error {
      background: @errorBackground !important;
      border-color: @errorBorder !important;
      color: @errorText !important;

      i:before {
        color: @errorColor !important;
      }
      .v-alert__icon:before {
        font-family: "PLF-FONT-ICONS";
        content: "\e76d";
      }
    }
    .success {
      background: @successBackground !important;
      border-color: @successBorder !important;
      color: @successText !important;

      i:before {
        color: @successColor !important;
      }
      .v-alert__icon:before {
        font-family: "PLF-FONT-ICONS";
        content: "\e770";
      }
    }
    .info {
      background: @infoBackground !important;
      border-color: @infoBorder !important;
      color: @infoText !important;

      i:before {
        color: @infoColor !important;
      }
      .v-alert__icon:before {
        font-family: "PLF-FONT-ICONS";
        content: "\e767";
      }
    }
    .error--text {
      color: @errorColor !important;

      i:before {
        color: @errorColor !important;
      }
    }
    .success--text {
      color: @successColor !important;

      i:before {
        color: @successColor !important;
      }
    }
    .info--text {
      color: @infoColor !important;

      i:before {
        color: @infoColor !important;
      }
    }
    .autocompleteSelectedItem {
      background: @mentionBackground !important;
      color: @mentionColor !important;
      border: @mentionBorder !important;
    }
    .v-skeleton-loader {
      .v-skeleton-loader__avatar, .v-skeleton-loader__button, .v-skeleton-loader__chip, .v-skeleton-loader__divider, .v-skeleton-loader__heading, .v-skeleton-loader__image, .v-skeleton-loader__text {
        background: @skeletonColor;
      }
    }

    .btn-group {
      > .btn:first-child {
        border-radius: 4px 0 0 4px;
      }
      > .btn:last-child, > .dropdown-toggle {
        border-radius: 0 4px 4px 0;
        margin-left: 1px;
      }
      .dropdown-menu {
        padding: 0;
        margin: 0;
        width: 100%;
        min-width: auto;
        border: 0;
        margin-top: 1px;
      }
      .dropdown-button {
        width: 100%;
        box-sizing: border-box;
        padding-left: 0;
      }
    }
    .v-treeview-node__toggle {
      padding: 0;
    }

    .v-data-table table {
      table-layout: fixed;
    }
  }
}

.v-application--wrap {
  min-height: auto !important;
  position: static;
}

.v-navigation-drawer {
  position: fixed !important;
  z-index: @zindexDrawer !important;
}

@media (max-width : 959px) {
  .VuetifyApp .v-application {
    .uiPopup.v-dialog:not(.v-dialog--fullscreen) .v-card__text {
      max-height: ~"calc(100vh - 235px)";
      overflow-y: auto;
      overflow-x: hidden;

      > .container {
        max-width: ~"calc(100% - 32px)";
      }
    }

    .v-dialog {
      overflow: visible;
      border-radius: 4px;
      transform: translate(0);
      max-width: 100vw !important;
      max-height: 100vh;
      margin: 0;
    }
  }
}
