// Fonts Family
$font-bold: 'LG Smart Bold';
$font-light: 'LG Smart Light';
$font-regular: 'LG Smart Regular';
$font-semibold: 'LG Smart SemiBold';

// Font Info
$font-size-base: 14px !default;
$line-height-base: 1.5 !default;

// Color
$black: #000 !default;
$white: #ffffff !default;
$grayf3-5: #f3f4f5 !default;
$gray-ref0: #f0f0f0 !default;
$gray-re20: #202020 !default;
$gray-re21: #212121 !default;
$gray-re3: #333333 !default;
$gray-re4: #444444 !default;
$gray-re4a: #4a4a4a !default;
$gray-re6: #666666 !default;
$gray-re70: #707070 !default;
$gray-re9: #999999 !default;

$brown: #7f5360 !default;

$lipstick: #e42f66 !default;
$dirty-purple: #5c575a !default;
$rose-pink: #f0828c !default;
$warm-pink: #fd578a !default;

// text-color
$txt-color01: $gray-re6;

// Line Color

// Bg Color
$body-bg: $white !default;
$bg-gray: $grayf3-5;

// Design size

// Screen size
$max-xs: 575;
$min-sm: 576;
$max-sm: 767;
$min-md: 768;
$max-md: 991;
$min-lg: 992;
$max-lg: 1199;
$min-xl: 1200;

$login-bg-w: 100/1920;
$login-bg-h: 100/1080;

// Extend
%clearfix {
  *zoom: 1;
  &:before,
  &:after {
    content: ' ';
    display: table;
  }
  &:after {
    clear: both;
  }
}
%listreset {
  margin: 0;
  padding: 0;
  list-style: none;
  box-sizing: border-box;
}
%guideline {
  //border: 1px dashed red;
}
%guideline2 {
  //border: 1px dotted blue;
}
%height100vh {
  height: 100vh;
}

// font-family
@mixin font-family($font, $sytle: normal) {
  font-family: $font, Malgun Gothic, '맑은고딕', Arial, Dotum, '돋움', Gulim,
    '굴림';
  @if ($font == $font-regular) or ($font == $font-bold) {
    @if $sytle == italic {
      font-style: italic;
    } @else if $sytle == normal {
      font-style: normal;
    }
  }
  else {
    font-style: normal;
  }
  font-weight: normal;
}

// Screen
@mixin screen($size, $type: max, $pixels: false) {
  @if $size == 'xs' {
    //Default min size
    @media (max-width: $max-xs + px) {
      @content;
    }
  } @else if $size == 'sm' {
    @media (min-width: $min-sm + px) and (max-width: $max-sm + px) {
      @content;
    }
  } @else if $size == 'md' {
    @media (min-width: $min-md + px) and (max-width: $max-md + px) {
      @content;
    }
  } @else if $size == 'lg' {
    @media (min-width: $min-lg + px) and (max-width: $max-lg + px) {
      @content;
    }
  } @else if $size == 'mid' {
    //Default mid size
    @media (max-width: $max-md + px) {
      @content;
    }
  } @else if $size == 'xl' {
    //Default max size
    @media (min-width: $min-xl + px) {
      @content;
    }
  } @else if $size == 'landscape' {
    @media (orientation: landscape) {
      @content;
    }
  } @else if $size == 'portrait' {
    @media (orientation: portrait) {
      @content;
    }
  } @else if $size == 'custom' {
    @media ($type + -width: $pixels + px) {
      @content;
    }
  } @else if $size == 'print' {
    @media print {
      @content;
    }
  }
}

