/*
 * PivotLab by JNF - the app's stylesheet.
 *
 * The old app's assets/css/styles.css (Bootstrap 5 overrides, the shared components) followed by
 * the frame its layouts/base.php drew in an inline <style>: the top bar, the drawer, the bottom tab
 * bar and the new project sheet.
 *
 * ONE DIFFERENCE IN THE FRAME. The old layout made <main> the scrolling box (html/body at 100%,
 * main overflow-y:auto). The core layout puts the page in #main-content between the header and the
 * footer and does not let a theme wrap it, so here the window scrolls: the top bar is sticky and the
 * tab bar fixed, with room left for it under the page. Page scripts that listened to `main` scroll
 * listen to the window.
 *
 * The landing page has its own sheet (landing.css), scoped under .pl-landing.
 */

:root {
    --bs-link-color: #ff7648;
    --bs-primary: #FF7648;
    --bs-primary-darken: #ee673a;
    --bs-font-sans-serif: 'Poppins', sans-serif;
    --bs-btn-focus-shadow-rgb: rgb(255, 118, 72);
    --bs-btn-focus-box-shadow: 0 0 0 0.25rem rgba(255, 118, 72,.5);
    --bs-primary-rgb: 255, 118, 72;
    --bs-dropdown-link-active-bg: #FF7648;
}

/* a:hover {
    color: #eb5625 !important;
} */

.btn-light {
    --bs-btn-color: #000;
    --bs-btn-bg: #e6e6e6;
    --bs-btn-border-color: #e6e6e6;
    --bs-btn-hover-color: #000;
    --bs-btn-hover-bg: #c6c7c8;
    --bs-btn-hover-border-color: #c6c7c8;
    --bs-btn-focus-shadow-rgb: 211, 212, 213;
    --bs-btn-active-color: #000;
    --bs-btn-active-bg: #c6c7c8;
    --bs-btn-active-border-color: #babbbc;
    --bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
    --bs-btn-disabled-color: #000;
    --bs-btn-disabled-bg: #e6e6e6;
    --bs-btn-disabled-border-color: #e6e6e6;
}

.dropdown-item.active, .dropdown-item:active {
    background-color: var(--bs-primary);
}

.btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--bs-primary);
    --bs-btn-border-color: var(--bs-primary);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--bs-primary-darken);
    --bs-btn-hover-border-color: var(--bs-primary-darken);
    --bs-btn-focus-shadow-rgb: 49, 132, 253;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--bs-primary-darken);
    --bs-btn-active-border-color: var(--bs-primary-darken);
    --bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: var(--bs-primary);
    --bs-btn-disabled-border-color: var(--bs-primary);
}

.btn:focus-visible {
    box-shadow: 0 0 0 0.25rem rgba(255, 118, 72,.5);
}

.nav-pills {
    --bs-nav-pills-border-radius: var(--bs-border-radius);
    --bs-nav-pills-link-active-color: #fff;
    --bs-nav-pills-link-active-bg: var(--bs-primary);
}

.offcanvas {
    --bs-offcanvas-width: 350px;
}

::placeholder {
  color: var(--bs-body-color) !important;
  opacity: .5 !important;
}

.form-control:focus {
    color: var(--bs-body-color);
    background-color: var(--bs-body-bg);
    border-color: var(--bs-primary);
    outline: 0;
    
    box-shadow: 0 0 0 .25rem rgba(255, 118, 72, .25);
}

.link-primary:active, .link-primary:focus, .link-primary:hover {
  color: #ee673a !important;
  -webkit-text-decoration-color: #ee673a !important;
  text-decoration-color: #ee673a !important;
}

.nav-link:focus, .nav-link:hover {
    color: #ee673a;
}

.accordion-button:not(.collapsed) {
  box-shadow: none !important;
}

/* -------------------------------------------------------------------------- */
/*                             ChoicesJs Overrides                            */
/* -------------------------------------------------------------------------- */
.choices__list--single {
  padding: 0 16px 0 0;
}

.choices {
  margin-bottom: 0px;
}

/* -------------------------------------------------------------------------- */
/*                                   Widgets                                  */
/* -------------------------------------------------------------------------- */

