@import "materialize-custom";

.primary-color {
  background-color: $primary-color !important;
}

.primary-color-text,
.primary-color-text a {
  color: $primary-color !important;
}

.secondary-color {
  background-color: $secondary-color !important;
}

.secondary-color-text,
.secondary-color-text a {
  color: $secondary-color !important;
}

rect#background {
  fill: $primary-color !important;
}

.waves-effect.waves-primary .waves-ripple {
  background-color: lighten($primary-color, 5%);
}

.waves-effect.waves-secondary .waves-ripple {
  background-color: lighten($secondary-color, 5%);
}

.success {
  @extend .light-green, .lighten-3;
}

.success-text {
  @extend .green-text;
}

.warning {
  @extend .orange, .lighten-2;
}

.warning-text {
  @extend .orange-text;
}

.error {
  @extend .red, .lighten-3;
}

.error-text {
  @extend .red-text;
}

// used in sidenav

/**********/
/* COMMON */
/**********/

body {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

header,
main,
footer {
  margin-left: 300px;
}

.without-menu header,
.without-menu main,
.without-menu footer {
  margin-left: 0;
}

@media only screen and (max-width: 992px) {
  header,
  main,
  footer {
    margin-left: 0;
  }
}

.materialize-circle {
  @extend .circle;
}
.collection
  .collection-item.avatar
  > .materialize-circle
  > .materialize-circle {
  left: 0;
}

/**********/
/* HEADER */
/**********/

.brand-logo {
  margin-left: 10px;
}

#sidenav-logo {
  height: 70px;
  width: auto;
}

/********/
/* MAIN */
/********/

$main-padding-lr: 20px;
$main-padding-tb: 10px;

main {
  padding: $main-padding-tb $main-padding-lr;
  flex: 1 0 auto;
}

/***********/
/* SIDENAV */
/***********/

ul.sidenav.sidenav-fixed .brand-logo {
  margin: 0;
  height: 100%;
}

.logo img {
  width: 268px;
  margin-block: 1em;
  vertical-align: middle;
}

.sidenav a:not(.collapsible-header) {
  padding: 0 16px;
}

ul.sidenav li.logo > a:hover {
  background: none !important;
}

.sidenav .collapsible-body > ul:not(.collapsible) > li.active a > i,
.sidenav.sidenav-fixed
  .collapsible-body
  > ul:not(.collapsible)
  > li.active
  a
  > i {
  color: #fff;
}

.sidenav .collapsible-body > ul:not(.collapsible) > li.active,
.sidenav.sidenav-fixed .collapsible-body > ul:not(.collapsible) > li.active {
  background-color: lighten($primary-color, 5%);
}

.sidenav-badge {
  min-width: 2rem !important;
}

.sidenav li.search {
  position: relative;
  z-index: 2;
}

.sidenav li.search:hover {
  background-color: #fff;
}

.sidenav li.search .search-wrapper {
  color: #777;
  margin-top: -1px;
  border-top: 1px solid rgba(0, 0, 0, 0.14);
  border-bottom: 1px solid rgba(0, 0, 0, 0.14);

  -webkit-transition: margin 0.25s ease;
  transition: margin 0.25s ease;
}

.sidenav li.search .search-wrapper input#search {
  color: #777;
  display: block;
  font-size: 16px;
  font-weight: 300;
  width: 100%;
  height: 62px;
  margin: 0;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  padding: 0 45px 0 30px;
  border: 0;
}

.sidenav li.search .search-wrapper input#search:focus {
  outline: none;
  -webkit-box-shadow: none;
  box-shadow: none;
}

.sidenav li.search .search-wrapper > button.search-button {
  position: absolute;
  top: calc(50% - 18px);
  right: 10px;
}

button.btn-flat.search-button:hover {
  background-color: $button-disabled-background;
}

a.collection-item.search-item {
  padding: 20px 10px;
}

div#search-loader {
  margin: 0.5rem 0 0 0;
  display: none;
}

div#search-results {
  position: absolute;
  margin-top: -10px;
  width: 100%;
}

.search-result-icon {
  position: absolute;
  right: 10px;
}

// Footer

.footer-icon {
  font-size: 22px !important;
  vertical-align: middle;
}

@media only screen and (min-width: 1384px) {
  .footer-row-large {
    display: flex;
    align-items: center;
  }

  .footer-row-small {
    display: none;
  }
}

