@import "./custom-theme.scss";

:not(input):not(textarea),
:not(input):not(textarea)::after,
:not(input):not(textarea)::before {
  -webkit-user-select: none !important;
  user-select: none !important;
}

input,
button,
textarea,
:focus {
  outline: none; // You should add some other style for :focus to help UX/a11y
}

a:not([draggable="true"]),
img:not([draggable="true"]) {
  -webkit-user-drag: none;
  user-drag: none;
  /* Technically not supported in Electron yet */
}

a[href^="http://"],
a[href^="https://"],
a[href^="ftp://"]
{
  -webkit-user-drag: auto;
  user-drag: auto;
  /* Technically not supported in Electron yet */
}

.selectable {
  user-select: text !important;
  -webkit-user-select: text !important;
}

html {
  overflow: hidden;
  -webkit-app-region: no-drag;
}

body {
  overflow: hidden;
  margin: 0;
  -webkit-app-region: no-drag;
}

a,
img {
  -webkit-app-region: no-drag;
}

.rounded {
  border-radius: 4px;
}

.p-0 {
  padding: 0 !important;
}

.p-1 {
  padding: 0.25em !important;
}

.pl-1 {
  padding-left: 0.25em;
}

.pr-1 {
  padding-right: 0.25em;
}

.px-1 {
  padding: 0 0.25em;
}

.m-0 {
  margin: 0 !important;
}

.mr-1 {
  margin-right: 0.25em !important;
}

.mr-2 {
  margin-right: 0.5em !important;
}

.mr-3 {
  margin-right: 1em !important;
}

.ml-1 {
  margin-left: 0.25em !important;
}

.ml-2 {
  margin-left: 0.5em !important;
}

.ml-3 {
  margin-left: 1em !important;
}

.mt-1 {
  margin-top: 0.25em !important;
}

.mt-2 {
  margin-top: 0.5em !important;
}

.mt-3 {
  margin-top: 1em !important;
}

.mb-1 {
  margin-bottom: 0.25em !important;
}

.text-center {
  text-align: center;
}

.no-reg-drag {
  -webkit-app-region: no-drag;
}

.no-link {
  pointer-events: none;
  text-decoration: none;
  color: inherit !important;
}

.pointer {
  pointer-events: all !important;

  &:hover {
    cursor: pointer !important;
  }
}

.text-light {
  color: $white-1;
}

.text-light-hover {
  &:hover {
    color: $white-1 !important;
  }
}

.mat-tab-label,
.mat-tab-label-content,
.mat-select-value,
.mat-form-field-infix {
  &:hover {
    cursor: pointer !important;
  }
}

.mat-button,
.mat-stroked-button,
.mat-raised-button,
.mat-flat-button {
  &:hover {
    cursor: default !important;
  }

  &:not(.mat-button-disabled) {
    &:hover {
      cursor: pointer !important;
    }
  }

  // Prevent clicking thru the button via the text
  .mat-button-wrapper {
    pointer-events: none;
  }
}

.mat-slide-toggle-thumb,
.mat-slide-toggle-bar {
  &:hover {
    cursor: pointer !important;
  }
}

.mat-slide-toggle-thumb,
.mat-slide-toggle-bar,
.mat-button-wrapper {
  -webkit-app-region: no-drag;
}

.text-light {
  color: $white-1;
}

.text-light-2 {
  color: $white-2;
}

.pre-load-container {
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  color: white;
  justify-content: center;
  align-items: center;

  .logo {
    width: 200px;
  }
}

.window-appicon {
  background-size: 30px !important;
  padding-left: 12px !important;
}

.tab-container {
  overflow: auto;
  overflow-x: hidden;

  &.mac {
    height: calc(100vh - 106px);
  }

  &.windows {
    height: calc(100vh - 114px);
  }

  &.linux {
    height: calc(100vh - 114px);
  }
}

.no-pad-select {
  .mat-form-field-wrapper {
    padding-bottom: 0 !important;
  }
}

.mat-option.mat-selected:not(.mat-option-disabled) {
  color: $white-3 !important;
}

