// CSS specific to layout the djaoapp dashboard pages
// Colors are setup in djaoapp-dashboard-theme.scss

$dashboard-sidebar-width:      220px;
$dashboard-sidebar-toggle:      20px;
$dashboard-nav-footer-height:   134px;
$dashboard-sidebar-logo-height: 59px;

// CSS specific to color the djaoapp dashboard pages
$dashboard-content-bg:          var(--bs-body-bg);
$dashboard-sidebar-bg:          map-get($theme-colors, "primary");
$dashboard-sidebar-color:       white;
$dashboard-icon-color:          $dashboard-sidebar-color;
$dashboard-icon-color-active:   $dashboard-sidebar-bg;
$code-bg:                       var(--bs-body-bg);
$code-color:                    #a3acb9;
$box-shadow-color:              rgba(0, 0, 0, 0.05);


// Somewhat generic classes
.btn-block {
  display: block;
  width: 100%;
}

.navbar .divider-vertical {
  border-right: 1px solid var(--bs-body-color);
  padding-left: 0.5rem;
  margin-right: 0.5rem;
}

// Profile and user pictures
// -------------------------
.croppa-container {
   background-color: transparent;
   margin-bottom: 25px;
}

.croppa--has-target {
  background-color: white;
}

.imageSlider {
  width: 25rem;
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  display: block;
}


// Code snipset in theme and rules pages
// -------------------------------------
.code {
  background-color: $code-bg;
  color: $code-color;
}

pre.code{
  background-color:inherit;
  color:inherit;
  margin:0;
  font-size: $font-size-sm;
  white-space: pre-wrap;       /* css-3 */
  white-space: -moz-pre-wrap;  /* Mozilla, since 1999 */
  white-space: -pre-wrap;      /* Opera 4-6 */
  white-space: -o-pre-wrap;    /* Opera 7 */
  word-wrap: break-word;       /* Internet Explorer 5.5+ */
  text-align: left;
  word-spacing: normal;
  -moz-tab-size: 4;
  -o-tab-size: 4;
  tab-size: 4;
  -webkit-hyphens: none;
  -moz-hyphens: none;
  -ms-hyphens: none;
  hyphens: none;
}


// Icons to show credit card provider
// ----------------------------------
.card-icons {
  min-height: 32px;
  padding: 9px;
  margin-top: 10px;
  margin-bottom: 0px;
  border-width: 1px;
  border-style: solid;
  border-radius: 4px;
  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);

  background-color: #f5f5f5;
  border-color: #e3e3e3;
  -webkit-box-shadow: inset 0 1px 1px $box-shadow-color;
  box-shadow: inset 0 1px 1px $box-shadow-color;
}

.card-icons > img {
  opacity: 0.1;
}

#card-exp-month {
  width: 50px;
  margin-right: 10px;
}

#card-exp-year {
  width: 65px;
}

@include media-breakpoint-up(sm) {
  #card-cvc {
    width: 100px;
  }
}

// Workaround: Bootstrap4 has make it a lot more complicated than necessary
// when doing server-side validation.
.has-error .invalid-feedback {
  display: block;
}

// Manager dashboards (templates/saas/*.html)
// --------

/* subscriber pipeline */
.date-chooser {
  padding-top: 5px;
  font-size: 0.8em;
}

.dashboard-container {
    clear: left;
    float: left;
    width: 100%;
// XXX temporary override to see the balances table
//    overflow: hidden;
}

.dashboard-pane {
  left: -1;
}

.sidebar-pin-toggle > .fa:before {
  content: "\f08d"; // fa-pin
  font-family: FontAwesome;
}

.dashboard-pane-pinned {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  position: inherit;
  width: inherit;
  left: 0;
}

.dashboard-pane-pinned .sidebar-pin-toggle > .fa:before {
  content: "\f127"; // fa-unlink
  font-family: FontAwesome;
}

