/* You can add global styles to this file, and also import other style files */
@use 'style/fonts.scss';
@import "~@angular/material/theming";
@import "variables.scss";

html, body { height: 100%; }
body {
  margin: 0; font-family: Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.spacer {
  flex-grow: 1;
}

.debug-r { border: solid 1px red; }
.debug-g { border: solid 1px green; }
.debug-b { border: solid 1px blue; }
.debug-y { border: solid 1px yellow; }
.debug-p { border: solid 1px purple; }

/** Flex layouts **/
.row { display: flex; flex-direction: row; }
.col { display: flex; flex-direction: column; }
.space-between  { justify-content: space-between; }
.space-evenly   { justify-content: space-evenly; }
.space-around   { justify-content: space-around; }
 
.wrap     { flex-wrap: wrap; }
.no-wrap  { flex-wrap: nowrap; }

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

.grow { flex-grow: 1; }
.grow-1 { flex-grow: 0.1; }
.grow-3 { flex-grow: 0.3; }
.grow-4 { flex-grow: 0.4; }
.grow-5 { flex-grow: 0.5; }
.grow-6 { flex-grow: 0.6; }
.grow-7 { flex-grow: 0.7; }

.cursor-pointer { cursor: pointer; }

.text-center { text-align: center; }
.word-break-all { word-break: break-all; }

.rounded-container {
  margin: 10px;
  padding: 15px;
  border-radius: 7px;

  overflow-x: auto;
}

.elevation-1 { box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px; }
.elevation-2 { box-shadow: rgb(99, 99, 99, 0.2) 0px 2px 8px 0px; }

/** Styles applicable for all material dialogs */
.generic-dialog .mat-dialog-container {
  padding: 0;
  overflow: unset;

  border-radius: 15px;
}

.mat-dialog-inner-container {
  padding: 24px;

  // Must be less than or equal to border-radius in .mat-dialog-container
  border-radius: 10px;
  background: white;
}

.indented_field {
  margin-top: 10px;
  margin-left: 30px;

  padding-left: 10px;

  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  width: max-content;

  border-left: solid 1px rgba(0, 0, 0, 0.12);
}

.dark-theme .indented_field {
  border-left: solid 1px rgba(255, 255, 255, 0.12);
}

.indented_field.disabled {
  pointer-events: none;
  color: #CECECE;
}

.field {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  justify-content: space-between;

  margin-top: 5px;

  .x-small {
    max-width: 17px;
  }

  .small {
    max-width: 35px;
  }

  .medium {
    max-width: 60px;
  }

  .large {
    max-width: 120px;
  }

  .regular_field {
    margin-left: 10px;
  }

  .wide_field {
    min-width: 300px;
  }
}

input.numeric_field {
  margin-left: 10px;

  /** Hide the annoying increase/decrease buttons on numeric input */
  /* Chrome, Safari, Edge, Opera */
  input::-webkit-outer-spin-button,
  input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
  }

  /* Firefox */
  input[type=number] {
    -moz-appearance: textfield;
  }
}

/** Styles for SnackBar **/
.snackbar-container {
  width: 100%;

  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;

  color: white;

  .message {
    display: flex;
    flex-direction: row;
    align-items: center;

    p {
      margin: 0;
      margin-left: 10px;
    }
  }
}

.snackbar-success { background: #4CAF50; }
.snackbar-warn    { background: #FF9800; }
.snackbar-error   { background: #F44336; }
.snackbar-info    { background: #2196F3; }

.torrent-status {
  color: white;

  &.primary {
    background: mat-color($my-app-primary)
  }

  &.warning {
    background: mat-color($my-app-accent)
  }

  &.danger {
    background: mat-color($my-app-warn)
  }

  &.info {
    background: $my-app-default;
    color: $table-black-color;
  }
}

// For dark mode!
.dark-theme {
  .rounded-container { background: $bg-surface-dark-0; }
  .elevation-1 { box-shadow: rgba(0, 0, 0, 0.5) 0px 1px 4px; }
  .elevation-2 { box-shadow: rgb(0, 0, 0, 0.5) 0px 2px 8px 0px; }


  .torrent-status {
    &.primary {
      background: mat-color($dark-primary);
      color: $table-black-color;
    }

    &.warning {
      background: mat-color($dark-accent);
      color: $table-black-color;
    }

    &.danger {
      background: mat-color($dark-warn);
    }

    &.info {
      background: $dark-default;
      color: white;
    }
  }
}

/*** CUSTOM SCROLLBAR ***/
::-webkit-scrollbar {
  width: 5px;   /** Target vertical scroll-bars */
  height: 5px;  /** Target horizontal scroll-bars */
}

/* Corner of the track (will sometimes show a small white square) */
::-webkit-scrollbar-corner  {
  background-color: transparent;
}

/* Handle */
::-webkit-scrollbar-thumb {
  background: rgb(131, 131, 131);
}

/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
  background: #555;
}

.show-mobile { display: none; }
.show-mobile-flex { display: none; }

/** For phone screens */
@media only screen and (max-width: 640px) {
  .hide-mobile { display: none; }

  .show-mobile { display: block; }
  .show-mobile-flex { display: flex; }
}
