/* Copyright 2024 The Chromium Authors
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file. */

:root {
  color-scheme: light dark;
}

html,
body {
  margin: 0;
  height: 100%;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
}

body {
  overflow: hidden;
  user-select: none;
}

#glic-app-container {
  width: 100%;
  height: 100%;
  display: block;
}

#glic-app-container[hidden] {
  display: none;
}

webview:not([hidden]) {
  display: block;
  height: 100%;
}

webview {
  background-color: var(--color-glic-background);
}

.dialog {
  color: var(--cr-fallback-color-on-surface);
  font-family: Roboto, sans-serif;
  font-size: 13px;
  font-weight: 400;
  left: 0;
  line-height: 20px;
  position: absolute;
  right: 0;
}

#localPanels {
  height: 100%;
}

#localPanels .dialog {
  height: 100%;
}

.dialog .container {
  background: var(--cr-fallback-color-surface1);
  color: var(--cr-fallback-color-on-surface-variant);
}

#localPanels .container {
  display: flex;
  flex-direction: column;
  background: var(--color-glic-background);
  height: 100%;
}

#loadingPanel {
  width: 100%;
}

#loadingPanel .container {
  padding-bottom: 0;
  background: var(--color-glic-background);
}

#loadingPanel .secondline {
  padding: 0 10px 10px;
  display: flex;
  justify-content: space-between;
}

#loadingPanel #sidePanelLoading .secondline {
  flex-direction: column;
  height: 100%;
}

#loadingPanel #floatingLoading .p1 {
  flex: 1;
  height: 17px;
  margin-right: 60px;
  margin-top: 4px;
  border-radius: 5px;
}

#loadingPanel #floatingLoading .p2 {
  height: 16px;
  width: 76px;
  padding: 8px 2px;
  border-radius: 16px;
}

#loadingPanel #floatingLoading .p3 {
  height: 16px;
  width: 28px;
  padding: 8px 2px;
  border-radius: 8px;
}

#loadingPanel #sidePanelLoading .p1 {
  height: 17px;
  width: 78px;
  margin-top: 4px;
  border-radius: 12px;
}

.header-right-align {
  display: flex;
}

#loadingPanel #sidePanelLoading .p2 {
  height: 17px;
  width: 78px;
  margin-top: 4px;
  border-radius: 12px;
}

.center-group {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: end;
}

#loadingPanel #sidePanelLoading .p3 {
  max-height: 244px;
  flex-basis: 50%;
  border-radius: 12px;
  margin-top: 48px;
  margin-bottom: 18px;
}

#loadingPanel #sidePanelLoading .p4 {
  height: 112px;
  border-radius: 12px;
}

.panel .header {
  padding: 12px 20px 12px 12px;
  height: 24px;
  display: flex;
  justify-content: space-between;
  -webkit-app-region: drag;
}

#loadingPanel .header {
  padding-bottom: 8px;
}

.floating #sidePanelLoading {
  display: none;
}

.sidePanel #floatingLoading {
  display: none;
}

.panel .logo {
  padding: 0 0 0 2px;
}

/* Adjust brightness of SVG logo */
@media (prefers-color-scheme: light) {
  .panel .logo {
    filter: brightness(53.6%);
  }
}

.panel .close-button {
  -webkit-app-region: no-drag;
  --cr-icon-button-size: 24px;
  --cr-icon-button-icon-size: 20px;
  color: var(--cr-fallback-color-on-surface-variant);
}

.dialog .notice {
  background-color: var(--color-glic-background);
  color: var(--cr-fallback-color-on-surface);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}

#localPanels .notice {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.notice cr-button + cr-button {
  margin-top: 8px;
}

.notice .icon {
  color: var(--cr-fallback-color-error);
}

#disabledByAdminPanel .notice .icon {
  /* This isn't considered an error, so use primary color. */
  color: var(--cr-fallback-color-primary);
}

#disabledByAdminPanel .without-link {
  display: inline-block;
}

#disabledByAdminPanel .with-link {
  display: none;
}

#disabledByAdminPanel.show-disabled-by-admin-link .with-link {
  display: inline-block;
}

#disabledByAdminPanel.show-disabled-by-admin-link .without-link {
  display: none;
}

.dialog p {
  margin: 0 0 8px;
}

.dialog .headline {
  font-size: 14px;
  font-weight: 500;
  margin: 8px 0 4px;
}