/* -------------------------------- Grid Menu ------------------------------- */

.widget-grid_menu a {
  border-radius: 20px;
  color: #fff;
  text-align: center;
  text-decoration: none;
  background-color: #ccc;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.widget-grid_menu .item .title {
  text-transform: uppercase;
}

.widget-grid_menu .title {
  font-size: 13px;
}

@media (min-width: 768px) {
  .widget-grid_menu .title {
    font-size: 16px;
  }
}

/*
 * On large screens the dashboard's grid sits in the middle of the screen, not under the top bar.
 * The page fills the window and the grid is centred in what the header leaves; the bottom padding
 * matches the header so the grid looks centred on the whole screen.
 */
@media (min-width: 992px) and (min-height: 700px) {
  #content:has(> .site-main > .widget-grid_menu) {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
  }

  #content > .site-main:has(> .widget-grid_menu) {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 24px 0 96px;
  }
}

/* ---------------------------- Accordion Simple ---------------------------- */
.widget-accordion_simple {
  .title {
    font-weight: 600;
    font-size: 19px;
  }

  .icon {
    display: none;
  }

  .accordion-toggle.collapsed {
    .icon-plus {
      display: initial;
    }
  }

  .accordion-toggle:not(.collapsed) {
    .icon-minus {
      display: initial;
    }
  }

  a.accordion-toggle {
    text-decoration: none;
    color:#424242;
  }

  .panel-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 500;
    color: #5B5B5B;
  }

  .panel {
    border-bottom: 1px solid #ccc;
    padding: 12px 0;
    font-size: 16px;

    @media (max-width: 767px) {
      font-size: 14px;
    }
  }

  .panel-body {
    color: #000;
    padding: 12px 0;
    font-size: 14px;

    @media (max-width: 767px) {
      font-size: 13px;
    }
  }


}

/* -------------------------------------------------------------------------- */
/*                               Generic Styles                               */
/* -------------------------------------------------------------------------- */
.view-title {
  text-transform: uppercase;
  font-weight: 700;
  font-size: 20px;
  text-align: center;

  @media (min-width: 768px) {
    font-size: 32px;
  }
}

.form-switch .form-check-input {
  width: 3em;
  height: 2em;
}

.form-switch.switch-sm .form-check-input {
  width: 2em !important;
  height: 1em !important;
}

.switch-2-option {
  &.checked .right {
    color: #FF7648;
  }
  &:not(.checked) .left {
    color: #FF7648;
  }

  .form-check-input,.form-check-input:focus {
      background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23FF7648'/%3e%3c/svg%3e");
  }
  .form-check-input:checked {
      background-color: #fff;
      border-color: #fff;
      background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23FF7648'/%3e%3c/svg%3e");
  }
}

.form-check-input:checked {
    background-color: #ff7648;
    border-color: #ff7648;
}

.form-check-input:focus {
    border-color: #fea886;
    outline: 0;
    box-shadow: 0 0 0 .25rem rgba(255, 118, 72, .25);
}

/* -------------------------------------------------------------------------- */
/*                                 Scrollbars                                 */
/* -------------------------------------------------------------------------- */
  
/* Firefox */
* {
  scrollbar-width: auto;
  scrollbar-color: #ababab #ffffff;
}

/* Wrap new scrollbar properties in @supports rule for browsers without `::-webkit-scrollbar-*` support */
/* This way chrome won't override `::-webkit-scrollbar-*` selectors */
* {
  scrollbar-width: thin !important;
  scrollbar-color: #00000077 #00000000 !important;
}

/* -------------------------------------------------------------------------- */
/*                                product line                                */
/* -------------------------------------------------------------------------- */
.project-product-item {
    display: flex;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 1.5rem;

    .product-img-outer {
        border: 1px solid #ddd;
        padding: 6px;
        border-radius: 4px;
        max-width: 140px;
        max-height: 140px;
        margin-right: 12px;
        aspect-ratio: 1 / 1;
        height: 100%;
        width: 100%;
    }
    .product-img-container {
        background-color: #E4E4E433;
        height: 100%;
        width: 100%;

        img {
            width: 100%;
            height: 100%;
            object-fit: contain;
            mix-blend-mode: multiply;
        }
        
    }
    .title {
        font-weight: 600;
        font-size: 17px;
        margin-bottom: 4px;
        line-height: 130%;
    }
    .subtitle {
        font-size: 13px;
        margin-bottom: 0;
    }
    .downloads {
        margin-top: 8px;
        display: flex;
        flex-wrap: wrap;
    }
    .download-file-link {
        border: 1px solid #767676;
        color: #1E1E1E !important;
        text-decoration: none;
        padding: 4px;
        font-size: 11px;
        margin-bottom: 8px;
        margin-right: 8px;

        @media (max-width: 767px) {
          font-size: 10px;
        }

        .extension {
            font-weight: 600;
        }
    }
}

