/*
 * @license
 * Your First PWA Codelab (https://g.co/codelabs/pwa)
 * Copyright 2019 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
 *
 *     https://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 {
  color: #444;
  font-family: 'Helvetica', 'Verdana', sans-serif;
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  height: 100%;
  margin: 0;
  padding: 0;
  width: 100%;
}

html {
  overflow: hidden;
}

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

/**
 * Header
 */

.header {
  align-content: center;
  align-items: stretch;
  background: #3f51b5;
  box-shadow:
    0 4px 5px 0 rgba(0, 0, 0, 0.14),
    0 2px 9px 1px rgba(0, 0, 0, 0.12),
    0 4px 2px -2px rgba(0, 0, 0, 0.2);
  color: #fff;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  font-size: 20px;
  height: 56px;
  justify-content: flex-start;
  padding: 16px 16px 0 16px;
  position: fixed;
  transition: transform 0.233s cubic-bezier(0, 0, 0.21, 1) 0.1s;
  width: 100%;
  will-change: transform;
  z-index: 1000;
}

.header h1 {
  flex: 1;
  font-size: 20px;
  font-weight: 400;
  margin: 0;
}

.header button {
  border: none;
  cursor: pointer;
  height: 24px;
  margin-right: 16px;
  opacity: 0.54;
  outline: none;
  overflow: hidden;
  text-indent: -30000px;
  transition: opacity 0.333s cubic-bezier(0, 0, 0.21, 1);
  width: 24px;
}

.header #butRefresh {
  background: url(/images/refresh.svg) center center no-repeat;
}

.header #butInstall {
  background: url(/images/install.svg) center center no-repeat;
}

.header .powered-by {
  color: white;
  font-size: 0.6em;
  text-decoration: none;
}

/**
 * Loading spinner
 */

.card-spinner {
  background-color: rgba(255, 255, 255, 0.8);
  height: 100%;
  margin-left: -16px;
  margin-top: -16px;
  position: absolute;
  width: 100%;
}

.card-spinner svg {
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
}

.card-spinner svg circle {
  animation: line 1.6s cubic-bezier(0.4, 0, 0.2, 1) infinite, rotate 1.6s linear infinite;
  box-sizing: border-box;
  stroke: #3f51b5;
  stroke-width: 3px;
  transform-origin: 50%;
}

@keyframes rotate {
  from { transform: rotate(0); }
  to { transform: rotate(450deg); }
}

@keyframes line {
  0% {
    stroke-dasharray: 2, 85.964;
    transform: rotate(0);
  }

  50% {
    stroke-dasharray: 65.973, 21.9911;
    stroke-dashoffset: 0;
  }

  100% {
    stroke-dasharray: 2, 85.964;
    stroke-dashoffset: -65.973;
    transform: rotate(90deg);
  }
}

/**
 * Icons
 */

.icon {
  background-repeat: no-repeat;
  background-size: contain;
}

.icon.add {
  background-image: url("/images/add.svg");
}

/*
  Openweather icons
*/

.icon.owm01d {
  background-image: url("/images/ow/01d.png");
}

.icon.owm02d {
  background-image: url("/images/ow/02d.png");
}

.icon.owm03d {
  background-image: url("/images/ow/03d.png");
}

.icon.owm04d{
  background-image: url("/images/ow/04d.png");
}

.icon.owm09d {
  background-image: url("/images/ow/09d.png");
}

.icon.owm10d {
  background-image: url("/images/ow/10d.png");
}

.icon.owm13d {
  background-image: url("/images/ow/13d.png");
}

/* Notturne */

.icon.owm01n {
  background-image: url("/images/ow/01n.png");
}

.icon.owm02n {
  background-image: url("/images/ow/02n.png");
}

.icon.owm03n {
  background-image: url("/images/ow/03n.png");
}

.icon.owm04n{
  background-image: url("/images/ow/04n.png");
}

.icon.owm09d {
  background-image: url("/images/ow/09d.png");
}

.icon.owm09n {
  background-image: url("/images/ow/09n.png");
}

.icon.owm10d {
  background-image: url("/images/ow/10d.png");
}

.icon.owm10n {
  background-image: url("/images/ow/10n.png");
}

.icon.owm11d {
  background-image: url("/images/ow/11d.png");
}

.icon.owm11n {
  background-image: url("/images/ow/11n.png");
}

.icon.owm13d{
  background-image: url("/images/ow/13d.png");
}

.icon.owm13n{
  background-image: url("/images/ow/13n.png");
}

.icon.owm50d{
  background-image: url("/images/ow/50d.png");
}

.icon.owm50n{
  background-image: url("/images/ow/50n.png");
}

/* -- */

.icon.clear-day {
  background-image: url("/images/clear-day.svg");
}

.icon.clear-night {
  background-image: url("/images/clear-night.svg");
}

.icon.rain {
  background-image: url("/images/rain.svg");
}

.icon.snow {
  background-image: url("/images/snow.svg");
}

.icon.sleet {
  background-image: url("/images/sleet.svg");
}

.icon.wind {
  background-image: url("/images/wind.svg");
}

