@import '../node_modules/react-md/src/scss/react-md';
@import '../node_modules/leaflet/dist/leaflet.css';

$md-primary-color: $md-cyan-500;
$md-secondary-color: $md-pink-a-200;
$md-font-regular: 300;

@include react-md-everything;

body {
  margin: 0;
  padding: 0;
  font-family: sans-serif;
}

// Making sure titles are less bold
h2, .md-subheading-2 {
  font-weight: $md-font-regular;
}

.md-dialog.md-transition-in {
    transform: translate3d(0px, 0px, 0px) scale(1);
}

/**
*/
.md-title--toolbar {
  .title-logo {
    float: left;
    padding-right: 10px;
    padding-top: 10px;
    
    img {
      max-height: 40px;
      max-width: 40px;
    }
  }
}

/*=============*/
/* Chips Style */
/*=============*/
.chip-list {
  .md-chip {
    margin: 1em 1em 0 0;
  }
}

/*=============*/
/* Grid Layout */
/*=============*/

/* Need this to ensure react-grid-leyout streches on the screen*/
.layout {
  width: 100%;
}


/*=============*/
/* Card Styles */
/*=============*/

.md-card {
  position: relative;
  height: 100%;

  &.hide-borders {
    box-shadow: none; 
  }
}

.md-card-title {
  padding: 10px;
  padding-top: 10px;
  font-weight: $md-font-regular;

  .md-card-title--title {
    display: flex;
  }
}

.md-card .md-media {
  padding: 73px 0 0 0;
  margin-top: -73px;
  height: 100%;

  &.md-card-scorecard {
    padding: 0;
    margin-top: 0;

    .dash-value {
      margin-top: 8px;
      margin-right: 8px;
    }
    
    .dash-icon {
      margin-top: 5px;
    }
  }
}

.templates .md-card-title--title-block {
  width: 100%;
  overflow: hidden;
}

.templates h2.md-card-title--title,
.templates h3.md-card-title--title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

div.templates > section > div.preview {
  opacity: 0.5;
  transition: opacity .5s ease-out;
}

div.templates:hover > section > div.preview {
  opacity: 1.0;
}

.md-card {
  .card-icon {
    cursor: default;
    position: relative;
    z-index: 10;
    float: right;
    padding: 2px 7px;
  }

  .card-settings {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 1;
  }

  .card-settings > span {
    float: left;
  }

  .card-settings-btn {
    color: lightgrey;
  }

  .card-settings-btn:hover {
    color: $md-primary-color;
  }
}

.react-draggable {
  border: 2px solid gray;

  .md-card {
    pointer-events: none;
    opacity: 0.4;
  }
}

.dash-error {
  color: $md-red-500;
}

.dash-success {
  color: $md-light-green-500;
}

/*=============*/
/* Recharts    */
/*=============*/

.recharts-legend-item .recharts-surface {
  bottom: auto;
  top: auto;
  left: auto;
  right: auto;
  height: auto;
  width: auto;
  position: static;
}

.recharts-legend-item-text {
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100px;
  white-space: nowrap;
  vertical-align: middle;
}

/*=============*/
/* Data Tables */
/*=============*/

.md-data-table {


  &.table-compact {
    .md-table-column--header {
      height: 47px;
    }
    .md-table-column {
      vertical-align: middle;
      padding-top: 7px;
      padding-bottom: 7px;
      padding-right: 16px;
      height: 51px;
    }
  }

  .md-table-row {
    .md-btn--icon {
      color: $md-secondary-color;
      height: 30px;
      padding: 3px 0 10px 0;
      width: 30px;
      visibility: hidden;
    }

    &:hover {
      .md-btn--icon {
        visibility: visible;
      }
    }
  }

  td.message {
    span {
      width: 100%;
      word-wrap: break-word;
      white-space: normal;
    }
  }

  .MBFEvent-BotMessage, tr.Customer { 
    background-color: $md-blue-50;

    td.message, td.text {
      text-align: right;
    }
  }

  tr.intent td.message .indicator {
    //background-color: $md-red-50;

    display:inline-block;
    width: .5em;
    height: .8em;
    position:relative;

    &:before,
    &:after {
      display:block;
      content:"";
      width:10px;
      height:0em;
      border-style:solid;
      position:absolute;
    }
    &:before {
      top: 2px;
      right:0;
      border-width:.4em 0 .4em .4em;
      border-color:transparent transparent transparent $md-secondary-color;    
    }
    &:after {
      left:0;
      border-width:.4em 0 .4em .4em;
      border-color:transparent transparent transparent transparent;    
    }
  }
}

/*==============*/
/* Drawer Style */
/*==============*/
.md-drawer {
  .md-media {
    b {
      font-weight: 500;
    }
  }
}

.split-view {
  .md-avatar-content {
    font-size: 14px;
  }
}

ul.aligned {
  margin: 16px;
  padding: 0;
  list-style-position: 'outside';
}

header .md-btn, section .md-btn {
  z-index: 1;
}

/*================*/
/* Minimal Design */
/*================*/

.md-card {
  .md-text--secondary {
    font-weight: 300;
  } 

  .md-media {
    padding: 46px 0 0 0;
    margin-top: -46px;
  }

  .widgets {
    top: -5px;
  }
}


/*======*/
/* Map  */
/*======*/

.leaflet-control-attribution {
  display: none;
}

.leaflet-popup-content {
  b {
    font-weight: 600;
  }
}


/*================*/
/* Dialogs with toolbar */
/*================*/

.dialog-toolbar-no-padding .md-dialog-content--padded{
  padding: 0px;
}
.dialog-toolbar-no-padding footer{
  position: absolute;
  bottom:0px;
  right:0px;
  width:100%;
}


.vertical-menu .active-item{
  background: $md-cyan-500;
}
.vertical-menu .md-text--theme-primary{
  color: $md-cyan-50;
}

#testerForm footer {
  position: absolute;
  bottom: 0;
  right: 0;
}

/*===================*/
/* Dialogs full page */
/*===================*/

html.md-no-scroll {
  overflow-y: hidden;
}

/*================*/
/* Code editor    */
/*================*/

.ace_editor > *, .ace_layer > *, .ace_content, .ace_line > *, .ace_text-input {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
  font-size: 12px;
  font-weight: normal;
}

/*================*/
/* Toast          */
/*================*/

.md-snackbar-container {
  z-index: 111;
}

/*================*/
/* Layout         */
/*================*/

.layout {
  display: table;
  width: 100%;
  height: 100%;
}

.layout > .center {
  display: table-cell;
  text-align: center;
  vertical-align: middle;
}

/*================*/
/* Styles         */
/*================*/

.fail {
  color: red !important;
}

/*================*/
/* datePicker         */
/*================*/

#dateRangePicker.md-dialog {
  width: auto;
}