.dashboard-nav {
  display: none;
  width: $dashboard-sidebar-width; // col-md-2 width: 16.66666667%;
  overflow: visible; // so we can see the shadow
  -webkit-transition: right 0.25s ease-in-out;
  -moz-transition: right 0.25s ease-in-out;
  -ms-transition: right 0.25s ease-in-out;
  -o-transition: right 0.25s ease-in-out;
  transition: right 0.25s ease-in-out;
  flex-grow: 1;
  user-select: none;
  -webkit-box-flex: 1;
  -ms-flex-positive: 1;
  position: fixed;
  top: 0;
  bottom: 0;
  z-index: 3000; // #app-toolbar-left is 2000
  height: 100%;
}

.dashboard-nav .sidebar-animate {
    overflow: hidden;
    position: relative;
    height: calc(100vh - #{$dashboard-sidebar-logo-height});
    border-right: 1px solid #ccc;
    box-shadow: 0.3em 0.5em 1em rgb(0 0 0 / 60%);
}

.dashboard-nav-main {
    float: left;
    min-height: 100%;
    padding-bottom: $dashboard-nav-footer-height; /* must be equal to .dashboard-nav-footer height in pixel */
}

.dashboard-nav-main .navbar {
    width: $dashboard-sidebar-width;
    height: $dashboard-sidebar-logo-height;
}

// height 38px instead of 42px now
.dashboard-nav-main .navbar-header {
    // no padding top/bottom so menubar align with sidebar top corner.
    height: 42px;
    margin-left: 12px;
}
.dashboard-nav-main .navbar-header>*{
   margin-top: 2px;
    padding-top: 5px;
    padding-bottom: 5px;
    overflow: visible;
    display: inline-flex;
}

.dashboard-nav-menu {
  height: calc(100vh - (#{$dashboard-nav-footer-height} + #{$dashboard-sidebar-logo-height}));
  overflow-y: auto;
}

.dashboard-nav-inner-container .navbar-brand > img {
    max-height: 30px;
}

.dashboard-nav-inner-container .navbar {
    padding-left: 4px;
    padding-right: 4px;
}

.dashboard-nav-footer {
    position: absolute;
    clear:both;
    bottom: 0;
    padding: 10px 30px 10px;
    font-size: 11px;
    width: $dashboard-sidebar-width;
    border-top: 1px solid;
}

.dashboard-nav-footer .footer-links {
    margin-top: 13px;
}

.dashboard-nav-footer .footer-links a {
    margin: 0 3px;
}

.dashboard-nav-footer .footer-links a:first-child {
    margin-left: 0;
}

.dashboard-nav-footer .footer-links a:last-child {
    margin-right: 0;
}

.dashboard-content {
    width: 100%;
    left: 0;
}

.dashboard-content > header,
.dashboard-content > .fullviewport > header {
    position: sticky;
    top: 0;
    z-index: 4;
    width: 100%;
    left: 0;
}

.dashboard-pane-pinned .dashboard-content-body {
  padding-left: $dashboard-sidebar-toggle;
}

.dashboard-nav .dashboard-nav-menu {
    width: $dashboard-sidebar-width;
}

.dashboard-nav-menu > hr {
  margin-left: $dashboard-sidebar-toggle;
  margin-right: $dashboard-sidebar-toggle;
}

.dashboard-nav-menu > .nav {
   margin-left: $dashboard-sidebar-toggle;
   margin-right: $dashboard-sidebar-toggle;
}

.dashboard-nav-menu > .nav li {
    margin: 5px 0px;
}

.dashboard-nav-menu > .nav li > a,
.dashboard-nav-menu > .nav li.active > a {
   height:38px;
   font-size:13px;
}

.dashboard-nav-menu > .nav li > a > i {
   width:25px;
   text-align:center;
}

.dashboard-pane-default .dashboard-nav {
    display: none;
}

.dashboard-pane-pinned .dashboard-nav {
    // sidebar is visible on dashboard on desktops
    display: block;
}

.dashboard-pane-pinned .dashboard-nav .sidebar-animate {
    box-shadow: none;
}

.dashboard-pane-pinned .dashboard-content {
  margin-left: $dashboard-sidebar-width;
  width: calc(100vw - #{$dashboard-sidebar-width});
}

.content-area-container {
  min-height: 300px;
}

.no-results {
    text-align: center;
    padding: 20px 10px;
    margin: 0;
    font-size: 14px;
}


.navbar-nav {
    flex-direction: row;
}

.sidebar-toggle {
//    display: inline; cannot use this if we want to set block in js.
    vertical-align: middle;
    line-height: 1;
    padding: 9px 10px;
    border-radius: 3px;
    z-index: 1000;
}

.sidebar-toggle > .bar1, .bar2, .bar3  {
  width: 25px;
  height: 2px;
  margin: 3px 0;
  transition: 0.4s;
  background-color: $dashboard-sidebar-color;
}

.sidebar-toggle > .bar2, .bar3  {
  width: 20px;
}

.sidebar-toggle > .bar3  {
  width: 15px;
}


.sidebar-toggle > .bar1.opened  {
  //-webkit-transform: translate(10px, 0);
  //transform: translate(10px, 0);
}

.sidebar-toggle > .bar2.opened  {
  -webkit-transform: translate(5px, 0);
  transform: translate(5px, 0);
}

.sidebar-toggle > .bar3.opened  {
  -webkit-transform: translate(10px, 0);
  transform: translate(10px, 0);
}

.typeahead-dropdown.open>.dropdown-menu {
    display: block;
}


.opened .dashboard-nav-main {
    box-shadow: 10px 0 100px #ccc;
}

.dashboard-nav-menu > hr {
    border-top-width: 1px;
    border-top-style: solid;
}

.dashboard-nav-menu > .nav li.active > a {
    border-radius: 4px;
    text-decoration: none;
}

.dashboard-nav-menu > .nav li:not(.active) > a:hover {
    text-decoration: none;
}

.dashboard-pane-pinned .dashboard-nav-main .sidebar-toggle {
    border-width: 1px;
    border-style: solid;
}

#subscriptions table td {
    vertical-align: middle !important;
}

.pending-users-container {
    padding: 10px 20px;
    border-radius: 3px;
}

.user-password-modal .invalid-feedback {
    display: block;
}

.card-organization .card-img-top {
    width: 50%;
    margin: 20px auto 0;
}

.card-organization .organization-buttons {
    min-height: 110px;
    align-items: center;
    display: flex;
    flex-wrap: wrap;
}

#recent-activity-container .item-name {
    /* TODO need to divide into three columns (a grid or smth similar) */
    width: 200px;
}

#recent-activity-container a:hover {
    text-decoration: none;
}

#recent-activity-container a:hover .item-name {
    text-decoration: underline;
}

