/**
 * ---------------------------------------------------------------------
 * GLPI - Gestionnaire Libre de Parc Informatique
 * Copyright (C) 2015-2021 Teclib' and contributors.
 *
 * http://glpi-project.org
 *
 * based on GLPI - Gestionnaire Libre de Parc Informatique
 * Copyright (C) 2003-2014 by the INDEPNET Development Team.
 *
 * ---------------------------------------------------------------------
 *
 * LICENSE
 *
 * This file is part of GLPI.
 *
 * GLPI is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * GLPI is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with GLPI. If not, see <http://www.gnu.org/licenses/>.
 * ---------------------------------------------------------------------
 */

$info: #80abe4;
$enable-negative-margins: true;
$link-hover-decoration: none;
$logo-light: "../pics/logos/logo-GLPI-100-white.png" !default;
$logo-light-reduced: "../pics/logos/logo-G-100-white.png" !default;
$logo-dark: "../pics/logos/logo-GLPI-100-black.png" !default;
$logo-dark-reduced: "../pics/logos/logo-G-100-black.png" !default;
$logo-dark-login: "../pics/logos/logo-GLPI-250-black.png" !default;
$logo-light-login: "../pics/logos/logo-GLPI-250-white.png" !default;
$logo: $logo-light;
$logo_reduced: $logo-light-reduced;

@import "fonts";

$font-family-sans-serif: inter, -apple-system, blinkmacsystemfont, san francisco, segoe ui, roboto, helvetica neue, sans-serif !default;

@if $is-dark {
   @import "dark";
} @else {
   @import "~@tabler/core/src/scss/tabler";
}

$ti-font-path: "../css/lib/tabler/icons/iconfont/fonts";

@import "~@tabler/icons/iconfont/tabler-icons";

$mainmenu_bg: $dark !default;
$mainmenu_fg: $light !default;
$search_bg: transparentize($mainmenu_bg, 0.95) !default;
$search_fg: lighten($mainmenu_bg, 5%) !default;
$search_border: lighten($color: $search_fg, $amount: 35) !default;
$table_border: #eee !default;
$table_header_bg: #f8f8f8 !default;
$header-fg: $blue !default;
$header-bg: theme-color-lighter($header-fg, true) !default;
$header-border-color: tint-color($header-fg, 75%) !default;
$header-danger-bg: $danger !default;
$header-badge-bg: tint-color($header-fg, 80%) !default;
$header-badge-fg: darken($header-fg, 20%) !default;
$scrollbar-color-thumb: rgba($color: $secondary, $alpha: 80%) !default;
$scrollbar-color-track: transparent !default;
$tabs-bg: $card-cap-bg !default;
$tabs-fg: $text-muted !default;
$tabs-border: $card-border-color !default;
$tabs-active-bg: #fff !default;
$tabs-active-fg: $dark !default;
$tabs-active-border: $tabs-border !default;
$badge-bg: $secondary !default;
$badge-fg: $light !default;
$itil-secondary-bg: #f5f5f5 !default; // secondary color for right side and footer (primary color is card background)
$timeline-itilc-bg: #e2f2e3 !default;
$timeline-itilc-fg: #155210 !default;
$timeline-itilc-border: #87aa8a !default;
$timeline-fup-bg: #ececec !default;
$timeline-fup-fg: #535353 !default;
$timeline-fup-border: #ccc !default;
$timeline-task-bg: #ffe8b9 !default;
$timeline-task-fg: #38301f !default;
$timeline-task-border: #e5c88c !default;
$timeline-sol-bg: #9fd6ed !default;
$timeline-sol-fg: #425b64 !default;
$timeline-sol-border: #90c2d8 !default;
$timeline-log-bg: #cacaca21 !default;
$timeline-badge-bg: rgba(97, 97, 97, 15%) !default;
$timeline-badge-fg: rgba(43, 43, 43, 80%) !default;
$input-border: $dark-mode-text !default;
$dropdowns-list-contrast: rgba(167, 171, 175, 10%) !default;
$entity-badge-bg: theme-color-lighter($link-color, true) !default;
$entity-badge-fg: $link-color !default;