@media only screen and (max-width: 1383px) {
  .footer-row-large {
    display: none;
  }

  .footer-row-small {
    display: block;
  }
}

ul.footer-ul {
  display: inline-block;
  text-align: right;
  float: right;
}

.make-it-higher {
  vertical-align: middle;
  line-height: 36px;
}

// Language form in footer

.language-field .select-dropdown {
  @extend .white-text;
}

.language-field svg path:first-child {
  fill: white;
}

//////////////
// HEADINGS //
//////////////

h1 {
  font-weight: 300;
  font-style: normal;
  font-size: 3.6rem;
  line-height: 110%;
  margin: 1.4rem 0 1.68rem 0;
}

h2 {
  font-weight: 300;
  font-size: 3rem;
}

p,
h1,
h2,
h3,
h4,
h5,
h6,
.card-title {
  overflow-wrap: break-word;
  hyphens: auto;
}

/* Collections */

ul.collection .collection-item .title {
  font-weight: bold;
}

// Forms

form .row {
  margin-top: 0;
  margin-bottom: 0;
}

.help-block {
  font-size: 75%;
}

label.chips-checkbox {
  &.active {
    outline: none;
    background-color: $chip-selected-color;
    color: #fff;
  }

  display: inline-block;
  height: 32px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.6);
  line-height: 32px;
  padding: 0 12px;
  border-radius: 16px;
  background-color: $chip-bg-color;
  margin-bottom: $chip-margin;
  margin-right: $chip-margin;

  > img {
    float: left;
    margin: 0 8px 0 -12px;
    height: 32px;
    width: 32px;
    border-radius: 50%;
  }
}

input[type="checkbox"].chips-checkbox + span {
  padding-left: 0;

  &:before {
    display: none;
    width: 0;
  }
}

// Move label of ckeditor up
.margin-top-35 {
  margin-top: 35px;
}

// Badges

span.badge.new::after {
  content: "";
}

span.badge.new {
  font-size: 1rem;
  line-height: 26px;
  height: 26px;
}

span.badge.new.no-float {
  float: none;
  padding: 3px 6px;
}

span.badge .material-icons {
  font-size: 0.9rem;
}

.chip .material-icons {
  line-height: 30px;
  margin-right: 10px;
  margin-left: -2px;
}

.chip {
  padding: 8px 12px;
  height: auto;
  line-height: 16px;
}

/*+++++++++*/
/* Buttons */
/*+++++++++*/

.btn-flat-large {
  line-height: 60px;
  height: 60px;
}

.btn-flat-large i {
  font-size: 4rem;
}

.btn-flat-medium {
  line-height: 40px;
  height: 40px;
}

.btn-flat-medium i {
  font-size: 2rem;
}

.btn.primary,
.btn-large.primary,
.btn-small.primary {
  background-color: rgba(0, 0, 0, 0.05) !important;
  color: black !important;
}

.btn.primary:hover,
.btn-large.primary:hover,
.btn-small.primary {
  background-color: $primary-color !important;
  color: whitesmoke !important;
}

/* Table*/

.table-container {
  overflow-x: auto;
}

table.striped > tbody > tr:nth-child(odd),
table tr.striped,
table tbody.striped tr {
  background-color: rgba(208, 208, 208, 0.5);
}

th.orderable > a {
  color: rgba(0, 0, 0, 0.6);
  display: block;
  width: inherit;
  height: inherit;
}

th.orderable {
  background: no-repeat right center;
  background-image: url("../../__icons__/mdi/unfold-more-horizontal.svg");
  background-size: 24px;
}

th.orderable.asc {
  background-image: url("../../__icons__/mdi/chevron-up.svg");
}

th.orderable.desc {
  background-image: url("../../__icons__/mdi/chevron-down.svg");
}

/*+++++++*/
/* Print */
/*+++++++*/
#print-header {
  display: none;
}

.print-icon {
  margin-top: 1.52rem;
}

@media print {
  body {
    font-size: 15px;
  }

  header,
  main,
  footer {
    margin-left: 0;
  }

  ul.sidenav {
    display: none !important;
    transform: translateX(-105%) !important;
  }

  nav {
    display: none;
  }

  .sidenav-trigger {
    display: none;
  }

  #print-header {
    display: block;
    border-bottom: 1px solid;
    margin-bottom: 0;
  }

  #print-header .col.right-align {
    padding: 15px;
  }

  main,
  header {
    padding: 0;
  }

  footer,
  footer .footer-copyright,
  footer .container {
    background-color: white !important;
    color: black !important;
  }

  footer a {
    display: none;
  }

  .footer-copyright,
  .footer-copyright .container {
    padding: 0 !important;
    margin: 0 !important;
  }

  .no-print {
    display: none;
  }
}

