.true-modal-overlay {
  background-color: rgba(0,0,0,0.4);
  transition: opacity 0.3s ease;
}

// -- INPUTS --------------------------------------------------------------
.true-input {
  input, select {
    width: 100%;
    padding: $input-padding-v $input-padding-h;
    border: 1px solid $control-border-color;
  }
}

.true-input_popup-visible {
  input {
    border-color: $accent;
  }
  .true-input__btn {
    background: none;
    color: $input-btn-color_hover;
  }
}

input.true-disable-te:not(:disabled) {
  cursor: pointer;
}

.true-input_with-btn input {
  width: 100%;
  padding: $input-padding-v $input-wbtn-padding-right $input-padding-v $input-padding-h;
  margin-right: 0;
}

.true-input_with-error {
  input {
    border-color: $error-color;
    background-color: $error-back-color;
  }
}

.true-input__err-msg {
  color: $error-color;
  padding-top: 0.3em;
  font-size: 0.75em;
}

.true-input__btn {
  color: $input-btn-color;
  border: none;
  background: none;
  transition: color 0.15s ease;

  min-width: $input-btn-width;
  max-width: $input-btn-width;

  margin-left: -$input-btn-width;
  padding: $input-padding-v 0;

  &:focus {
    outline: none;
  }

  &:not(:disabled):hover {
    border: none;
    background: none;
    cursor: pointer;
    color: $input-btn-color_hover;
  }
}

// -- LINK -----------------------------------------------------------------
a.true-link_disabled {
  cursor: default;
  color: $text-disabled-color !important;
  border-bottom: 1px dotted $text-disabled-color !important;
}

// -- POPUP ---------------------------------------------------------------
.true-popup {
    z-index: 9;
    background-color: $popup-back-color;
    border: 1px solid $popup-border-color;
    box-shadow: $popup-shadow;
    transition: opacity 0.2s ease, transform 0.15s ease-out;
}

// -- MENU ----------------------------------------------------------------
.true-menu {
  background-color: #fff;
  display: flex;
  flex-direction: column;
  padding: 5px 0;

  .true-menu-item {
    button {
      cursor: pointer;
      padding: 0.6em 0.4em;
      border: none;
      font-weight: normal;
      white-space: nowrap;

      div:first-child {
        margin-right: 2em;
      }

      &:not(:disabled):hover {
        border: none;
        background: $btn-back-color_hover;
      }

      &:focus {
        outline: none;
      }

      span {
        display: inline-block;
        width: 1.6em;
        min-width: 1.6em;
        margin: 0 0.6em;
        flex-grow: 0;
        color: #666;
      }

      &:disabled {
        cursor: default;
        color: $text-disabled-color;

        span {
          color: $text-disabled-color;
        }

        .true-submenu {
          color: $text-disabled-color;
        }
      }
    }
  }

  .true-submenu-visible button {
      background-color: $btn-back-color_hover !important;
  }

  .true-menu-item:not(:first-child).true-menu-item_divide:before {
    content: "";
    border-top: 1px dashed $control-border-color;
    display: block;
    margin: 5px 0;
    height: 0.0;
  }
}

// -- CALENDAR ------------------------------------------------------------
.true-calendar {

  padding: 0.2em;

  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;

  display: inline-block;

  // Div with control buttons
  .true-calendar__controls {
    padding: 1.2em 0.4em;

    .true-button {
      padding: 0.5em 0.6em;
    }

    // Button with month and year
    div:first-child > .true-button {
      min-width: 9em;
    }
  }

  table.true-days col, table.true-day-names col {
    width: 2.5em;
  }

  table.true-months col {
    width: 6.0em;
  }

  table.true-years col {
    width: 4.48em;
  }

  table.true-day-names {

    border: 0;
    margin: 0;

    // Week days
    thead td {
      color: $text-disabled-color;
      border: 0px solid transparent;
      text-align: center;
      font-size: 0.75em;
      padding: 0.3em 0;
    }

    tbody tr:first-child td {
      padding: 0.3em 0;
      border-top: 1px solid $control-border-color;
    }
  }

  table.true-days:focus td.true-selected {
    background-color: $btn-back-color_hover;
  }

  table.true-days, table.true-months, table.true-years {
    border: 0;
    margin: 0;

    tbody {
      tr {
        td {
          border: 1px solid transparent;
          text-align: center;
          padding: 0.6em 0;

        }

        td:hover:not(.true-transparent) {
          cursor: pointer;
          background-color: $btn-back-color_hover;
        }

        // Не выбранный месяц
        td:not(.true-current) {
          color: $text-disabled-color;
        }

        td.true-today {
          border-color: #ddd;
        }

        td.true-current.true-selected {
          border-color: $accent;
        }
      }
    }
  }
}