.coupon-title {
    display: flex;
    justify-content: space-between;
}

.coupon-title .card-title {
    word-break: break-word;
}

.coupon-title .remove {
    align-self: flex-start;
}

// Dashboard Sidebar Icons
.icon-billing {
    mask-image: url('/assets/img/dash-icons/billing.svg');
    -webkit-mask-image: url('/assets/img/dash-icons/billing.svg');
    width: 20px;
    height: 20px;
}

.icon-connected {
    mask-image: url('/assets/img/dash-icons/connected.svg');
    -webkit-mask-image: url('/assets/img/dash-icons/connected.svg');
    width: 20px;
    height: 20px;
}

.icon-coupons {
    mask-image: url('/assets/img/dash-icons/coupons.svg');
    -webkit-mask-image: url('/assets/img/dash-icons/coupons.svg');
    width: 20px;
    height: 20px;
}

.icon-dashboard {
    mask-image: url('/assets/img/dash-icons/dashboard.svg');
    -webkit-mask-image: url('/assets/img/dash-icons/dashboard.svg');
    width: 20px;
    height: 19px;
}

.icon-funds {
    mask-image: url('/assets/img/dash-icons/funds.svg');
    -webkit-mask-image: url('/assets/img/dash-icons/funds.svg');
    width: 20px;
    height: 17px;
}