.notice-message {
  max-width: 356px;
}

/* Guest panel contains glic webview. If in the show-header state, a header
   will also be visible. */
#guestPanel {
  width: 100%;
  height: 100%;
  border: 0;
}

.hidden {
 display: none;
}

.outerheader {
  background: var(--color-glic-background);
  position: absolute;
  width: 100%;
  height: 48px;
}

#webviewHeader {
  display: none;
}

#guestPanel.show-header {
  display: flex;
  flex-direction: column;
}

#guestPanel.show-header #webviewHeader {
  display: block;
  position: relative;
  width: 100%;
  order: -1;
}

#webviewContainer {
  position: absolute;
  width: 100%;
  height: 100%;
}

#guestPanel.show-header #webviewContainer {
  position: relative;
  width: 100%;
  height: auto;
  flex: 1;
}

.tonal-button {
  background-color: var(--cr-fallback-color-secondary-container);
  color: var(--cr-fallback-color-on-secondary-container);
}

#debug {
  position: absolute;
  right: 30px;
}

cr-progress {
  width: 80%;
  margin: 20px 10% 0;
  --cr-progress-active-color: #A8C7FA;
}

.placeholder {
  background-color: var(--cr-fallback-color-surface1);
  animation: 1s infinite ease-in-out opacity-fade;
}

@keyframes opacity-fade {
  0% {
    opacity: 100%;
  }
  33% {
    opacity: 50%;
  }
  100% {
    opacity: 100%;
  }
}

.p2 {
  animation-delay: 0.1s;
}

.p3 {
  animation-delay: 0.2s;
}

.p4 {
  animation-delay: 0.3s;
}

.p5 {
  animation-delay: 0.4s;
}

.p6 {
  animation-delay: 0.5s;
}

.p7 {
  animation-delay: 0.6s;
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  background-color: rgba(0, 0, 0, .6);
  width: 100%;
  height: 100vh;
  display: block;
  align-content: center;
  opacity: 1;
  transition-property: opacity;
  transition-duration: 0.2s;
  transition-timing-function: ease-in-out;
  transition-delay: 0.2s;
}

.overlay.hidden {
  opacity: 0;
  transition-delay: 0.2s;
  pointer-events: none;
}

.overlay .container {
  text-align: center;
}

.overlay .message {
  display: inline-block;
  font-family: Roboto, sans-serif;
  font-size: 11px;
  font-weight: 500;
  line-height: 16px;
  color: var(--cr-fallback-color-on-surface);
  background-color: var(--color-glic-background);
  padding: 12px;
  margin: 0 20px;
  border-radius: 10px;
  opacity: 1;
  transition-property: opacity;
  transition-duration: 0.2s;
  transition-timing-function: ease-in-out;
  transition-delay: 0s;
}

.overlay.hidden .message {
  opacity: 0;
  transition-delay: 0s;
}

.overlay cr-icon {
  color: var(--cr-fallback-color-primary);
  width: 20px;
  height: 20px;
}


#showError {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--cr-fallback-color-surface1);
  color: var(--cr-fallback-color-on-surface-variant);
}

/* Scoped styles for Android platforms */
.androidMobile .dialog .headline {
  font-size: 20px;
  line-height: 24px;
  font-weight: 500;
  margin: 16px 0 8px 0;
  color: var(--cr-fallback-color-on-surface);
}

.androidMobile .dialog p {
  font-size: 14px;
  line-height: 20px;
  font-weight: 400;
  color: var(--cr-fallback-color-on-surface-variant);
  margin: 0 0 24px 0;
}

.androidMobile .dialog .icon cr-icon {
  width: 36px;
  height: 36px;
}

/* Primary Button styling for Android */
.androidMobile .tonal-button {
  background-color: var(--cr-fallback-color-primary);
  color: var(--cr-fallback-color-on-primary);
  font-size: 14px;
  font-weight: 500;
  height: 40px;
  border-radius: 20px; /* Pill shape */
  padding: 0 24px;
  box-shadow: none;
  text-transform: none;
  border: none;
}

.androidMobile .tonal-button:hover,
.androidMobile .tonal-button:focus {
  background-color: var(--cr-fallback-color-primary);
  opacity: 0.9;
}

.androidMobile .panel .close-button {
  --cr-icon-button-size: 48px;
  --cr-icon-button-margin-end: -20px;
  margin-block: -12px;
}

