@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap');


:root {
  --delta-color-xs-bg: #ffbcbc;
  --delta-color-xs-txt: #fff;

  --delta-color-s-bg: #fc9b9b;
  --delta-color-s-txt: #fff;

  --delta-color-m-bg: #fe5454;
  --delta-color-m-txt: #fff;

  --delta-color-l-bg: #d70000;
  --delta-color-l-txt: #fff;


  --color-trips: #17e0dc;
  --color-record: #EF3E36;
  --color-error: #be2000;

  --panel-bg-color: rgba(255,255,255,.93);
  --panel-box-shadow: 0 0 16px rgba(0,0,0,.15);
  --panel-box-shadow-s: 0 0 6px rgba(0,0,0,.15);
  --panel-box-border: 2px solid #fff;

  --point-box-shadow: 0px 3px 6px rgba(0,0,0,.25);

  --loader-bg-color: #2E282A;
  --loader-height: 3px;
  --loader-speed: 1.25s;

  --btn-box-shadow: 0 0 10px rgba(0,0,0,.3);

  --border-radius-l: 20px;
  --border-radius-m: 14px;
  --border-radius-s: 10px;
  --border-radius-xs: 4px;

  --font-family: "Roboto", sans-serif;
  --font-weight-bold: 700;
  --font-weight-regular: 400;
  --font-weight-light: 200;

  --font-size-trip-list-title: 13px;
  --font-size-trip-list-text: 10.5px;

  --letter-spacing: .1px;
}






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

html,body{
  width: 100vw;
  height: 100vh;
  height: 100svh;
  margin: 0;
  padding: 0;
}

body {
  background: #fff;
  transition: all .15s ease-in-out;

  font-family: var(--font-family);
  font-optical-sizing: auto;
  line-height: 1.5;
  letter-spacing: var(--letter-spacing);
  color: #333;
}

main{
  width: 100%;
  height: 100%;
  overflow: hidden;

  &[class*="preparing"]{
    /**/
  }
  &[class*="recording"]{
    /**/
  }
}




#map { 
  width: calc( 100vw - 20px);
  height: calc( 100vh - 115px);
  margin: 10px;
  border-radius: var(--border-radius-l);
  box-shadow: var(--panel-box-shadow-s);
  overflow: hidden;

  @media (min-width: 992px) {
    height: calc( 100vh - 20px);
  }

  .map-tooltip{
    /*border: 1px solid rgba(0,0,0,.25);*/
    border: none;
    border-radius: var(--border-radius-s);
    padding: 4px 8px 2px 8px;
    font-size: 11px;
    font-weight: var(--font-weight-bold);
    box-shadow: var(--point-box-shadow);
    transition: background .2s ease-in-out;
    font-family: var(--font-family);

    &[class*="highlight"]{
      z-index: 999;
      background: #222;
      color: #fff;
      animation: do-highlight-point 1s infinite;
      &:before{
        border-top-color: #222;
      }
    }

    &[class*="--time"],
    &[class*="--list"]{
      padding: 4px 8px;
      font-size: 10px;
      font-weight: 700;
      background: var(--color-trips);

      &:before{
        border-top-color: var(--color-trips);
      }
    }
  }
  
}
.shake-delta{
  z-index: 200;
}
.shake-delta--xs{
  color: var(--delta-color-xs-txt);
  background: var(--delta-color-xs-bg);
  span{
    color: var(--delta-color-xs-txt);
    background: var(--delta-color-xs-bg);
  }
  &:before{
    border-top-color: var(--delta-color-xs-bg);
  }
}
.shake-delta--s{
  color: var(--delta-color-s-txt);
  background: var(--delta-color-s-bg);
  span{
    color: var(--delta-color-s-txt);
    background: var(--delta-color-s-bg);
  }
  &:before{
    border-top-color: var(--delta-color-s-bg);
  }
}
.shake-delta--m{
  color: var(--delta-color-m-txt);
  background: var(--delta-color-m-bg);
  span{
    color: var(--delta-color-m-txt);
    background: var(--delta-color-m-bg);
  }
  &:before{
    border-top-color: var(--delta-color-m-bg);
  }
}
.shake-delta--l{
  color: var(--delta-color-l-txt);
  background: var(--delta-color-l-bg);
  span{
    color: var(--delta-color-l-txt);
    background: var(--delta-color-l-bg);
  }
  &:before{
    border-top-color: var(--delta-color-l-bg);
  }
}



