// Remove prefix added in BS5 for compat with Joomla beta's shipped with Betas
$prefix: "";

$jicon-css-prefix: icon;
$fa-css-prefix: fa;
$fa-font-path: "../../../media/vendor/fontawesome-free/webfonts";

// Font Awesome
@import "../../../media/templates/administrator/atum/scss/vendor/fontawesome-free/fontawesome";

// "Font Awesome 5 Free"
@import "../../../media/vendor/fontawesome-free/scss/fontawesome";
@import "../../../media/vendor/fontawesome-free/scss/regular";
@import "../../../media/vendor/fontawesome-free/scss/solid";
@import "../../../media/vendor/fontawesome-free/scss/brands"; // order of loading is important.

// B/C for Icomoon
@import "../../../build/media_source/system/scss/icomoon";

// Bootstrap
@import "../../../media/vendor/bootstrap/scss/functions";

// Variables from the Atum template
@import "../../../build/media_source/templates/administrator/atum/scss/variables";

@import "../../../media/vendor/bootstrap/scss/variables";
@import "../../../media/vendor/bootstrap/scss/maps";
@import "../../../media/vendor/bootstrap/scss/mixins";
@import "../../../media/vendor/bootstrap/scss/utilities";
@import "../../../media/vendor/bootstrap/scss/bootstrap";

// Backend Template stuff
@import "../../../media/templates/administrator/atum/scss/blocks/global";
@import "../../../media/templates/administrator/atum/scss/blocks/header";
@import "../../../media/templates/administrator/atum/scss/vendor/bootstrap/custom-forms";
@import "../../../media/templates/administrator/atum/scss/vendor/joomla-custom-elements/joomla-alert";

// Safari fix
@import "../../../media/templates/administrator/atum/scss/vendor/bootstrap/reboot";

// Custom Atum colors
:root {

  @each $color, $value in $atum-colors {
    --#{$prefix}#{$color}: #{$value};
  }

  --primary: hsl(213, 63%, 44%);
}

.border-primary {
  border-color: var(--primary) !important;
}

.border-secondary {
  border-color: var(--secondary) !important;
}

.border-success {
  border-color: var(--success) !important;
}

.border-info {
  border-color: var(--info) !important;
}

.border-warning {
  border-color: var(--warning) !important;
}

.border-danger {
  border-color: var(--danger) !important;
}

.border-light {
  border-color: var(--light) !important;
}

.border-dark {
  border-color: var(--dark) !important;
}

.border-white {
  border-color: var(--white) !important;
}

.text-primary {
  color: var(--primary) !important;
}

.text-secondary {
  color: var(--secondary) !important;
}

.text-success {
  color: var(--success) !important;
}

.text-info {
  color: var(--info) !important;
}

.text-warning {
  color: var(--warning) !important;
}

.text-danger {
  color: var(--danger) !important;
}

.text-light {
  color: var(--light) !important;
}

.text-dark {
  color: var(--dark) !important;
}

.text-black {
  color: var(--black) !important;
}

.text-white {
  color: var(--white) !important;
}

.text-body {
  color: var(--body-color) !important;
}

.bg-primary {
  background-color: var(--primary) !important;
}

.bg-secondary {
  background-color: var(--secondary) !important;
}

.bg-success {
  background-color: var(--success) !important;
}

.bg-info {
  background-color: var(--info) !important;
}

.bg-warning {
  background-color: var(--warning) !important;
}

.bg-danger {
  background-color: var(--danger) !important;
}

.bg-light {
  background-color: var(--light) !important;
}

.bg-dark {
  background-color: var(--dark) !important;
}

.bg-black {
  background-color: var(--black) !important;
}

.bg-white {
  background-color: var(--white) !important;
}

.bg-body {
  background-color: var(--body-bg) !important;
}

body {
  background: var(--template-bg-light);
}

.form-select {
  @extend .form-select;
}

*,
*::after,
*::before {
  box-sizing: border-box;
}

.j-install {
  display: flex;
  flex-direction: column;
  min-height: 100vh;

  .logo {
    max-width: 270px;
  }

  img.logo-small,
  svg.logo-small {
    width: 2rem;
    height: 2rem;
  }

  .icon-question {
    color: $white;

    &:hover {
      color: var(--template-link-color);
    }
  }
}

.j-container {
  width: 100%;
  max-width: 40rem;
  margin: 0 auto;

  h1 {
    color: $dark-blue;
    text-align: center;
  }
}

.j-install-step {
  display: none;
  margin-bottom: 20px;
  background-color: #fff;
  box-shadow: 0 0 2px rgba(52, 58, 67, .1), 0 2px 5px rgba(52, 58, 67, .08), 0 5px 15px rgba(52, 58, 67, .08);

  &.active {
    display: block;
  }

  select {
    width: 100%;
    margin-left: 0 !important;
  }
}

.j-install-step-header {
  position: relative;
  padding: 10px 25px;
  font-size: 1.1rem;
  line-height: 2.4rem;
  color: $dark-blue;
  background-color: #fff;
  border-bottom: 1px solid #efefef;

  span {
    position: relative;
    margin-right: 5px;
    font-size: 1.2rem;
  }
}

.j-install-step-form {
  padding: .65rem 1.2rem;

  // Remove default bootstrap margins in the installer forms.
  .control-group {
    margin-bottom: 0;

    .control-label {
      padding: 0;
    }
  }
}

.languageForm {
  padding: 0 0 30px;

  .form-select {
    width: 100%;
  }
}

// Alerts
#system-message-container joomla-alert {
  margin-top: 25px;
}

.alert-heading {
  font-size: $h4-font-size;
}

.hidden,
[hidden="hidden"] {
  display: none;
}

.btn-success {
  color: #fff;
  background-color: #75b544;
  border-color: #75b544;
}


// Form

.form-control {
  background-color: var(--white-offset);

  &.input-full {
    max-width: 100%;
  }

}

label {
  margin-bottom: .5rem;
}

.control-group {
  margin-bottom: 18px;

  &::after {
    display: table;
    clear: both;
    content: "";
  }

  .control-label {
    padding-top: 5px;
    padding-right: 5px;
    text-align: left;
  }
}

.spacer hr {
  width: 380px;
}

.card .form-select {
  width: 100%;
}

td .form-control {
  display: inline-block;
  width: auto;
}

legend {
  margin-bottom: 1.1rem;
}

.checkboxes {
  padding-top: 5px;

  .checkbox input {
    position: static;
    margin-left: 0;
  }

}

.form-check {
  padding-top: 5px;
  margin-bottom: 0;
}

// Possibly temporary until Bootstrap support it themselves
.form-select[multiple] {
  height: auto;
  background: none;
}

// Block display for the validation message
.form-control-feedback {
  display: block;
  color: $red;
}

// Language Table
caption {
  caption-side: top;
}

.bg-warning {
  color: #292b2c;
}

// footer
.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  z-index: $zindex-header;
  background-color: $white;
  box-shadow: 0 0 1px 1px rgba(0, 0, 0, .25);
}

.table > :not(:last-child) > :last-child > * {
  border-bottom-color: $table-border-color;
}