// -- TURNABLE ICON -------------------------------------------------------
.true-turnable {
  line-height: 1.1em;
  display: inline-block;
  transition: transform 0.25s ease;
}

.true-turned {
  transform: rotate(179deg);
}

// -- Disabled text -------------------------------------------------------
.true-dis-color {
  color: $text-disabled-color;
}

// -- CHECKBOX ------------------------------------------------------------
.true-checkbox {
  text-align: left;
  display: block;
  position: relative;
  padding-left: 2.0em;
  cursor: pointer;
  user-select: none;

  // Hide default checkbox
  input {
    position: absolute;
    opacity: 0;
    height: 0;
    width: 0;
  }

  input:focus ~ .true-checkbox__checkmark {
    border-color: $accent;
  }

  // Show the checkmark when checked
  input:checked ~ .true-checkbox__checkmark:after {
    display: block;
  }

  // Custom checkbox
  .true-checkbox__checkmark {
    position: absolute;
    left: 0;
    top: 0;
    height: 1.3em;
    width: 1.3em;
    min-width: 1.3em;
    border: 1px solid $control-border-color;
    transition: border-color 0.25s ease, background-color 0.25s ease;
  }

  // Checkmark/indicator (hidden when not checked)
  .true-checkbox__checkmark:after {
    content: "";
    position: absolute;
    display: none;
  }

  // Style the checkmark/indicator
  .true-checkbox__checkmark:after {
    left: 0.45em;
    top: 0.1em;
    width: 0.3em;
    height: 0.7em;
    border: solid #444;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
  }
}

// Inversed view
.inversed > .true-checkbox input:checked ~ .true-checkbox__checkmark {
  background-color: $accent;
  border-color: $accent;
}

.inversed > .true-checkbox .true-checkbox__checkmark:after {
  border: solid $fore-color_inversed;
  border-width: 0 2px 2px 0;
}