// Alerts

.alert ul,
.alert p {
  margin: 0;
}

.alert strong {
  font-weight: 700;
}

figure.alert > :not(.material-icons.left) {
  margin-left: 39px;
}

.alert figcaption {
  font-weight: 700;
  font-size: 17px;
  margin: auto;
}

div.alert > p,
div.alert > div,
figure.alert {
  margin: 10px;
  padding: 10px;
  border-left: 5px solid;
}

div.alert.success > p,
div.alert.success > div,
figure.alert.success {
  @extend .success;
  border-color: color("green", "base");
}

div.alert.error > p,
div.alert.error > div,
figure.alert.error {
  @extend .error;
  border-color: color("red", "darken-4");
}

div.alert.primary > p,
div.alert.primary > div,
figure.alert.primary,
div.alert.info > p,
div.alert.info > div,
figure.alert.info {
  background-color: #ececec;
  border-color: $primary-color;
}

div.alert.warning p,
div.alert.warning div,
figure.alert.warning {
  @extend .warning;
  border-color: color("orange", "darken-4");
}

main div.alert p:first-child,
main div.alert div:first-child,
main figure.alert {
  margin-left: -10px;
  margin-right: -10px;
}

// Text collapsible

.text-collapsible > .material-icons {
  font-size: 20px;
  line-height: 15px;
  margin-bottom: 2px;
  margin-left: -1px;
  vertical-align: middle;
  cursor: pointer;
  color: #6d6d6d;
}

.text-collapsible.opened .a,
.text-collapsible.opened > .material-icons.open-icon {
  display: none;
}

.text-collapsible.closed .b,
.text-collapsible.closed > .material-icons.close-icon {
  display: none;
}

// Helpers

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

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

.no-pad-left {
  padding-left: 0 !important;
}

.no-pad-right {
  padding-right: 0 !important;
}

.valign-middle {
  vertical-align: middle;
}

.valign-top {
  vertical-align: top;
}

.valign-bot {
  vertical-align: bottom;
}

.height-inherit {
  height: 100%;
}

.btn-margin {
  margin-bottom: 5px;
}

/* Dashboard */

.card-action-badge {
  float: left !important;
  margin-left: 0 !important;
  margin-top: -3px;
  margin-right: 10px;
}

.event-card {
  padding: 10px;
}

.event-card .title {
  font-size: 18px;
  font-weight: 500;
}

.stacked-card-icon {
  position: relative;
  top: 50%;
  transform: translateY(-50%);
}

.flex-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

.hundred-percent {
  width: 100%;
}

.badge-image {
  position: absolute;
  left: 0;
  top: 10px;
  z-index: 1;
  background-color: $primary-color;
  color: white;
  padding: 2px 10px;
  border-radius: 0 3px 3px 0;
  text-transform: uppercase;
  font-weight: 300;
}

.center-via-flex {
  display: flex;
  align-items: center;
  justify-content: center;
}