button{
  padding: 20px 15px;
  border: none;
  border-radius: var(--border-radius-xs);
  font-weight: var(--font-weight-bold);
  cursor: pointer;
  box-shadow: var(--btn-box-shadow);
  transition: all .2s ease-in-out;
  white-space: nowrap;
  letter-spacing: var(--letter-spacing);

  font-family: var(--font-family);

  &[id="rec-btn"]{
    flex: 2;
    align-items: center;

    background: var(--color-record);
    color: #fff;

    label{
      flex: 2;
      font-size: var(--font-size-trip-list-text);
      text-transform: uppercase;
    }

    span{
      
    }
    svg{
      width: 24px;
      height: 24px;
      vertical-align: text-bottom;
      polygon{
        fill: white;
      }
      path{
        stroke: white;
      }
    }
  }
  &[class*="preparing"]{
    justify-content: space-between;
    animation: recording 2s infinite;
  }
  &[class*="recording"]{
    padding: 15px 15px 16px 15px;
    background: var(--color-record);
    color: #fff;
    font-size: 20px;
    display: flex;
    justify-content: space-evenly;
    animation: recording 2s infinite;

    :first-child{
      flex: 2;
      text-align: left;
    }
    :last-child{
      flex: 2;
      text-align: right;
    }
  }

  &[id="back-btn"]{
    flex: 1;
    background: var(--color-record);
    color: #fff;
  }

  &[id="get-btn"]{
    background: var(--color-trips);
    color: #222;
  }

  &[id="get-modal-btn"]{
    background: var(--color-trips);
    color: #fff;
  }

  &[id="list-btn"]{
    background: var(--color-trips);
    width: fit-content;
    flex: 3;
  }

  &[id="bars-order-btn"]{
    padding: 0;
    background: none;
    box-shadow: none; 
  }

  &[class*="load-btn"]{
    width: 100%;
    margin: 10px 0 0 0;
    padding: 10px;
    color: #222;
    text-align: left;
    box-shadow: none;

    &[class*="current"]{
      background: var(--color-trips);
      border: 1px solid #ddd;
      box-shadow: var(--panel-box-shadow);
    }

    strong{
      font-size: var(--font-size-trip-list-title);
      text-transform: uppercase;
    }
    small{
      font-weight: var(--font-weight-regular);
      font-size: var(--font-size-trip-list-text);
    }
  }

  &[id="save-btn"]{
    background: var(--color-trips);
    color: #222;
  }

  &[id="publish-btn"]{
    background: var(--color-trips);
    color: #222;
    flex: 12;
  }

  &[class*="load-more-btn"]{
    margin: 10px 0;
    width: 100%;
    background: #222;
    color: var(--color-trips);
  }

  &[class="close-btn"]{
    position: absolute;
    top: -20px;
    right: 15px;
    width: 40px;
    height: 40px;
    font-size: 17px;
    font-weight: 300;
    background: #fff;
    color: #222;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: var(--panel-box-shadow);
  }


  &:empty{
    display: none;
  }

  &:active{
    color: #fff;
    background: #222;
  }

  &[disabled]{
    background: #999;
    color: #333;
    text-decoration: line-through;
    cursor: not-allowed;
  }
}





.bars{
  position: fixed;
  z-index: 2011;
  left: 0;
  /*bottom: 60px;*/
  top: 0;

  max-width: 400px;
  width: calc( 100% - 20px );
  height: 100px;
  margin: 10px 10px;
  padding: 25px 5px 7px 5px;

  background: var(--panel-bg-color);
  box-shadow: var(--panel-box-shadow);
  border-radius: var(--border-radius-s);
  border: var(--panel-box-border);
  
  overflow-x: auto;
  overflow-y: visible;

  transition: all .25s ease-in-out;

  /*overflow-x: auto;
  overflow-y: visible;
  */

  [class*='-wrapper']{
    width: min-content;
    height: 100%;

    
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    align-items: flex-end;
    flex-wrap: nowrap;
    white-space: nowrap;
  }

  & > label{
    position: fixed;
    top: 16px;
    left: 20px;

    display: flex;
    justify-content: center;
    align-items: center;

    font-weight: var(--font-weight-regular);
    font-size: 10px;
    line-height: 10px;
    color: var(--delta-color-l-bg);

    button{
      display: flex;
      justify-content: center;
      align-items: flex-end;
      padding: 0 0 0 5px;
      font-weight: var(--font-weight-bold);
      font-size: 10px;
      line-height: 10px;
      letter-spacing: -.25px;
      color: #222;
      text-transform: uppercase;
    }
  }

  .bar{
    position: relative;
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    flex: 10 0 auto;
    height: 100% !important;
    width: 7px;
    padding: 0 2px;
    margin: 0 3px;
    border-radius: var(--border-radius-xs);
    overflow: hidden;
    transition: all .25s ease-in-out;

    &[class*="--point"]{
      
    }
    &[class*="--shake"]{
      background: #f3f3f3;
    }

    &[class*="highlight"],
    &:hover{
      opacity: 1;
      cursor: pointer;
      background: #222;
      animation: do-highlight-bar 1s infinite;

      /*
      &:after{
        content: "•";
        position: absolute;
        top: -20px;
        font-size: 30px;
        line-height: 30px;
      }
      */
    }

    .bar__wrapper{
      width: 7px;
      min-height: 5px;
      transition: all .25s ease-in-out;
      border-radius: var(--border-radius-xs);
      overflow: hidden;
    }
  }
}