// -- BUTTONS -------------------------------------------------------------
.true-button {
 background: none;
 border: 1px solid rgba(255, 255, 255, 0.0);
 font-weight: normal;
 cursor: pointer;
 border-radius: $btn-radius;
 padding: $input-padding-v $input-padding-v;
 // transition: background-color 0.2s ease; //, color 0.2s ease, border-color 0.2s ease;
 white-space: nowrap;

 span {
   color: $btn-color;
   transition: color 0.2s ease;
 }

 &:disabled {
   cursor: default;
   color: $text-disabled-color;
 }

 &:not(:disabled):hover
 {
   background-color: $btn-back-color_hover;
   border: 1px solid $btn-back-color_hover;
   span {
     color: $btn-color_hover;
   }
 }

 &:focus {
   outline: 0;
 }

 &:active {
   color: $accent;
   background-color: $btn-back-color_hover;
   span {
     color: $accent !important;
   }
 }

 &.stroked {
   background: #fbfcfd;
   border: 1px solid $control-border-color;

   &:hover {
     background: $btn-back-color_hover;
     border: 1px solid $control-border-color;
   }

   &:focus {
     border: 1px solid $control-border-color;
     background: $btn-back-color_hover;
   }

   &:active {
     color: unset;
     border: 1px solid $accent;
   }
 }

 &.flat {
   border: none;
   background: none;

   span {
     transition: opacity 0.25s ease;
     opacity: 0.5;
   }

   &:not(:disabled):hover {
     background: none;
     border: none;
     span {
       opacity: 1.0;
     }
   }

   &:not(:disabled):focus {
     background: none;
     span {
       color: $btn-color_hover;
     }
   }

   &:not(:disabled):focus span {
     opacity: 1.0;
   }

   &:not(:disabled):active span {
     color: $accent;
   }
 }

 &.primary {
   font-weight: bold;
   background-color: $btn-color_primary;
   border: 1px solid $btn-color_primary;
   color: $fore-color_inversed;
   span {
     color: $fore-color_inversed;
   }

   &:focus {
     background-color: $btn-color-primary_focus;
     border: 1px solid $btn-color-primary_focus;
   }

   &:disabled {
     background-color: $text-disabled-color;
     border: 1px solid $text-disabled-color;
   }

   &:not(:disabled):hover {
     background-color: $btn-color-primary_hover;
     border: 1px solid $btn-color-primary_hover;
     span {
       color: $fore-color_inversed;
     }
   }

   &:not(:disabled):active span {
     color: $btn-color-primary_focus;
   }
 }

 &.danger {
   font-weight: bold;
   background-color: $btn-color_danger;
   border: 1px solid $btn-color_danger;
   color: $fore-color_inversed;
   span {
     color: $fore-color_inversed;
   }

   &:focus {
     background-color: $btn-color-danger_focus;
     border: 1px solid $btn-color-danger_focus;
   }

   &:disabled {
     background-color: $text-disabled-color;
     border: 1px solid $text-disabled-color;
   }

   &:not(:disabled):hover {
     background-color: $btn-color-danger_hover;
     border: 1px solid $btn-color-danger_hover;
     span {
       color: $fore-color_inversed;
     }
   }

   &:not(:disabled):active span {
     color: $btn-color-danger_focus;
   }
 }

 &.primary.outline {
   font-weight: bold;
   background: none;
   border: 1px solid $btn-color_primary;
   color:  $btn-color_primary;
   span {
     color: $btn-color_primary;
   }

   &:disabled {
     border: 1px solid $text-disabled-color;
     color: $text-disabled-color;
   }

   &:focus {
     border: 1px solid $btn-color-primary_focus;
     background: $btn-back-color_hover;
   }

   &:not(:disabled):hover {
     background: none;
     background: $btn-back-color_hover;
     border: 1px solid $btn-color-primary_hover;
     color: $btn-color_primary;
     span {
       color: $btn-color_primary;
     }
   }

   &:not(:disabled):active {
     color: $btn-color-primary_hover;
     span {
       color: $btn-color-primary_hover !important;
     }
   }

   &.checked {
     border-color: $accent;
     color: $accent;
     span {
       color: $accent;
     }

     &:not(:disabled):hover, &:not(:disabled):active,  {
       border-color: $accent-darker;
       color: $accent-darker;
       span {
         color: $accent-darker !important;
       }
     }
   }
 }

 &.danger.outline {
   font-weight: bold;
   background: none;
   border: 1px solid $btn-color_danger;
   color:  $btn-color_danger;
   span {
     color: $btn-color_danger;
   }

   &:disabled {
     border: 1px solid $text-disabled-color;
     color: $text-disabled-color;
   }

   &:focus {
     border: 1px solid $btn-color-danger_focus;
     background: $btn-back-color_hover;
   }

   &:not(:disabled):hover {
     background: none;
     background: $btn-back-color_hover;
     border: 1px solid $btn-color-danger_hover;
     color: $btn-color_danger;
     span {
       color: $btn-color_danger;
     }
   }

   &:not(:disabled):active {
     color: $btn-color-danger_hover;
     span {
       color: $btn-color-danger_hover !important;
     }
   }
 }

}

// LINK
.true-link:focus {
   outline: none;
}

// -- DIALOGS ------------------------------------------------------------------
.true-header {
 border-bottom: 1px solid $control-border-color;
}

.true-footer {
  border-top: 1px solid #dedede;
  background-color: #f8f9fa;
}

.true-dialog-alert {
  // Цвет должен быть таким же, как цвет заголовка
  background-color: #fff;
  border-bottom: 1px solid #aaa;
  box-shadow: 0px 6px 6px rgba(0,0,0,.15);
}
