/**
 * Copyright 2010 and onwards Google Inc.
 *
 * 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;
  font-family: system-ui,sans-serif;
}

body {
  background: #e5e5e5;
  font-size: 14px;
  height: 480px;
  overflow-y: scroll;
  width: 300px;
  line-height: 20px;
  padding: 0;
  margin: 0;
}

/* Customized Scrollbar */
::-webkit-scrollbar {
  /* Only show scrollbar-thumb with no background (clean appearance) */
  background: transparent;
  /* Same width as scrollbar from Google Calendar */
  width: 8px;
}

::-webkit-scrollbar:hover {
  /* Show "path" of scrollbar-thumb */
  background-color: rgba(0, 0, 0, 0.07);
}

::-webkit-scrollbar-thumb {
  /* A bit darker than the original, because of the extensions background */
  background: #afafaf;
  /* To make the scrollbar not too small.
  Maybe in the future it is possible to load more and more events */
  min-height: 40px;
}

/* Color changes on interaction */
::-webkit-scrollbar-thumb:hover {
  background: #a0a0a0
}

::-webkit-scrollbar-thumb:active {
  background: #989898
}

textarea {
  border: 1px solid #ccc;
  font-size: 15px;
  outline: none;
  padding: 4px;
}

header {
  background: #0086f4;
  padding: 12px;
  position: relative;
  color: #fff;
  width: 100%;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
}

/* Separate section from <header>, so only the section is a scrollable area */
.section-container {
  display: flex;
  overflow: hidden;
  height: 432px;
}

section {
  flex: 1;
  overflow: auto;
  height: auto;
  padding: 0 8px;
}

#show_quick_add {
  transition: transform 0.2s ease-in;
}

#show_quick_add.rotated {
  transform: rotate(45deg);
}

.popup-title {
  height: 36px;
  font-size: 16px;
  line-height: 24px;
}

.popup-title a {
  color: #fff;
  outline: none;
  text-decoration: none;
}

.warning {
  background: #FFD54F;
  padding: 4px 8px;
  border-radius: 8px;
  color: #000;
}

#action-bar {
  float: right;
}

#action-bar img {
  cursor: pointer;
  height: 24px;
  width: 24px;
  margin: 0 2px;
}

#info_bar {
  background: #ffdbdd;
  color: #000;
  display: none;
  padding: 8px;
  width: 100%;
  margin-bottom: 8px;
}

#error {
  padding: 72px 12px;
  text-align: center;
  width: 100%;
}

#error p {
  margin-bottom: 36px;
}

#error,
#quick-add {
  display: none;
}

#authorization_required {
  cursor: pointer;
}

#quick-add {
  background: #fff;
  margin: 8px 0;
  padding: 16px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
  border-radius: 2px;
}

h2 {
  margin: 8px 0;
  font-size: 14pt;
  font-weight: normal;
}

#quick-add-event-title {
  width: 100%;
}

.quick-add-buttons {
  text-align: right;
}

#quick-add-calendar-list {
  width: 100%;
  font-size: 16px;
  margin: 4px 0;
}

/* Initial padding at the very top */
#calendar-events {
  padding-top: 16px;
}

/* Small fix for the sticky property, so the date-header moves after the last events shadow.
Otherwise there would be a small black line. */
.calendar-day {
  padding-bottom: 1px;
}

.date-header {
  color: #666;
  background: #e5e5e5;
  font-size: 16px;
  padding: 4px 0;
  position: sticky;
  top: 0;
  z-index: 1;
  /* box-shadow on both sides to hide the underlying shadow of an event */
  box-shadow: -5px 0 0 0 #e5e5e5, 5px 0 0 0 #e5e5e5;
}

.no-events-today {
  color: #333;
  font-size: 14px;
}

.event {
  background: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  color: #333;
  cursor: pointer;
  display: flex;
  margin: 0 0 4px 0;
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

/* Last event of a single day used for spacing between 'calendar-day's
(necessary for 'position: sticky'). */
.event:last-child {
  margin-bottom: 16px;
}

.start-time {
  color: #fff;
  flex: 0 0 60px;
  font-size: 12px;
  overflow: hidden;
  text-align: center;
  /* Start and end times vertically aligned */
  white-space: pre-line;
  display: inline-flex;
  align-items: center;
}

.start-and-end-times {
  color: #888;
  font-size: 12px;
  margin-top: 3px;
}

.detected-event .start-time {
  background-color: #fff;
  text-align: left;
}

.detected-event .start-time img {
  margin: 6px 18px;
}

.event-details {
  flex: 1;
  overflow: hidden;
}

.start-time,
.event-details {
  margin: 0;
  padding: 6px;
}

.event-location {
  color: #666;
  font-size: 12px;
  text-decoration: none;
}

.event-title {
  font-size: 11pt;
  margin: 6px 0;
  font-weight: bold;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.declined {
  text-decoration: line-through;
  color: #999;
}

.start-time,
.event-title {
  line-height: 16px;
  vertical-align: text-bottom;
}

.all-day:not(.detected-event) .start-time {
  flex-basis: 6px;
  padding: 0;
}

.all-day:not(.detected-event) .event-details {
  padding-top: 4px;
  padding-bottom: 4px;
}

.all-day:not(.detected-event) .event-title {
  font-size: 13px;
}

.attachment-icon,
.location-icon,
.video-call-icon {
  float: right;
  height: 15px;
  padding: 0 3px;
  width: 21px;
}

.attachment-icon {
  /* Desaturate attachment icons so they match the look of the other icons. */
  filter: grayscale(100%);
}

.button {
  background: #0086f4;
  border: 0;
  border-radius: 2px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  color: #fff;
  cursor: pointer;
  display: inline-block;
  font-size: 13px;
  text-transform: uppercase;
  line-height: 18px;
  min-width: 64px;
  margin: 4px 0 0 0;
  padding: 6px 32px;
  text-align: center;
  -webkit-transition: all 0.218s;
          transition: all 0.218s;
}

.button:hover {
  box-shadow: 0 1px 1px rgba(0,0,0,0.3);
}

.button:active {
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.3);
}

.button:focus {
  box-shadow:inset 0 0 0 1px rgba(255,255,255,0.5);
  outline: none;
}

@-webkit-keyframes spin {
  from {
    -webkit-transform: rotate(0deg);
            transform: rotate(0deg);
  }
  to {
    -webkit-transform: rotate(360deg);
            transform: rotate(360deg);
  }
}

.spinning {
  -webkit-animation-name: spin;
          animation-name: spin;
  -webkit-animation-duration: 1.5s;
          animation-duration: 1.5s;
  -webkit-animation-iteration-count: infinite;
          animation-iteration-count: infinite;
  -webkit-animation-timing-function: linear;
          animation-timing-function: linear;
}

.alert-new-event {
  margin-top: 10px;
  background-color: #f9eebc;
  padding: 0 8px;
}