.center2-via-flex {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.spinner-primary {
  border-color: $primary-color;
}

.dashboard-cards {
  -webkit-column-break-inside: avoid;
  column-count: 3;
}

@media (min-width: 800px) and (max-width: 1460px) {
  .dashboard-cards {
    column-count: 2;
  }
}

@media (max-width: 800px) {
  .dashboard-cards {
    column-count: 1;
  }
}

.dashboard-cards .card {
  display: inline-block;
  overflow: visible;
  width: 100%;
}

.draggable {
  cursor: grab;
}

.jscolor {
  background-color: inherit !important;
  color: inherit !important;
}

.break-word {
  overflow-wrap: anywhere;
}

.card .card-action-light {
  background-color: inherit;
  border-top: 1px solid rgba(160, 160, 160, 0.2);
  position: relative;
  padding: 16px 24px;
}

.margin-top {
  margin-top: 0.7rem !important;
}

.margin-bottom {
  margin-bottom: 0.7rem !important;
}

/* Tabs with icons */
.tabs-icons,
.tabs-icons .tab,
.tabs-icons a {
  height: 72px;
}

.tabs-icons .tab {
  display: inline-flex;
  flex-direction: column;
}

.tabs-icons .tab a {
  padding-top: 12px;
  line-height: 14px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.tabs-icons .tab i {
  font-size: 24px;
  line-height: 1;
  height: 24px;
  margin-bottom: 8px;
  width: 100%;
}

/* Person overview */
$person-logo-size: 15em;

.clip-circle:not(.active) {
  width: $person-logo-size;
  height: $person-logo-size;
  background: #f9f9f9;
  border-radius: 50%;

  & img {
    border-radius: 50%;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

.clip-circle.no-image,
.clip-circle.no-image > i.material-icons {
  font-size: calc(#{$person-logo-size} * 0.5);
  color: #6f6f6f;
  background: #f2f2f2;
  line-height: $person-logo-size;
  width: $person-logo-size;
  text-align: center;
  user-select: none;
  cursor: default;
  border-radius: 50%;
  height: unset;
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  > a {
    position: static !important;
    transform: none !important;
  }
  & .nav-spacer {
    width: 60px;
  }
  & ul.account-nav {
    display: flex;
    margin-inline: 7.5px;
    & > li > a {
      padding: 0 7.5px;
    }
  }
}

.nav-wrapper .navbar-dropdown-trigger {
  cursor: pointer;
  height: 100%;
  display: grid;
}

.navbar-dropdown-trigger .clip-circle {
  margin: auto;
  width: $navbar-height * 0.75;
  height: $navbar-height * 0.75;
  cursor: pointer;

  &.no-image,
  &.no-image > i.material-icons {
    font-size: calc(#{$navbar-height} * 0.75 * 0.5);
    color: #6f6f6f;
    background: #f2f2f2;
    line-height: $navbar-height * 0.75;
    width: $navbar-height * 0.75;
    cursor: pointer;
  }
}

a.new-notification {
  position: relative;
  &:after {
    content: "";
    position: absolute;
    width: 10px;
    height: 10px;
    bottom: 30%;
    right: 19%;
    background-color: $secondary-color;
    border-radius: 50%;
  }
}

#hero-bg {
  position: absolute;
  width: calc(100% + #{$main-padding-lr});
  height: 18em;
  left: -$main-padding-lr;
  top: 0;
  overflow: hidden;
  background-color: lighten($primary-color, 30%);
  z-index: -1;
  box-shadow:
    0 4px 5px 0 rgba(0, 0, 0, 0.14) inset,
    0 1px 10px 0 rgba(0, 0, 0, 0.12) inset,
    0 2px 4px -1px rgba(0, 0, 0, 0.3) inset;
}

.person-buttons {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: max-content;
  position: absolute;
  right: $main-padding-lr;
  margin: 0;
  align-items: end;

  & a {
    -webkit-transition: width 0.5s 0s ease;
    -moz-transition: width 0.5s 0s ease;
    -o-transition: width 0.5s 0s ease;
    transition: width 0.5s 0s ease;

    &:hover {
      width: max-content;
    }
  }
}

@media (pointer: fine) {
  .person-buttons a {
    width: 50px;
  }
}

.person-container {
  margin: calc(18em - #{$main-padding-tb} - 7.5em) 0 0 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-around;
  flex-direction: column;
}

.person-collection .collection-item.avatar {
  display: flex;
  align-items: center;

  & img.circle {
    object-fit: cover;
  }
}

.materialboxed {
  &:not(.active) {
    opacity: 100% !important;

    & > img:hover {
      opacity: 80%;
    }
  }

  &.active {
    box-shadow: none;

    & > img {
      width: 100%;
      height: 100%;
      object-fit: contain;
    }
  }
}

.application-circle {
  border-radius: 50%;
  width: 20vh;
  height: 20vh;
}

.application-circle img {
  @extend .application-circle;
  object-fit: cover;
}

svg.iconify {
  @extend i;
}

.btn .iconify.material-icons,
.btn-flat .iconify.material-icons {
  height: $button-height;
}

// Login Page
.login-card-action {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  row-gap: 0.7rem;
  & *:last-child {
    grid-column: -2;
    text-align: center;
  }
}

.btn-small-line-height {
  line-height: $button-small-height;
}

.btn-smaller-padding {
  padding: 0 8px;
}

p.ical-description {
  margin: 0;
  font-weight: 300;
}

.table-circle,
.table-circle .materialize-circle {
  height: 4em;
  width: 4em;
}
