/*
 * Copyright (c) 2016-present, Parse, LLC
 * All rights reserved.
 *
 * This source code is licensed under the license found in the LICENSE file in
 * the root directory of this source tree.
 */
@import 'stylesheets/globals.scss';

$headerHeight: 48px;
$menuSectionHeight: 24px;
$sidebarMenuItemHeight: 48px;
$footerHeight: 36px;

.sidebar {
  position: fixed;
  width: 300px;
  top: 0;
  left: 0;
  bottom: 0;
  background: #0c5582;
  color: #fff;
  z-index: 100;

  &.collapsed {
    left: 0;
    width: 54px;

    .section_header > svg {
      margin: 0;
    }

    .pinContainer > svg {
      fill: white;
    }
  }
}

.content {
  position: absolute;
  overflow-y: auto;
  top: $headerHeight;
  right: 0;
  bottom: 36px;
  left: 0;
}

.apps + .content {
  top: $headerHeight + $sidebarMenuItemHeight;
}

.footer {
  @include DosisFont;
  position: absolute;
  background: #05283c;
  padding: 9px 0;
  text-align: center;
  bottom: 0;
  left: 0;
  right: 0;

  a {
    color: white;
    text-decoration: none;
    border-right: 1px solid #385261;
    font-size: 13px;
    padding: 0 12px;
    vertical-align: top;


    &:first-child {
      padding-left: 0;
    }
    &:last-child {
      padding-right: 0;
      border: none;
    }
  }
}

.header {
  background: #05283c;
  height: $headerHeight;
  padding: 10px 14px;

  :global(.icon) {
    width: 28px;
    height: 28px;
    float: left;
  }
}

.currentApp, .menuRow {
  @include ellipsis();
  display: block;
  background: #094162;
  height: $sidebarMenuItemHeight;
  padding: 10px 14px;

  color: white;
  font-size: 18px;
  font-weight: 700;
  line-height: 30px;
}

.menuRow {
  cursor: pointer;
  border-bottom: 1px solid #0c5582;

  > *:first-child {
    display: inline-block;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  > *:not(:first-child) {
    float: right;
  }
}

.currentApp {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;

  .appNameContainer {
    display: flex;
    align-items: center;
    cursor: pointer;

    .currentAppName {
      overflow: hidden;
      text-overflow: ellipsis;
      max-width: 215px;
    }

    &:after {
      @include arrow('down', 10px, 7px, #132B39);
      content: '';
      margin-left: 10px;
    }

    &:hover {
      &:after {
        border-top-color: white;
      }
    }
  }
}

.sidebarPin {
  cursor: pointer;
  height: 30px;
  width: 30px;
  padding: 6px;
}

.appsMenu {
  overflow: auto;
  background: #094162;
  width: 300px;

  .menuRow:hover {
    background: #0c5582;
  }

  .currentApp {
    .currentAppName {
      &:after {
        @include arrow('up', 10px, 7px, #132B39);
      }

      &:hover {
        &:after {
          border-bottom-color: white;
        }
      }
    }
  }

  .appListContainer {
    overflow-y: auto;
    height: calc(100vh - #{$headerHeight} - #{$menuSectionHeight} - #{$sidebarMenuItemHeight} - #{$footerHeight});
  }
}

.menuSection {
  @include DosisFont;
  height: $menuSectionHeight;
  line-height: 24px;
  background: #0c5582;
  color: #84A5BC;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 8px;
  padding: 0 14px;
  border-bottom: 1px solid #094162;
}

.createApp {
  @include DosisFont;
  display: block;
  background: $blue;
  color: white;
  width: 91%;
  height: 30px;
  line-height: 30px;
  border-radius: 5px;
  text-align: center;
  margin: 12px auto;
  font-size: 12px;

  &:hover {
    background: #0c5582;
  }
}

.section {
  background: #0c5582;

  :global(.icon) {
    margin-right: 14px;
  }
}

.active {
  background: #159cee;

  .section_header{
    font-weight: 700;
    &:hover{
      background: #159cee;
    }
  }
}

.section_header {
  display: block;
  height: $sidebarMenuItemHeight;
  font-size: 18px;
  line-height: 28px;
  padding: 12px 14px;
  color: white;

  &:hover{
    background-color: #0D5E91;
  }

  > span {
    vertical-align: top;
    @include DosisFont;
  }

  > svg {
    margin-right: 14px;
  }
}

.section_contents {
  background: #0e69a0;
  padding: 16px 14px 16px 50px;
}

.subitem {
  position: relative;
  height: 28px;
  line-height: 28px;
  font-size: 16px;
  font-weight: 700;
  color: white;
}

a.subitem {
  color: #8fb9cf;
  font-weight: 400;
  display: inline-block;
  width: 100%;

  &:hover {
    color: white;
  }
}

.action {
  @include DosisFont;
  position: absolute;
  font-size: 12px;
  font-weight: 400;
  padding: 0 8px;
  line-height: 20px;
  top: 4px;
  right: 0px;
  background: #0c5987;
  color: white;
  border-radius: 3px;

  &:hover {
    background: #094162;
  }
}

.logo {
  float: left;
}

.version {
  @include DosisFont;
  position: relative;
  width: 75px;
  height: 100%;
  font-size: 10px;
  display: flex;
  align-items: center;
  float: left;
  margin-left: 6px;
  white-space: nowrap;
  color: white;

  > *:first-child {
    position: absolute;
    letter-spacing: 2px;
    line-height: 12px;
    text-transform: uppercase;
  }

  > *:first-child {
    transition: all 0.4s 0.16s cubic-bezier(0.77, 0, 0.175, 1);
  }
}

.more {
  display: flex;
  justify-content: center;
  align-items: center;
  svg {
    fill: #0C5582;
    transition: fill 0.2s ease-in;
    margin-right: 4px;
  }

  &:hover {
    svg {
      fill: $blue;
    }
  }
}

.popup {
  position: absolute;
  bottom: 4px;
  left: -183px;
  background: white;
  width: 200px;
  border-radius: 5px;

  &:after {
    @include arrow('down', 12px, 6px, #ffffff);
    content: '';
    position: absolute;
    bottom: -6px;
    right: 94px;
  }

  a {
    @include NotoSansFont;
    display: block;
    height: 40px;
    line-height: 41px;
    font-size: 13px;
    text-align: center;
    border-bottom: 1px solid #e0e0ea;
    color: $mainTextColor;
    padding-right: 8px;
    &:hover{
      background-color: darken(white,4%)
    }

    &:first-child {
      border-radius: 5px 5px 5px 5px;
    }

    &:last-child {
      border-bottom: 0;
      border-radius: 5px 5px 5px 5px;
    }

    .emoji{
      padding-left: 4px;
      padding-right: 2px;
    }
  }
}

.pinContainer {
  height: 48px;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #094162;

  svg {
    cursor: pointer;
    height: 40px;
    width: 40px;
    padding: 10px 10px 10px 10px;
    fill: #132B39;

    &:hover {
      fill: white;
    }
  }
}