@import 'src/_variables.scss';
@import 'src/_logical.scss';
.settings-modal {
  overflow: hidden;

  .setting-list,
  .option-list {
    list-style-type: none;
    padding-inline-start: 2em;
    li {
      margin-block-end: 0.5em;
    }
    .suboptions {
      margin-block-start: 0.3em
    }
  }

  &.peek {
    .settings-modal-panel {
      /* Explanation:
       * Modal is positioned vertically centered.
       * 100vh - 100% = Distance between modal's top+bottom boundaries and screen
       * (100vh - 100%) / 2 = Distance between bottom (or top) boundary and screen
       * + 100% - we move modal completely off-screen, it's top boundary touches
       *   bottom of the screen
       * - 50px - leaving tiny amount of space so that titlebar + tiny amount of modal is visible
       */
      transform: translateY(calc(((100vh - 100%) / 2 + 100%) - 50px));

      @media all and (max-width: 800px) {
        /* For mobile, the modal takes 100% of the available screen.
           This ensures the minimized modal is always 50px above the browser bottom bar regardless of whether or not it is visible.
        */
        transform: translateY(calc(100% - 50px));
      }

      .#{$writing-mode-vertical}rl & {
        transform: translateX(calc(50px - ((100vw - 100%) / 2 + 100%)));
        @media all and (max-height: 800px) {
          transform: translateX(calc(50px - 100%));
        }
      }
      .#{$writing-mode-vertical}lr & {
        transform: translateX(calc(((100vw - 100%) / 2 + 100%) - 50px));
        @media all and (max-height: 800px) {
          transform: translateX(calc(100% - 50px));
        }
      }
    }
  }

  .settings-modal-panel {
    overflow: hidden;
    transition: transform;
    transition-timing-function: ease-in-out;
    transition-duration: 300ms;
    inline-size: 1000px;
    max-inline-size: 90vi;
    block-size: 90vb;

    @media all and (max-width: 800px) {
      max-inline-size: 100vi;
      block-size: 100%;
    }
    @media all and (max-height: 800px) {
      [class^=#{$writing-mode-vertical}] & {
        max-inline-size: 100vi;
        block-size: 100%;
      }
    }

    >.panel-body {
      block-size: 100%;
      @include overflow-block(hidden);

      .btn {
        min-block-size: 2em;
        min-inline-size: 10em;
        padding-block: 0;
        padding-inline: 2em;
      }
    }
  }

  .settings-footer {
    display: flex;
    >* {
      margin-inline-end: 0.5em;
    }

    .extra-content {
      display: flex;
      flex-grow: 1;
    }

    .logout-button {
      position: absolute;
      inset-inline-end: 20px;
      padding-inline-end: 10px;

      @media all and (max-width: 800px) {
        display: none;
      }
      @media all and (max-height: 800px) {
        [class^=#{$writing-mode-vertical}] & {
          display: none;
        }
      }
    }
  }
}