#list-modal,
#save-modal{
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;

  display: none;
  justify-content: center;
  align-items: center;

  &[class*='active']{
    display: flex;
    background: var(--panel-bg-color);
  }

  .modal-wrapper{
    position: relative;
    max-width: 500px;
    min-width: 300px;
    margin: 20px;
    padding: 20px 20px 5px 20px;
    
    border-radius: var(--border-radius-s);
    box-shadow: var(--panel-box-shadow);
    /*border: 2px solid #fff;*/

    h2{
      margin: 0 0 30px 0;
      padding: 0 0 0px 0;
      line-height: 1;
    }
    h4{
      margin: 20px 0 7px 0;
      font-size: 14px;
    }
    fieldset{
      position: relative;
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin: 1px 0;
      padding: 0;
      border: none;

      &:first-of-type{
        border-radius: var(--border-radius-xs) var(--border-radius-xs) 0 0;
      }
      &:last-of-type{
        border-radius: 0 0 var(--border-radius-xs) var(--border-radius-xs);
      }
    }
    section{
      flex: 2;
      margin: 0 1px 0 0;
      padding: 10px 15px 12px 15px;
      word-break: break-all;
      white-space: nowrap;
      font-size: 13px;
      text-align: center;
      background: #dedfdf;

      &:last-of-type{
        margin: 0;
      } 
    }
    input{
      width: calc( 100% - 45px);
      margin: 0 0 0 15px;
      padding: 8px 10px;
      border: 1px solid #ccc;
      border-radius: var(--border-radius-xs);
    }
    label{
      display: inline-block;
      font-size: 9px;
      font-weight: var(--font-weight-bold);
      text-transform: uppercase;
    }
    .ctas{
      margin: 10px 0 0 0;
      padding: 0px 0 0 0;
      /* border-top: 1px dashed #ccc;*/
    }
    svg{
      vertical-align: bottom;
    }
  }

  .modal-form{
    margin: 0px 0 0 0;
    border-radius: var(--border-radius-s);
    overflow: hidden;
  }
  .modal-data{
    margin: 0px 0 0 0;
    border-radius: var(--border-radius-s);
    overflow: hidden;

    label{
      opacity: .35;
    }
    span{
      margin: 2px 0 0 0;
      /*display: block;*/
      font-size: 16px;
      font-weight: var(--font-weight-bold);
    }
  }
  .modal-msg{
    margin: 20px 0 10px 0;
    font-size: 13px;
    text-align: left;

    &:empty{
      display: none;
    }
  }
}

#save-modal{
  z-index: 2021;

  .modal-wrapper{
    background: #fee;

    .ctas{
      margin: 20px 0 0 0;
    }
    small{
      font-size: var(--font-size-trip-list-text);
    }
  }
}
#list-modal{
  z-index: 2021;
  .modal-wrapper{
    padding: 20px 10px;
  }
  .modal-wrapper{
    /*background: var(--color-trips);*/
    background: #fff;
    h2{
      margin: 0 0 10px 0;
    }
  }
  .modal-data{
    height: 75vh;
    overflow-y: auto;
  }
}



.ctas{

  &[class*='--bottom']{
    position: fixed;
    z-index: 1999;
    bottom: 0px;
    left: 0;
    max-width: 400px;
    width: calc( 100% - 20px );
    margin: 10px;
    padding: 0 0px;
    display: flex;
    justify-content: space-between;

    background: var(--panel-bg-color);
    border-radius: var(--border-radius-s);
    box-shadow: var(--panel-box-shadow);
    border: var(--panel-box-border);

    button{
      margin: 10px 10px 10px 0;

      &:nth-of-type(1){
        margin: 10px 0 10px 10px;
      }
      &:nth-of-type(2){
        margin: 10px;
      }
      &:nth-of-type(3){
        margin: 10px 10px 10px 0px;
      }
    }
  }
  &[class*='--modal']{
    display: flex;
    width: 100%;
    justify-content: center;
    align-self: center;
    flex-wrap: wrap;

    button{
      margin: 10px 0px 10px 10px;

      &:first-of-type{
        margin: 10px 0px 10px 0px;
      }
    }
  }
  &[class*="--list"]{
    
  }

  
}