.d-flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.flex-grow-1 {
  flex-grow: 1;
}

.flex-shrink-0 {
  flex-shrink: 0;
}

.col {
  display: flex;
  flex-direction: column;

  &.align-items-center {
    align-items: center;
  }

  &.align-items-start {
    align-items: flex-start;
  }

  &.justify-content-center {
    justify-content: center;
  }

  &.justify-content-end {
    justify-content: flex-end;
  }
}

.row {
  display: flex;
  flex-direction: row;

  &.align-items-center {
    align-items: center;
  }

  &.align-items-start {
    align-items: flex-start;
  }

  &.justify-content-center {
    justify-content: center;
  }

  &.justify-content-end {
    justify-content: flex-end;
  }
  &.justify-content-between {
    justify-content: space-between;
  }
}

.text-right {
  text-align: right;
}
.text-left {
  text-align: left;
}

.addon-summary {
  img {
    max-width: 100%;
  }
}

.addon-summary,
.addon-changelog {
  strong,
  b {
    font-size: 16px;
    font-weight: 400;
    font-style: normal;
  }
}

.addon-table {
  width: 100%;
  height: 100%;

  .cell-break-all {
    word-break: break-all;
  }

  .cell-wrap-text {
    white-space: normal;
  }

  // .addon-title {
  //   font-weight: bold;
  //   font-size: 1.1em;

  // }
}

.addon-context-menu {
  .addon-context-menu-header {
    padding: 0 16px 8px 16px;
    color: $white-1;
    display: flex;
    flex-direction: row;
    align-items: center;

    .thumbnail {
      background-color: $dark-2;
      width: 30px;
      height: 30px;
      margin-right: 16px;
      background-size: contain;
      background-repeat: no-repeat;
      background-position: center;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;

      .thumbnail-letter {
        color: $white-4;
        font-size: 1.5em;
        font-weight: 400;
      }
    }

    .addon-name {
      font-size: 1em;
      // font-weight: bold;
    }

    .addon-version {
      color: $white-2;
    }

    .addon-update-available {
      display: inline-block;
    }
  }
}

.wide-slide-toggle {
  width: 100%;

  &:hover {
    cursor: pointer !important;
  }

  .mat-slide-toggle-label {
    &:hover {
      cursor: pointer !important;
    }
  }

  .mat-slide-toggle-content {
    flex-grow: 1;
  }
}

.light-select {
  .mat-form-field-label {
    color: $white-2 !important;
  }
}

.vertical-radio-group {
  display: flex;
  flex-direction: column;
}

.cell-break-all {
  word-break: break-all;
}

.cell-wrap-text {
  white-space: normal;
  -webkit-line-clamp: 2;
  text-overflow: ellipsis;
}

.cell-center-text {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
}

.install-button {
  min-width: 120px !important;
}

.progress-button {
  position: relative;
  overflow: hidden;
  min-width: 120px !important;

  .progress-bar {
    border-top-right-radius: 4px;
    border-top-left-radius: 4px;
    width: 100%;
    left: 0;
    position: absolute;
  }

  .mat-progress-bar-buffer {
    background: $white-4 !important;
  }

  .mat-progress-bar-fill::after {
    background: $blue-1 !important;
  }
}

.error-text {
  color: red;
}

.no-tabs {
  &.mat-tab-group {
    .mat-tab-header {
      display: none;
    }
  }
}

.snackbar-error {
  border: 2px solid red;
}

.snackbar-success {
  border: 2px solid green;
}

// MATERIAL OVERRIDES

.mat-tooltip {
  font-size: 0.95em;
}

.mat-tab-labels {
  z-index: 2;
}

th.mat-header-cell .mat-sort-header-container.mat-sort-header-sorted .mat-sort-header-arrow {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

.mat-menu-content {
  .mat-checkbox {
    display: block;
  }
}

// SCROLLBAR
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  border-radius: 4px;
  border-width: 1px;
  border-style: solid;
}

@keyframes pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.7);
  }

  70% {
    transform: scale(1);
    box-shadow: 0 0 0 10px rgba(0, 0, 0, 0);
  }

  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
  }
}
