/**
 *
 * Copyright 2015 Google Inc. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

* {
  box-sizing: border-box;
}

html, body {
  padding: 0;
  margin: 0;
  height: 100%;
  width: 100%;
  font-family: 'Helvetica', 'Verdana', sans-serif;
  font-weight: 400;
  // Not implemented yet but is a nice solution for async loading fonts
  font-display: optional;
  color: #444;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  overflow: hidden;
}

body {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  justify-content: flex-start;
  align-items: stretch;
  align-content: stretch;
  background: #ececec;
}

body:after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: $background;
  opacity: 0;
  will-change: opacity;
  transition: opacity 0.333s cubic-bezier(0,0,0.21,1) 0.4s;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Roboto', 'Helvetica', 'Verdana', sans-serif;
}

.app-deeplink:after {
  opacity: 1;
  pointer-events: auto;
}

a {
  color: $secondary;
}

.is-hidden {
  display: none;
}

button::-moz-focus-inner {
  border: 0;
}

@media(min-width: 600px) {
  .view-underpanel {
    top: 0;
    right: 0;
    position: fixed;
    width: 400px;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
  }

  .view-underpanel__block {
    position: absolute;
    top: 0;
    right: 0;
    width: 360px;
    height: 100%;
    background: $background;
    box-shadow: 0 0 14px rgba(0,0,0,.24),
        0 14px 28px rgba(0,0,0,.48);
    transform: translateX(105%);
    transition: transform 0.233s cubic-bezier(0,0,0.21,1) 0.04s,
      opacity 0.213s cubic-bezier(0,0,0.21,1) 0.04s;
    will-change: transform;
    opacity: 0;
  }

  .view-underpanel__block:after {
    content: '';
    height: 144px;
    width: 100%;
    display: block;
    background: $primaryDark;
    position: absolute;
    top: 0;
    left: 0;
  }

  .view-underpanel--visible .view-underpanel__block,
  .view-underpanel--locked .view-underpanel__block {
    opacity: 1;
    transform: translateX(0);
  }
}

@media(min-width: 960px) {
  .view-underpanel {
    margin-top: 56px;
    left: 46%;
    right: auto;
    position: fixed;
    width: 520px;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
  }

  .view-underpanel__block {
    opacity: 0.0001;
    width: 504px;
    left: 8px;
    transform: translateY(50px);
    transition: transform 0.233s cubic-bezier(0,0,0.21,1) 0.04s,
      opacity 0.213s cubic-bezier(0,0,0.21,1) 0.04s;

    box-shadow: 0 0 6px rgba(0,0,0,.16),
        0 6px 12px rgba(0,0,0,.32);
  }

  .view-underpanel__block:after {
    height: 288px;
  }

  .view-underpanel--visible .view-underpanel__block,
  .view-underpanel--locked .view-underpanel__block {
    opacity: 1;
  }
}
