@import "../../globals.core";

// Z-Index
// --------------------------------------------------
// Grouped by elements which would be siblings

$z-index-menu-overlay:           80;
$z-index-menu-backdrop:          79;
$z-index-overlay:                1000;
$z-index-click-block:            9999;

$z-index-fixed-content:          2;
$z-index-scroll-content:         1;
$z-index-refresher:              0;

$z-index-navbar-section:         10;

$z-index-toolbar:                10;
$z-index-toolbar-background:     -1;

$z-index-toolbar-border:         20;
$z-index-list-border:            50;

$z-index-backdrop:               2;
$z-index-overlay-wrapper:        10;

$z-index-item-options:           1;


// Flex Order
// --------------------------------------------------

$flex-order-toolbar-top:         -10;
$flex-order-toolbar-bottom:      10;

$flex-order-tabbar-navbar:      -30;
$flex-order-tabbar-top:         -20;
$flex-order-tabbar-bottom:      20;



// App Structure
// --------------------------------------------------

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

html {
  width: 100%;
  height: 100%;

  text-size-adjust: 100%;
}

body {
  @include user-select-none();

  position: fixed;
  overflow: hidden;

  margin: 0;
  padding: 0;

  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;

  -webkit-font-smoothing: antialiased;
  font-smoothing: antialiased;

  text-rendering: optimizeLegibility;

  -webkit-user-drag: none;

  -ms-content-zooming: none;
  touch-action: manipulation;

  word-wrap: break-word;

  text-size-adjust: none;
}

ion-app.app-init,
ion-nav,
ion-tabs {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  overflow: hidden;

  flex-direction: column;

  width: 100%;
  height: 100%;
}

ion-navbar-section {
  display: block;

  width: 100%;
  min-height: 50px;
}

ion-content-section {
  position: relative;
  display: block;

  flex: 1;

  width: 100%;
  height: 100%;
}

ion-page {
  position: absolute;
  top: 0;
  left: 0;
  display: none;

  flex-direction: column;

  width: 100%;
  height: 100%;

  &.show-page {
    display: flex;
  }
}

ion-content {
  position: relative;
  display: block;

  flex: 1;

  width: 100%;
  height: 100%;
}

scroll-content {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: $z-index-scroll-content;
  display: block;

  overflow-x: hidden;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  will-change: scroll-position;
}

ion-content.js-scroll > scroll-content {
  position: relative;

  min-height: 100%;

  overflow-x: initial;
  overflow-y: initial;
  -webkit-overflow-scrolling: auto;
  will-change: initial;
}

ion-tabbar {
  position: absolute;
  top: 0;
  left: 0;
  display: block;

  width: 100%;
  min-height: 50px;
}

ion-tab-section {
  position: relative;
  top: 0;
  left: 0;
  display: block;
  overflow: hidden;

  width: 100%;
  height: 100%;
}

ion-page.tab-subpage {
  position: fixed;
  z-index: 10;
}

ion-navbar {
  position: absolute;
  top: 0;
  left: 0;
  z-index: $z-index-navbar-section;
  display: block;

  width: 100%;
  min-height: 50px;
}

ion-navbar-section ion-navbar.toolbar {
  position: absolute;
}

ion-toolbar {
  display: block;

  width: 100%;
}

ion-toolbar[position=bottom] {
  bottom: 0;
  z-index: $z-index-toolbar;
}

.sticky {
  position: sticky;
  top: 0;
}
