@import '../colors.css';
@import '../variables.css';

:root {
  --popover-background-color: var(--color-white);
  --popover-body-text-color: var(--color-text-secondary);
  --popover-body-padding: calc(2.0 * var(--unit));
  --popover-border-radius: calc(0.4 * var(--unit));
  --popover-box-shadow: 0 1px 30px 0 rgba(70, 86, 104, 0.4);
  --popover-header-background-color: var(--palette-grey-100);
  --popover-header-border-color: var(--palette-grey-300);
  --popover-header-padding: calc(2.0 * var(--unit)) calc(7.2 * var(--unit)) calc(2.0 * var(--unit)) calc(2.0 * var(--unit));
  --popover-header-title-text-color: var(--color-secondary);
  --popover-header-subtitle-text-color: var(--color-text-secondary);
  --popover-navigation-padding: calc(2.0 * var(--unit));
}

.wrapper {
  align-items: center;
  display: flex;
  height: 100vh;
  justify-content: center;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  z-index: var(--z-index-higher);

  @apply --reset;
}

.popover {
  background: var(--popover-background-color);
  border-radius: var(--popover-border-radius);
  box-shadow: var(--popover-box-shadow);
  position: absolute;
  opacity: 0;
  min-width: 300px;

  &.active {
    opacity: 1;
  }
}

.arrow {
  background: var(--color-white);
  box-shadow: var(--popover-box-shadow);
  content: "";
  height: calc(1.4 * var(--unit));
  position: absolute;
  transform: rotate(45deg);
  left: calc(-.5 * var(--unit));
  top: calc(1.4 * var(--unit));
  width: calc(1.4 * var(--unit));
}

.header {
  background: var(--popover-header-background-color);
  border-bottom: 1px solid var(--popover-header-border-color);
  border-radius: var(--popover-border-radius) var(--popover-border-radius) 0 0;
  padding: var(--popover-header-padding);
  position: relative;
}

.title {
  color: var(--popover-header-title-text-color);
  flex-grow: 0;
  font-size: calc(1.8 * var(--unit));
  font-weight: var(--font-weight-normal);
  line-height: 1.4;
  margin: 0;
}

.subtitle {
  color: var(--popover-header-subtitle-text-color);
  flex-grow: 0;
  font-size: calc(1.4 * var(--unit));
  line-height: 1.4;
  margin: 3px 0 0 0;
}

.close {
  position: absolute;
  right: var(--unit);
  top: calc(1.8 * var(--unit));
}

.body {
  background: var(--popover-background-color);
  color: var(--popover-body-text-color);
  flex-grow: 2;
  padding: var(--popover-body-padding);
  position: relative;

  & p {
    font-size: calc(1.4 * var(--unit));
    font-weight: var(--font-weight-normal);
    letter-spacing: 0;
    line-height: calc(2.4 * var(--unit));
    margin: 0;
  }
}

.navigation {
  background: var(--popover-background-color);
  border-radius: 0 0 var(--popover-border-radius) var(--popover-border-radius) ;
  flex-grow: 0;
  padding: var(--popover-navigation-padding);
  position: relative;
  text-align: right;
}

.button {
  margin-left: var(--popover-navigation-padding);
  min-width: 0;
}