$lg-red: (
  50: #ffffff,
  100: #fff9fc,
  200: #f1e1e5,
  300: #ef4c73,
  400: #ec407a,
  500: #ed097e,
  600: #d81b60,
  700: #c2185b,
  800: #ad1457,
  900: #5f2a41,
  A100: #ff80ab,
  A200: #ff4081,
  A400: #ff3399,
  A700: #c51162,
  B100: #4f4f4f,
  B200: #67545b,
  G100: #ef4c73,
  G900: #352a37,
  contrast: (
    50: $dark-primary-text,
    100: $dark-primary-text,
    200: $dark-primary-text,
    300: $dark-primary-text,
    400: $light-primary-text,
    500: $light-primary-text,
    600: $light-primary-text,
    700: $light-primary-text,
    800: $light-primary-text,
    900: $light-primary-text,
    A100: $dark-primary-text,
    A200: $light-primary-text,
    A400: $light-primary-text,
    A700: $light-primary-text,
    B100: $light-primary-text,
    G100: $dark-primary-text,
    G900: $light-primary-text
  )
);

@mixin ucap-material-theme($theme) {
  @include ucap-core-theme($theme);
}

@mixin ucap-core-theme($theme) {
  $accent: map-get($theme, accent);
  $warn: map-get($theme, warn);
  $primary: map-get($theme, primary);
  $background: map-get($theme, background);
  $foreground: map-get($theme, foreground);

  $gradient-darkest: mat-color($accent, G900);
  $gradient-light: mat-color($accent, G100);

  //basic
  .bg-primary-darkest {
    background: mat-color($primary, 900);
    color: mat-color($primary, default-contrast);
  }
  .bg-primary-dark {
    background: mat-color($primary, 900);
    color: mat-color($primary, default-contrast);
  }
  .bg-primary-light {
    background: mat-color($primary, 300);
    color: mat-color($primary, default-contrast);
  }
  .bg-primary-color {
    background: mat-color($primary);
    color: mat-color($primary, default-contrast);
  }
  .bg-accent-darkest {
    background: mat-color($accent, 800);
    color: mat-color($primary, default-contrast);
  }
  .bg-accent-dark {
    background: mat-color($accent, B200);
    color: mat-color($primary, default-contrast);
  }
  .bg-accent-light {
    background: mat-color($accent, 300);
    color: mat-color($primary, default-contrast);
  }
  .bg-accent-bright {
    background-color: mat-color($accent, 100);
  }
  .bg-accent-brightest {
    background: mat-color($accent, 50);
    color: mat-color($primary, $dark-primary-text);
  }
  .bg-accent-color {
    background: mat-color($accent);
    color: mat-color($accent, default-contrast);
  }
  .bg-warn-color {
    background-color: mat-color($warn, 300);
  }
  .bg-warn-darkest {
    background-color: mat-color($warn, 600);
  }
  .text-primary-light {
    color: mat-color($primary, 500);
  }
  .text-primary-color {
    color: mat-color($primary);
  }
  .text-accent-dark {
    color: mat-color($accent, 600);
  }
  .text-accent-darkest {
    color: mat-color($accent, 800);
  }
  .text-accent-color {
    color: mat-color($accent);
  }
  .text-warn-color {
    color: mat-color($warn, 800);
  }
  .border-primary-color {
    border-color: 1px solid mat-color($primary);
  }
  .border-accent-bright {
    border-color: mat-color($accent, 300);
  }
  .border-accent-color {
    border-color: 1px solid mat-color($accent);
  }
  .stroke-accent-darkest {
    stroke: mat-color($accent, 800);
  }
  .border-warn-color {
    border: mat-color($warn);
  }
  .stroke-warn-color {
    stroke: mat-color($warn, 900);
  }
  // sass 정의
  .mat-toolbar {
    background-color: mat-color($accent, B100);
  }
  ///// gnb
  .gnb .mat-toolbar {
    background-color: $gray-ref0;
  }

  .main-container {
    border-color: mat-color($accent, B100);
  }
  .global-menu {
    background-color: mat-color($accent, B100);
  }

  .ucap-clickable {
    cursor: pointer;
  }

  .policy {
    color: mat-color($accent, B100);
  }

  .mat-badge-accent .mat-badge-content,
  .weblink .mat-badge-content {
    background-color: mat-color($warn, 400);
  }

  .mat-tab-group.mat-primary .mat-ink-bar,
  body.theme-default .mat-tab-nav-bar.mat-primary .mat-ink-bar {
    background-color: mat-color($accent, 500);
  }
  .mat-chip.mat-standard-chip.mat-chip-selected.mat-primary {
    background-color: mat-color($accent, 700);
    cursor: pointer;
  }

  .load-container .loader:after {
    background-color: mat-color($accent, 300);
  }

  .global-menu {
    .mat-tab-label[aria-selected='true'] {
      .mat-tab-label-content {
        .icon-item {
          background: mat-color($accent, 300);
        }
      }
    }
  }

  .mat-form-field-appearance-legacy {
    .mat-form-field-label {
      color: mat-color($primary);
    }

    .mat-hint {
      color: mat-color($primary);
    }

    .mat-form-field-underline {
      background-color: mat-color($primary);
    }
  }
  $pixels-amount: 0;
  .mat-form-field-infix {
    padding: $pixels-amount;
    border-top: $pixels-amount;
  }
  ////login input
  .idpass-type {
    .mat-form-field-empty {
      &.mat-form-field-label {
        top: 11px;
      }
    }
    .mat-form-field-can-float {
      &.mat-form-field-should-float {
        .mat-form-field-label {
          top: 11px;
          width: 0;
        }
      }
    }
    .mat-form-field {
      &.mat-focused {
        .mat-form-field-label {
          opacity: 0;
        }
      }
    }
  }
  //////////

  .mat-button-toggle-appearance-standard .mat-button-toggle-label-content {
    height: 34px;
    line-height: 34px;
    padding: 0 12px;
  }

  .app-dialog-full .mat-dialog-container {
    overflow: hidden;
    padding: 0px;
    background-color: rgba($color: #000000, $alpha: 0.7);
    box-shadow: none;
    border-radius: 0px;
  }

  .btn-main-float .bg-accent-dark {
    background: mat-color($accent, 600);
    color: mat-color($primary, default-contrast);
  }

  .current-head {
    display: flex;
    justify-content: center;
    padding: 0 10px;
    background-color: #eeeeee;
    background: $gradient-light;
    background: -webkit-linear-gradient(
      to right,
      $gradient-darkest,
      $gradient-light
    );
    background: linear-gradient(to right, $gradient-darkest, $gradient-light);
    color: #ffffff;
  }

  //[S]탭개수에 의한 width 정의
  .mat-tab-group {
    &.tab_num2 {
      .mat-tab-label {
        width: 50%;
        min-width: 50%;
      }
    }
    &.tab_num3 {
      .mat-tab-label {
        width: 33%;
        min-width: 33%;
      }
    }
    .mat-ink-bar {
      opacity: 1;
    }
    .mat-tab-body-wrapper {
      height: 100%;
      border: none;
    }
  }
  //[E]탭개수에 의한 width 정의

  //[S]쪽지 라디오 버튼 정렬
  .message-box {
    .mat-radio-label {
      .mat-radio-label-content {
        padding-left: 4px;
      }
    }
  }
  //[E]쪽지 라디오 버튼 정렬

  //[S]mat-tab-group
  /*mat-tab-group {
    display: flex;
    flex-direction: row;
    .mat-tab-header {
      width: 100%;
      .mat-tab-label-container {
        width: 100%;
      }
    }
  }*/

  mat-tab-group[vertical] {
    display: flex;
    flex-direction: column;
    .mat-tab-header {
      border-bottom: none;
      .mat-tab-labels {
        display: flex;
        flex-direction: column;
        align-content: flex-start;
        .mat-tab-label {
          justify-content: flex-start;
          padding: 0;
          &[aria-selected='true'] {
            opacity: 1;
          }
          .mat-checkbox {
            margin-right: 8px;
          }
        }
      }
    }
    .mat-ink-bar {
      opacity: 0;
    }
    .mat-tab-body-wrapper {
      flex: 1 1 auto;
      border-left: 1px solid #dddddd;
      padding: 0;
    }
  }

  //설정 general-theme
  .theme-list {
    .mat-tab-header {
      width: 100%;
      border: none !important;
      .mat-tab-labels {
        position: relative;
        width: 100%;
        flex-direction: row !important;
        .mat-tab-label {
          width: 140px;
          height: 120px;
          &.mat-tab-label-active {
            opacity: 1;
          }
          .mat-tab-label-content {
            position: relative;
            flex-flow: column;
            width: 100%;
          }
        }
      }
    }
  }
  //[E]mat-tab-group

  nav[mat-tab-nav-bar][vertical] {
    display: flex;
    flex-direction: row !important;

    .mat-tab-links {
      display: flex;
      flex-direction: column !important;
    }
  }

  .mat-form-field-appearance-legacy[inlineEdit] .mat-form-field-underline {
    background-color: transparent;
  }

  app-page-messenger-main mat-drawer-content {
    overflow: hidden !important;
  }

  .mat-tab-labels .cdk-focused {
    background-color: transparent !important;
  }

  .messages .container {
    background: mat-color($accent, 50);
  }
  .profile-img {
    .responsive-chats-button:last-child {
      background-color: mat-color($accent, B100);
    }
  }

  //[S]대화 말풍선 global 적용
  .message-row {
    .message-main {
      .bubble {
        background-color: mat-color($accent, 100);
        border: 1px solid mat-color($accent, 200);
        overflow: hidden;
        .bubble-main {
          word-wrap: break-word;
          white-space: pre-wrap;
          word-break: break-word;
          a {
            color: #0367a6;
            text-decoration: underline;
          }
        }
      }
    }
    &.me {
      .message-main {
        .bubble {
          background-color: #ffffff;
          border: 1px solid mat-color($primary, 300);
          .event-info {
            border-radius: 0 0 0 6px;
          }
        }
      }
    }
  }
  //[E]대화 말풍선 global 적용

  //[S]스티커
  .sticker-selector {
    .mat-tab-header {
    }
  }
  //[E]스티커

  //[S]번역
  .translationForm {
    background-color: mat-color($accent, 200, 0.4);
    .select-language {
      .mat-form-field-wrapper {
        width: 100%;
        line-height: 0.8em;
        .mat-form-field-infix {
          padding: 0.2em 0 0;
        }
      }
      .mat-form-field-underline {
        bottom: 0.8em;
      }
    }
  }
  .translation-preview {
    background-color: mat-color($accent, 900, 0.8);
  }
  //[E] 번역

  .tree-has-child {
    li {
      .tree-node-body {
        background-color: mat-color($accent, 100);
        border: 1px solid mat-color($accent, 200);
      }
    }
  }

  .mat-calendar {
    mat-calendar-header {
      .mat-calendar-header {
        .mat-calendar-controls {
          margin: 0;
        }
      }
    }
  }
  .mat-calendar-body-selected {
    background-color: mat-color($accent);
  }
  .list-item {
    &.selected {
      background-color: mat-color($accent, 100);
      border-right: 2px solid mat-color($accent, 800);
    }
  }
  .mat-simple-snackbar-action {
    button {
      background-color: mat-color($accent, 500);
    }
  }
  .chatroom-search {
    .search-form {
      border: 2px solid mat-color($accent, B100);
    }
    .btns {
      background-color: mat-color($accent, B100);
    }
  }
}
///////////////////////////////////////////////////
/////////////
// Select
@mixin selecCtrl($selec-height, $selec-width) {
  .mat-select-value {
    height: $selec-height + px;
    line-height: $selec-height + px;
  }
  .mat-form-field {
    height: $selec-height + px;
  }
  .mat-form-field-appearance-legacy .mat-form-field-wrapper {
    height: $selec-height + px;
  }
  .mat-form-field-appearance-legacy .mat-form-field-wrapper {
    padding-bottom: 0;
  }
  .mat-form-field-flex {
    height: $selec-height + px;
  }
}

//input
@mixin matinputCtrl($selec-height, $selec-width) {
  .mat-form-field-appearance-legacy {
    .mat-form-field-infix {
      padding: 0;
      border-top: 0;
      width: $selec-width + px;
    }
  }
  .mat-form-field-appearance-legacy {
    .mat-form-field-underline {
      display: none;
    }
  }
}
/////////////
////////////////////////////////////////////////////////