.icon.fog {
  background-image: url("/images/fog.svg");
}

.icon.cloudy {
  background-image: url("/images/cloudy.svg");
}

.icon.partly-cloudy-day {
  background-image: url("/images/partly-cloudy-day.svg");
}

.icon.partly-cloudy-night {
  background-image: url("/images/partly-cloudy-night.svg");
}

.icon.hail {
  background-image: url("/images/hail.svg");
}

.icon.thunderstorm {
  background-image: url("/images/thunderstorm.svg");
}

.icon.tornado {
  background-image: url("/images/tornado.svg");
}

/**
 * Main body
 */

.main {
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  padding-top: 50px;
}

.main .fab {
  background-color: #3f51b5;
  border-radius: 50%;
  bottom: 1rem;
  height: 56px;
  padding: 12px;
  position: fixed;
  right: 1rem;
  width: 56px;
  z-index: 1000;
}

.main .fab .icon {
  display: inline-block;
  height: 100%;
  width: 100%;
}

/**
 * Add dialog
 */

#addDialogContainer {
  background: rgba(0, 0, 0, 0.57);
  height: 100%;
  left: 0;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  top: 0;
  transition: opacity 0.333s cubic-bezier(0, 0, 0.21, 1);
  width: 100%;
  will-change: opacity;
}

#addDialogContainer.visible {
  opacity: 1;
  pointer-events: auto;
}

.dialog {
  background: #fff;
  border-radius: 2px;
  box-shadow:
    0 0 14px rgba(0, 0, 0, 0.24),
    0 14px 28px rgba(0, 0, 0, 0.48);
  left: 50%;
  min-width: 280px;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%) translateY(30px);
  transition: transform 0.333s cubic-bezier(0, 0, 0.21, 1) 0.05s;
}

.dialog > div {
  padding-left: 24px;
  padding-right: 24px;
}

.dialog-title {
  font-size: 1.25em;
  padding-top: 20px;
}

.dialog-body {
  padding-bottom: 24px;
  padding-top: 20px;
}

.dialog-body select {
  width: 100%;
}

.dialog-buttons {
  float: right;
  padding-bottom: 16px;
  padding-right: 17px !important;
}

.dialog .button {
  background: transparent;
  border: none;
  font-size: 14px;
  text-transform: uppercase;
}

/* -- Page */

.page {
  display: none;
  height: 100%;
}

.remove-page {
  float: right;
  margin: 10px;
}

.pnlH {
  box-shadow: 
    0 2px 2px 0 rgba(0,0,0,0.14),
    0 3px 1px -2px rgba(0, 0, 0, 0.2),
    0 1px 5px 0 rgba(0, 0, 0, 0.12);
  margin: 6px 2px;
  padding: 7px;
  background: white;
  min-width: 170px;
}

/**
 * Weather forecast card
 */

.weather-card {
  background: #fff;
  border-radius: 10px;
  box-shadow:
    0 2px 2px 0 rgba(0, 0, 0, 0.14),
    0 3px 1px -2px rgba(0, 0, 0, 0.2),
    0 1px 5px 0 rgba(0, 0, 0, 0.12);
  box-sizing: border-box;
  margin: 16px;
  padding: 12px;
  position: relative;
}

.weather-card .remove-city {
  background-color: transparent;
  border: none;
  float: right;
  font-size: x-large;
}

.weather-card #btnHourly {
  background-color: transparent;
  border: 1px solid blue;
  border-radius: 5px;
  float: right;
  font-size: 70%;
  padding: 4px;
}

.weather-card .location {
  font-size: 1.75em;
}

.weather-card .date,
.weather-card .description {
  font-size: 1.25em;
}

.weather-card .current {
  display: flex;
}

.weather-card .current .icon {
  height: 128px;
  width: 128px;
}

.weather-card .current .visual {
  display: flex;
  font-size: 2.8em;
}

.weather-card .current .visual .scale {
  font-size: 0.4em;
  vertical-align: super;
}

.weather-card .current .visual,
.weather-card .current .description {
  flex-grow: 1;
}

.weather-card .current .description .label {
  color: #666;
}

.weather-card .future {
  display: flex;
  padding-top: 10px;
}

.weather-card .future .oneday {
  flex-grow: 1;
  text-align: center;
}

.weather-card .future .oneday .icon {
  height: 64px;
  margin-left: auto;
  margin-right: auto;
  width: 64px;
}

.weather-card .future .oneday .temp-high,
.weather-card .future .oneday .temp-low
/*.weather-card .future .oneday .cloud*/ {
  display: inline-block;
}

.weather-card .future .oneday .temp-low {
  color: #666;
}

/**
 * Media query to adjust size of content for small screens
 */

@media (max-width: 450px) {
  .weather-card .date,
  .weather-card .description {
    font-size: 0.9em;
  }

  .weather-card .current .icon {
    height: 96px;
    width: 96px;
  }

  .weather-card .current .visual {
    font-size: 2.8em;
  }

  .weather-card .future .oneday .icon {
    height: 32px;
    width: 32px;
  }
}
