@import './Common.css';

html {
  height: auto !important; /* Prevent trimming the bottom margin of Catalog */
}

body {
  margin: 0;

  &.playbook__theater {
    width: 100vw;
    height: 100vh;
    background: var(--theme);
    color: var(--text);
    overflow: hidden;
  }

  &.playbook__preview {
    width: auto;
    height: auto;
    box-sizing: border-box;
    overflow: auto;
  }
}

.playbook {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  font-family: var(--font-family);
  font-size: var(--font-size);
}

.playbook__left {
  width: var(--left-side-width);
  flex: 0 0 auto;
  transition: width 0.3s ease-out;
  background: var(--theme);
  box-sizing: border-box;
  user-select: none;
  display: flex;
  flex-direction: column;
  outline: none;
}

.playbook__search-box {
  position: relative;

  --search-icon-dimension: 20px;

  .playbook__search-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 20px;
    height: var(--search-icon-dimension);
    width: var(--search-icon-dimension);
    fill: var(--placeholder);
    pointer-events: none;
  }

  input {
    width: calc(100% - 20px);
    margin: 11px 10px;
    padding: 10px 15px 10px calc(10px + var(--search-icon-dimension) + 5px);
    box-sizing: border-box;
    font-family: var(--font-family);
    font-size: inherit;
    font-weight: 500;
    line-height: calc(var(--font-size) + 2px);
    border: none;
    border-radius: 5px;
    outline: none;
    background: var(--theme);
    color: var(--accent);
    transition: box-shadow 0.3s ease-out;
    box-shadow: var(--shadow-default);

    &:hover {
      box-shadow: var(--shadow-hover);
    }

    &::placeholder {
      color: var(--placeholder);
    }

    &::selection {
      background: var(--accent);
      color: var(--theme);
    }
  }
}

.playbook__no-results {
  padding: 10px;
  text-align: center;
  fill: var(--placeholder);
}

.playbook__menu {
  flex: 1 1 auto;
  padding-bottom: 10px;
  overflow-x: hidden;
  overflow-y: auto;
}

.playbook__menu__item {
  display: block;
  padding: 5px 10px;
  color: var(--text);
  font-weight: 300;
  text-decoration: none;
  word-break: break-word;
  outline: none;

  &:hover,
  &:focus {
    color: var(--accent);
  }

  &.--select {
    background: var(--accent);
    color: var(--theme);
  }
}

.playbook__menu__item__last {
  font-weight: 500;
}

.playbook__right {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.playbook__toolbar {
  display: flex;
  background: var(--theme);
  align-items: center;
  box-sizing: border-box;
  padding: 10px;
  gap: 10px;
}

.playbook__button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  appearance: none;
  color: var(--text);
  fill: var(--text); /* For <svg> */
  background: var(--theme);
  border: none;
  border-radius: 5px;
  outline: none;
  padding: 10px;
  min-height: 28px;
  font-family: var(--font-family);
  font-size: var(--font-size);
  font-weight: 500;
  line-height: 1;
  box-sizing: border-box;
  box-shadow: var(--shadow-default);
  transition: box-shadow 0.3s ease-out, transform 0.2s ease-out;
  cursor: pointer;

  &:hover:not(.playbook__button__active) {
    color: var(--accent);
    fill: var(--accent); /* For <svg> */
    box-shadow: var(--shadow-hover);
  }

  &:focus {
    border-color: var(--accent);
  }

  &:active {
    transform: translateY(2px);
  }

  &>svg {
    width: 18px;
    height: 18px;
    display: block;
  }
}

.playbook__button__active {
  background: var(--accent);
  color: var(--theme);
  fill: var(--theme); /* For <svg> */
}

.playbook__content-container {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  background: var(--theme);
}

#playbook__side-menu-toggle {
  display: none;
}

@media (max-width: 1000px) {
  #playbook__side-menu-toggle {
    display: inline-block;
  }

  .playbook__left {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    width: auto;
    background: var(--theme);

    &:not(.playbook__left-responsive) {
      display: none;
    }

    &.playbook__left-responsive {
      animation: playbook__slide-right 0.5s ease-out;
    }
  }
}

@keyframes playbook__slide-right {
  from {
    transform: translateX(-100vw);
  }

  to {
    transform: translateX(0);
  }
}