.icon-notifications {
    mask-image: url('/assets/img/dash-icons/notifications.svg');
    -webkit-mask-image: url('/assets/img/dash-icons/notifications.svg');
    width: 20px;
    height: 23px;
}

.icon-plans {
    mask-image: url('/assets/img/dash-icons/plans.svg');
    -webkit-mask-image: url('/assets/img/dash-icons/plans.svg');
    width: 20px;
    height: 23px;
}

.icon-revenue {
    mask-image: url('/assets/img/dash-icons/revenue.svg');
    -webkit-mask-image: url('/assets/img/dash-icons/revenue.svg');
    width: 20px;
    height: 20px;
}

.icon-rules {
    mask-image: url('/assets/img/dash-icons/rules.svg');
    -webkit-mask-image: url('/assets/img/dash-icons/rules.svg');
    width: 20px;
    height: 23px;
}

.icon-subscriptions {
    mask-image: url('/assets/img/dash-icons/subscriptions.svg');
    -webkit-mask-image: url('/assets/img/dash-icons/subscriptions.svg');
    width: 20px;
    height: 20px;
}

.icon-subscribers {
    mask-image: url('/assets/img/dash-icons/subscribers.svg');
    -webkit-mask-image: url('/assets/img/dash-icons/subscribers.svg');
    width: 20px;
    height: 13px;
}

.icon-themes {
    mask-image: url('/assets/img/dash-icons/themes.svg');
    -webkit-mask-image: url('/assets/img/dash-icons/themes.svg');
    width: 20px;
    height: 22px;
}

.icon-user {
    mask-image: url('/assets/img/dash-icons/user.svg');
    -webkit-mask-image: url('/assets/img/dash-icons/user.svg');
    width: 20px;
    height: 19px;
}

.icon {
    display: inline-block;
    -webkit-mask-size: cover;
    mask-size: cover;
}

// Charts
// ------
.nvtooltip {
  z-index: 3;
}

.chart-area {
    height: 400px !important;
    width: 100%;
}

.graph-legend-dot {
    height: 12px;
    width: 12px;
    border-radius: 50%;
    display: inline-block;
}

.saas-metrics-chart .nv-legendWrap {
    display: none;
}

/* upload themes */
.dropzone-previews {
  min-height: 150px;
  padding: 54px 54px;
  border-width: 2px;
  border-style: dashed;
  border-radius: 5px;
  margin-bottom: 10px;
}

.navbar-brand > img {
    max-height: 30px;
}

// https://github.com/twbs/bootstrap/pull/37350
input::-webkit-datetime-edit {
    display: block;
    padding: 0;
}

@include media-breakpoint-down(md) {

    .navbar-brand-container {
        position: absolute;
        left: 50%;
        transform: translate(-50%, 0);
        z-index: 10;
    }

    .navbar-brand-container .navbar-brand > img {
        max-height: 36px;
    }

    // always display djaoapp name inside sidebar
    // otherwise need to have two partial brand templates
    .dashboard-nav .navbar-brand .d-none {
        display: inline-block !important;
    }

    .row-header {
        position: absolute;
        width: 115px;
        height: 36px;
        left: 0;
        background: $dashboard-content-bg;
    }

    .row-body:nth-child(2) {
        padding-left: 115px;
    }

    .saas-metrics-chart {
        overflow-x: scroll;
        width: 100%;
    }

    .saas-metrics-chart .chart-area {
        width: 600px;
    }
}