#messages{
  position: fixed;
  z-index: 2020;
  bottom: 90px;
  left: 0;
  width: 100%;
  max-width: 420px;
  height: fit-content;
  background: rgba(0,0,0,0);
  transition: all .2s ease-in-out;

  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;

  padding: 10px 0;

  &:empty{
    display: none;
  }

  .message{
    position: relative;
    max-width: calc( 100% - 20px );
    margin: 2px 0px 0 0px;
    padding: 15px 20px;
    color: #222;
    
    background: var(--panel-bg-color);
    border-radius: var(--border-radius-s);
    box-shadow: var(--panel-box-shadow);

    &[class*="--full"]{
      width: 100%;
    }

    &[class*="--trip"]{
      width: 100%;
      color: #222;

      h2{
        margin: 0 0 6px 0;
        text-transform: uppercase;
        font-size: var(--font-size-trip-list-title);
      }
      p{
        font-size: var(--font-size-trip-list-text);
        line-height: 17px;
      }
      svg{
        margin: 0 0 0 3px;
        width: 12px;
        height: 12px;
      }
    }

    &[class*="--pwa"]{
      position: fixed;
      z-index: 20000;
      top: 10px;

      button{
        margin: 20px 0 0 0;
        width: 100%;
        background: #222;
        color: var(--color-record);
      }
    }

    &[class*="--version"]{
      position: fixed;
      z-index: 20000;
      top: 10px;
      right: 10px;

      font-weight: var(--font-weight-bold);

      background: #222;
      color: #fff;
    }

    &[class*="--has-data"],
    &[class*="--need-more-data"]{
      width: 100%;
      button{
        margin: 20px 0 0 0;
        background: #222;
        color: var(--color-record);
        width: 100%;
      }
    }

    &[class*="--error"]{
      width: 100%;
      background: var(--color-error);
      color: #fff;
    }

    & > *:empty{
      margin: 0;
      display: none !important;
    }

    h2{
      margin: 0 0 0 0;
      font-size: 16px;
    }
    p{
      font-size: 13px;
      line-height: 18px;
    }
    svg{
      vertical-align: text-top;
      polygon,
      polyline{
        fill: #222 !important;
        stroke: #222 !important;
      }
      path{
        stroke: #222;
      }
    }
  }
}

.user-marker{
  filter: hue-rotate(210deg);
}

#loader{
  position: fixed;
  z-index: 9999;
  top: -10px;
  left: 0;
  width: 100%;
  height: var(--loader-height);
  

  &[class*="active"]{
    top: 0;

    .loader-data{
      animation: loading var(--loader-speed) infinite;
    }
  }

  .loader-data{
    position: absolute;
    top: 0;
    height: 100%;
    background: var(--loader-bg-color);
  }
}



/* --- fx --- */
.fx{
  height: 0;
  opacity: 0;
  overflow: hidden;
  transition: all .3s ease-in-out;
  

  &[class*="--horizontal"]{
    transform: translateX(30px);
  }
  &[class*="--vertical"]{
    transform: translateY(10px);
  }

  &[class*="--done"]{
    height: initial;
    overflow: initial;
    transform: none;
    opacity: 1;
  }
}




/* --- helpers --- */


[data-lng]{
  opacity: 0;
  font-style: normal;

  &[class="replaced"]{
    opacity: 1;
  }
  &[class="missing"]{
    opacity: 1;
    color: red;
  }
}

.error-text{
  color: var(--color-error);
  font-weight: var(--font-weight-bold);
}
.hidden{
  display: none !important;
}

::-webkit-scrollbar {
    display: none;
}

@keyframes recording {
  0% {
      background: var(--color-record);
  }
  50% {
      background: #000;
  }
  100% {
      background: var(--color-record);
  }
}

@keyframes loading {
  0% {
    width: 0;
    left: 0;
    right: auto;
  }
  49% {
      width: 100%;
      left: 0;
      right: auto;
  }
  51% {
      width: 100%;
      left: auto;
      right: 0;
  }
  100% {
      width: 0%;
      left: auto;
      right: 0;
  }
}

@keyframes do-highlight-bar {
  0% {
    background: rgba(20,20,20, .1);
  }
  50% {
    background: rgba(20,20,20, 1);
  }
  100% {
    background: rgba(20,20,20, .1);
  }
}
@keyframes do-highlight-point {
  0% {
    background: #222;
    color: #fff;
  }
  50% {
    background: #fff;
    color: #222;
  }
  100% {
    background: #222;
    color: #fff;
  }
}