/* -------------------------------------------------------------------------- */
/*                                 App frame                                  */
/* -------------------------------------------------------------------------- */
body {
    font-family: var(--bs-font-sans-serif);
}

.pl-ico {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

.pl-avatar {
    background-color: #e6e6e6;
    color: #000;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-family: sans-serif;
}

.pl-app-top {
    position: sticky;
    top: 0;
    z-index: 1020;
    background: #fff;
}

@media (min-width: 1921px) {
    .pl-app-top > div {
        padding-left: 3rem;
        padding-right: 3rem;
    }
    .pl-app-top .logo {
        height: 80px;
    }
    .pl-app-top .humburger-btn svg {
        width: 26px;
        height: 26px;
    }
    .pl-app-top .avatar-btn .pl-avatar {
        width: 46px !important;
        height: 46px !important;
        font-size: 16px !important;
    }
}

.humburger-btn {
    display: flex;
    align-items: center;
}

#appMenu {
    border-radius: 0 20px 20px 0;
    border: none;
    max-width: 300px;
}

#appMenu .pl-drawer-name {
    color: #000;
    font-size: 16px;
    font-weight: 700;
    padding-top: 16px;
}

#appMenu .nav-item {
    margin-bottom: 4px;
}

#appMenu .nav-link {
    display: flex;
    align-items: center;
    font-size: 15px;
}

#appMenu .custom-menu-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    background-color: var(--bs-secondary);
}

#appMenu .nav-link.current .custom-menu-icon {
    background-color: var(--bs-primary);
}

#appMenu .nav-link.current {
    color: var(--bs-primary);
}

.pl-app-tabs {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1020;
    background: #fff;
    border-top: 1px solid #E2E4E5;
}

@media (max-width: 991px) {
    .pl-app-top ~ .site-main {
        padding-bottom: 64px;
    }
}

@media (min-width: 992px) {
    .pl-app-tabs {
        display: none;
    }
}

#footerMenu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: space-evenly;
}

#footerMenu .nav-link {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#footerMenu .custom-menu-icon {
    display: inline-block;
    width: 22px;
    height: 22px;
    background-color: var(--bs-secondary);
}

#footerMenu .nav-link.active .custom-menu-icon {
    background-color: var(--bs-primary);
}

#offcanvasNewProject {
    border-radius: 24px 24px 0 0;
    background-color: #F9F9F9;
    height: auto;
    max-height: calc(100vh - 74px);
    border: none;
}

#offcanvasNewProject .offcanvas-body {
    overflow-y: auto;
}

#offcanvasNewProject .offcanvas-header > div {
    display: grid;
    grid-template-columns: 40px auto 40px;
    align-items: center;
}

#offcanvasNewProject .offcanvas-title {
    text-align: center;
}

#offcanvasNewProject .form-label {
    font-size: 12px;
    margin-bottom: .25rem;
}

/*
 * The old <main> filled the screen under the top bar, and the calculators were a panel filling
 * it. The window scrolls here, so those pages ask for the height themselves.
 */
.site-main:has(> [data-pl-view="weight_calculator"], > [data-pl-view="clearance_calculator"], > [data-pl-view="lateral_load_calculator"]) {
    min-height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
    background-color: #09090b;
    border-radius: 30px 30px 0 0;
    overflow: hidden;
}

.site-main > [data-pl-view="weight_calculator"],
.site-main > [data-pl-view="clearance_calculator"],
.site-main > [data-pl-view="lateral_load_calculator"] {
    flex: 1 1 auto;
}