@include media-breakpoint-up(md) {

    .dashboard-content .sidebar-toggle {
        display: none;
    }

    .dashboard-pane-default {
        position: inherit;
        width: inherit;
        left: 0;
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
    }

    .dashboard-pane-default .sidebar-toggle > .bar1.default  {
    }

    .dashboard-pane-default .sidebar-toggle > .bar2.default  {
        -webkit-transform: translate(5px, 0);
        transform: translate(5px, 0);
    }

    .dashboard-pane-default .sidebar-toggle > .bar3.default  {
        -webkit-transform: translate(10px, 0);
        transform: translate(10px, 0);
    }

    .dashboard-pane-default .dashboard-nav {
        // sidebar is visible on dashboard on desktops
        display: block;
    }

    .dashboard-pane-default .dashboard-nav .sidebar-animate {
        box-shadow: none;
    }

    .dashboard-pane-default .sidebar-pin-toggle > .fa:before {
        content: "\f127"; // fa-unlink
        font-family: FontAwesome;
    }

    .dashboard-pane-default .dashboard-content {
        margin-left: $dashboard-sidebar-width;
        width: calc(100vw - #{$dashboard-sidebar-width});
    }

    .dashboard-pane-default .sidebar-toggle,
    .dashboard-pane-default .navbar-brand-container,
    .dashboard-pane-pinned .navbar-brand-container {
        display: none;
        margin-left: 0;
    }

}

// Theme colors
// ------------
// We have to define this class here otherwise the sidebar is visible
// public pages.

.dashboard-nav-color-theme {
    background-color: $dashboard-sidebar-bg;
    color: $dashboard-sidebar-color;
}

.dashboard-nav-color-theme .nav-link {
    color: $dashboard-sidebar-color;
}

.dashboard-nav-color-theme .bg-primary {
    background-color: $dashboard-sidebar-bg;
}

.dashboard-nav a,
.dashboard-nav a:active,
.dashboard-nav a:hover,
.dashboard-nav a:focus,
.dashboard-nav a:visited {
}

.dashboard-nav .bg-primary a.navbar-brand,
.dashboard-nav .bg-primary a.navbar-brand:active,
.dashboard-nav .bg-primary a.navbar-brand:hover,
.dashboard-nav .bg-primary a.navbar-brand:focus,
.dashboard-nav .bg-primary a.navbar-brand:visited {
    color: $dashboard-sidebar-color;
}

.opened .dashboard-nav-main {
    box-shadow: 10px 0 100px #ccc;
}

.dashboard-nav-footer {
    border-top-color: $dashboard-sidebar-color;
}

.dashboard-nav-footer .footer-links a {
    color: $dashboard-sidebar-color;
}

.dashboard-nav-menu > hr {
    border-top-color: $dashboard-sidebar-color;
    opacity: 1;
}

.dashboard-nav-menu > .nav li > a {
    background-color:transparent;
}

.dashboard-nav-menu > .nav li.active > a {
    background-color: $dashboard-sidebar-color;
    color: $dashboard-sidebar-bg;
}

.dashboard-nav-menu > .nav li:not(.active) > a:hover {
    color: $dashboard-sidebar-color;
}

.dashboard-nav .footer {
    color: $dashboard-sidebar-color;
}

.dashboard-pane-default .dashboard-nav-color-theme .sidebar-toggle:hover,
.dashboard-pane-pinned .dashboard-nav-color-theme .sidebar-toggle:hover {
    border-color: $dashboard-sidebar-color;
}

.dashboard-nav-color-theme.bg-primary .navbar-nav .nav-link,
.dashboard-nav-color-theme .dropdown-toggle {
    color: $dashboard-sidebar-color;
}

.pending-users-container {
    background: #f3f3f3;
}

.pending-users-container h4 {
    color: #333;
}

.card-organization .card-title a {
    color: black;
}

.icon {
    background: $dashboard-icon-color;
}

.icon-active {
    background: $dashboard-icon-color-active;
}

// Charts
// ------
.graph-legend-dot {
    background: #ccc;
}

/* upload themes */
.dropzone-previews {
  border-color: map-get($theme-colors, "primary");
}