// helpers
$topbar-height: 79px;
$contextbar-height: 56px;
$content-margin: 20px;

body.iframed {
   background-color: transparent;
}

.page {
   .glpi-logo {
      background: url($logo) no-repeat;
      height: 55px;
      width: 100px;
   }

   .page-body {
      margin-bottom: 0;
   }

   .footer {
      font-size: 0.75rem;
      padding: 0.5em;
   }
}

.breadcrumb-alternate {
   a {
      &:hover {
         text-decoration: $link-hover-decoration;
      }
   }
}

.dropdown-item {
   & > .fas:first-child,
   & > .far:first-child,
   & > .fab:first-child,
   & > .ti:first-child {
      margin-right: 0.5em;
   }
}

.ti {
   font-size: 1.25em;
   text-align: left;

   &.fa-fw {
      width: 0.9em;
   }

   &.fa-xs {
      font-size: 0.85em;
   }

   &.fa-lg {
      font-size: 1.8em;
      line-height: 0.75em;
      vertical-align: -0.0667em;
   }

   &.fa-2x {
      font-size: 2.3em;
      vertical-align: bottom;
   }
}

.btn {
   .btn-group .select2-container ~ & {
      max-width: 25px;
   }

   a {
      color: inherit;
   }

   i.fas,
   i.far,
   i.fab,
   i.ti,
   .fa-stack {
      margin-inline-start: 0;

      & + * {
         margin-left: 0.25rem;
      }
   }

   &.btn-icon {
      i.fas,
      i.far,
      i.fab,
      i.ti {
         margin-right: 0;
         line-height: 1.5em;
      }

      &.btn-sm {
         .fa-stack {
            height: 1.65em;
            line-height: 1.2em;
            width: 1.8em;
            margin-top: -2px;
            font-size: 0.8em;

            @include media-breakpoint-down(sm) {
               width: 1.4em;
            }
         }

         i.fas,
         i.far,
         i.fab,
         i.ti {
            line-height: 1.2em;
         }
      }
   }
}

.toast-container {
   z-index: 999999;
   position: fixed;
}

.img-overlay-wrapper {
   width: fit-content;
}

.page-anonymous {
   .glpi-logo {
      --logo: url(#{$logo-dark-login});

      content: var(--logo);
      width: 200px;
      height: 110px;
   }
}

table {
   td.active,
   td.tab_bg_4 {
      background-color: $table-active-bg;
      color: $table-active-color;
   }

   &.deleted-results {
      & > :not(caption) > * > * {
         box-shadow: none; // override tabler for deleted results
      }
   }
}

.entity-badge {
   display: inline-flex;
   flex-wrap: wrap;
   justify-content: center;
   align-items: center;
   background: $entity-badge-bg;
   color: $entity-badge-fg !important;
   padding: calc(0.25rem - 1px) 0.25rem;
   border: 1px solid transparent;
   border-radius: 4px;
   font-size: 0.7rem;
}

.entity_tree {
   width: 450px;
   max-width: 85vw;
   position: relative;

   table {
      width: 100%;
   }

   .fancytree-expander,
   .fancytree-icon {
      margin-top: 5px;
   }

   .fancytree-folder {
      .fancytree-title {
         font-weight: bold;
      }
   }

   .fancytree-selected {
      background-color: $component-active-bg;
   }

   .plain-scrollbar {
      &[data-scrollable="false"] {
         visibility: hidden;
      }

      &.scrollbar-vertical {
         width: 8px;
      }

      .arrow-up,
      .arrow-down {
         display: none;
      }

      .slider-area {
         top: 0 !important;
         bottom: 0 !important;
      }
   }
}

.qtip-bootstrap {
   background-color: $color-contrast-light;
   color: $dark;
}

.list-group .list-group-item {
   color: inherit;
   border-color: $table-border-color;

   &:hover {
      background-color: $hover-bg;
   }
}
