@import "variables.scss";
@import "fonts.scss";
@import "mixins.scss";
@import "animations.scss";

* {
  box-shadow: none;
  outline: none;
}

:root {
  font-size: 14px;
}

body {
  font-family: $font-stack-regular;
  color: $colour-text1;
  line-height: 1.25rem;

  h2 {
    font-size: 1.5em;
    font-weight: 800;
    line-height: 1.2em;
    float: left;
    margin: 0;
  }

  h4 {
    font-size: 1.3rem;
    font-weight: 800;
    margin-top: 0;
    line-height: 1.75rem;
  }

  a {
    color: inherit;
    border-bottom: 1px dotted $colour-text1;
    transition: all ease-in-out 0.2s;
    cursor: pointer;

    &:active {
      color: $colour-link-highlight !important;
      border-bottom-color: $colour-link-highlight !important;
    }

    &:focus,
    &:hover {
      color: $colour-link-highlight;
      border-bottom-color: $colour-link-highlight;
      text-decoration: none;
      outline: 0;
    }
  }

  button {
    &.btn {
      border-width: 0;

      &:active,
      &:hover,
      &:focus {
        box-shadow: none;
      }

      &.btn-default {
        font-size: 1.2rem;
        font-weight: 800;
        text-transform: capitalize;
        background-color: rgba($colour-text1, 0.3);
        color: $colour-text1;
        min-width: 6rem;
        border-color: $colour-text1;
        border-width: 0.15rem;
        border-radius: $border-radius-input;
        transition: all ease-in-out 0.2s;
        padding: 0 1.2rem;
        line-height: 2.5rem;

        &:not([disabled]):active {
          background-color: $colour-text1 !important;
          color: $colour-link-highlight !important;
          border-color: $colour-text1 !important;
        }

        &:not([disabled]):hover {
          background-color: $colour-text1;
          color: $colour-link-highlight;
          border-color: $colour-text1;
        }

        &:not([disabled]):focus {
          text-decoration: underline;

          &:active,
          &:hover {
            text-decoration: none;
          }
        }

        &[disabled] {
          opacity: 0.5;
          cursor: default;
          background-color: rgba($colour-text1, 0.3);
          border-color: $colour-text1;
          color: $colour-text1;
        }
      }

      &.btn-fab {
        background-color: $colour-text2;
        color: $colour-text1;
        font-size: 1.5rem;
        border-radius: 100%;
        width: 4rem;
        height: 4rem;
        padding: 0;
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        border: none;
        cursor: pointer;
        overflow: hidden;
        box-shadow: 0 3px 5px -1px rgba(0, 0, 0, 0.2), 0 6px 10px 0 rgba(0, 0, 0, 0.14),
          0 1px 18px 0 rgba(0, 0, 0, 0.12) !important;
        transition: color ease-in-out 0.2s;
        z-index: 10;

        &:active {
          background-color: $colour-link-highlight !important;
          color: $colour-text1 !important;
        }

        &.fixed {
          position: fixed;
          bottom: 1rem;
          right: 1rem;
        }
      }

      &.btn-icon {
        background: none;
        color: $colour-text2;
        padding: 0;
        border-radius: 0;
        opacity: 0.4;
        transition: opacity ease-in-out 0.2s;

        &:active {
          opacity: 1 !important;
        }

        &:hover,
        &:focus {
          opacity: 1;
        }
      }

      &:active,
      &:active:focus,
      &:focus,
      &:hover {
        outline: 0;
      }

      .spinner-border-sm {
        border-width: 0.15rem;
        height: 0.75rem;
        width: 0.75rem;
        vertical-align: baseline;
        margin-right: 0.1rem;
        @include spinner-colour($colour-text2);
      }
    }
  }

  p {
    margin: 0 0 0.75rem;
  }

  .alert {
    position: fixed;
    z-index: 1010;
    width: 100%;
    max-width: $width-tablet-small;
    border: none;
    border-radius: 0;
    margin: 0 auto;
    background-color: rgba($colour-danger, 0.9);
    border: none;
    color: $colour-text1;

    @media (min-width: $width-mobile-small + 1) {
      font-size: 0.9rem;

      h4 {
        margin-bottom: 0 !important;
        margin-top: -0.4rem;
      }

      p {
        @include text-overflow-ellipsis;
        max-width: 95%;
      }
    }

    a {
      &:active,
      &:focus,
      &:hover {
        color: $colour-text2;
        border-bottom-color: $colour-text2;
      }
    }

    button.btn-close {
      float: right;
      color: $colour-text1;
      font-size: 1.2rem;
      line-height: 1.7rem;

      @media (min-width: $width-mobile-small + 1) {
        font-size: 1.5rem;
        line-height: 2.5rem;
      }

      i {
        opacity: 0.7;
      }
    }

    p {
      &:hover {
        color: $colour-text1;
      }

      margin-bottom: 0;
    }

    h4 {
      margin-bottom: 0.5rem;
    }
  }

  .background {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    z-index: 10;
    @include background-gradient(20deg, $colour-bg1, 0, $colour-bg2, 100%);

    .background-img {
      display: block;
      position: absolute;
      z-index: 0;
      width: $bg-width * 10;
      height: $bg-height * 10;
      top: -$bg-height;
      background: url("../img/clouds.svg");
      background-size: $bg-width;
      background-repeat: repeat;
      opacity: 0.2;
      @include animation(animation-clouds 100s linear infinite);
    }
  }

  .bottom {
    position: relative;
    display: table-cell;
    vertical-align: bottom;
  }

  .buttons {
    text-align: center;
    position: relative;
    white-space: nowrap;

    button {
      margin-right: 0.5rem;

      &:last-child {
        margin-right: 0;
      }
    }
  }

  .checkbox {
    width: 2.5rem;
    height: 1.3rem;
    position: relative;
    background: $colour-text2;
    border-radius: $border-radius-input;
    padding: 0.15rem;

    input {
      display: none;

      &[type="checkbox"]:checked + label {
        left: 1.35rem;
        background: $colour-link-highlight;
      }
    }

    label {
      display: block;
      width: 1rem;
      height: 1rem;
      border-radius: 50%;
      cursor: pointer;
      position: absolute;
      left: 0.15rem;
      background: $colour-link;
      min-height: 0;
      min-width: 0;
      padding: 0;
      margin: 0 !important;

      &.animate {
        transition: all 0.25s ease;
      }
    }
  }

  .container {
    height: 100%;
    max-width: 100%;
    position: relative;
    padding: 0;
    margin: 0;
    z-index: 20;
  }

  .darken {
    position: absolute;
    height: 100%;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 100;
    opacity: 0.8;
    background: $colour-text2;
  }

  .ellipsis {
    &:after {
      content: "\2026";
    }
  }

  .float-nowrap {
    width: 200%;
    overflow: auto;
  }

  .float-right {
    float: right;
  }

  .form-group {
    position: relative;
    margin-bottom: 1rem;

    &.btn-icon-container {
      input {
        padding-right: 2.3rem !important;
      }

      .btn-icon {
        position: absolute;
        top: 50%;
        right: 0.3em;
        margin-top: -1.05em;
        height: 2.1em;
        width: 2.1em;
        font-size: 0.9em;
        color: $colour-text1;
        border-radius: $border-radius-input;
        background-color: #7db2be;
        z-index: 55;

        &:active {
          background: $colour-bg2 !important;
        }

        &:hover {
          background: $colour-bg2;
        }

        &:focus {
          border: 1px solid darken(#7db2be, 15%);

          &:hover {
            border: none;
          }
        }

        i {
          position: absolute;
          top: 50%;
          margin: auto;
          transform: translate(-50%, -50%);
          opacity: 1 !important;
        }
      }
    }

    &.has-error {
      input,
      textarea {
        &.form-control {
          border: 1px solid $colour-danger !important;
          color: $colour-danger !important;
          @include placeholder {
            color: $colour-danger !important;
            opacity: 0.8 !important;
          }
        }
      }
    }

    input,
    textarea {
      &.form-control {
        font-size: 1rem;
        background-color: $colour-text1;
        color: $colour-text2;
        resize: none;
        border: none;
        width: 100%;
        @include placeholder {
          color: $colour-link;
        }
      }
    }

    input.form-control {
      border-radius: $border-radius-input;
      line-height: 2.4rem;
      padding: 0 1rem;
    }

    textarea.form-control {
      border-radius: 1.1rem;
      line-height: 1.2rem;
      padding: 0.5rem 1rem;
    }
  }

  .header-panel {
    position: relative;
    font-size: 1.3rem;
    margin-bottom: 0.25rem;

    .btn-icon {
      font-size: 1.3em;
      line-height: 1.2em;
      height: 1em;

      &.btn-close,
      &.btn-settings {
        float: right;
      }

      i {
        vertical-align: middle;
      }
    }
  }

  .logo {
    background: url("../img/logo.svg") 50% 1rem no-repeat;
    background-size: 11.5rem;
    flex: 0 0 17.5rem;
  }

  .lookahead-container {
    display: flex;
    flex-direction: row;
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    white-space: nowrap;

    .lookahead,
    .measure {
      margin: auto 0;
      z-index: 60;
      color: $colour-link;
      background-color: transparent;
      cursor: pointer;
      @include css-prefix(user-select, none);
    }

    .measure {
      visibility: hidden;
    }
  }

  .margin-bottom-0 {
    margin-bottom: 0 !important;
  }

  .overlay {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(8, 48, 57, 0.5);
    @include animation-fade-in();
    @include animation-fade-out();
  }

  .darker-overlay {
    @extend .overlay;
    background-color: rgba(8, 48, 57, 0.9) !important;
  }

  .progress-bar-success {
    background-color: $colour-success !important;
  }

  .progress-bar-warning {
    background-color: $colour-warning !important;
  }

  .progress-bar-danger {
    background-color: $colour-danger !important;
  }

  .service-message {
    padding: 1px;
    overflow-y: auto;
    font-style: italic;
    quotes: "\201c""\201d";
    text-align: center;

    &:before {
      content: open-quote;
    }

    &:after {
      content: close-quote;
    }
  }

  .spinner-border {
    animation-duration: 1s;
    @include spinner-colour($colour-link-highlight);
  }

  .text-success {
    color: $colour-success !important;
  }

  .text-warning {
    color: $colour-warning !important;
  }

  .text-danger {
    color: $colour-danger !important;
  }

  .validation {
    font-size: 0.75rem;
    line-height: 1.15rem;
    position: absolute;
    left: 50%;
    transform: translate(-50%, -50%);
    white-space: nowrap;
    color: #fff;
    background: $colour-danger;
    padding: 0 0.5rem;
    z-index: 60;
    border-radius: $border-radius-input;
  }

  .view {
    height: 100%;
    width: 100%;
    @include animation-fade-in();

    .view-content {
      display: flex;
      flex-direction: column;
      padding: 0.75rem;
    }
  }

  .well {
    background-color: $colour-text1;
    color: $colour-text2;
    border-radius: $border-radius-well;
    border: none;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    @include box-shadow;

    a {
      border-bottom-color: $colour-text2;

      &:active {
        color: $colour-link-highlight !important;
        border-bottom-color: $colour-link-highlight !important;
      }

      &:focus,
      &:hover {
        color: $colour-link-highlight;
        border-bottom-color: $colour-link-highlight;
      }
    }

    &.dark {
      background-color: $colour-text2;
      color: $colour-text1;

      a {
        border-bottom-color: $colour-text1;

        &:active,
        &:focus,
        &:hover {
          border-bottom-color: inherit;
        }
      }
    }

    h4 {
      text-align: center;
    }

    .btn.btn-default {
      color: $colour-text2;
      border-color: $colour-text2;
      font-weight: normal;
      border-width: 0.1rem;
      margin-top: 0.5rem;
      margin-bottom: 0.5rem;

      &:not([disabled]):active {
        background-color: $colour-text2 !important;
        color: $colour-link-highlight !important;
        border-color: $colour-text2 !important;
      }

      &:not([disabled]):hover {
        background-color: $colour-text2;
        color: $colour-link-highlight;
        border-color: $colour-text2;
      }

      &[disabled] {
        border-color: $colour-text2;
        color: $colour-text2;
      }
    }

    .confirm {
      margin-bottom: 0;
      width: 100%;

      button {
        margin-right: 0.5rem;

        &:last-child {
          margin-right: 0;
        }
      }
    }

    .form-group {
      &.has-error {
        input,
        textarea {
          &.form-control {
            border-color: $colour-danger !important;
            color: $colour-danger !important;
            @include placeholder {
              color: $colour-danger !important;
              opacity: 0.8 !important;
            }
          }
        }
      }

      input,
      textarea {
        &.form-control {
          border: 1px solid $colour-text2 !important;
        }
      }
    }
  }
}

#bookmark-panel {
  & > div {
    display: flex;
    flex-flow: column;
  }

  input[type="text"] {
    width: 100%;
    text-overflow: ellipsis;
  }

  #bookmarkForm {
    display: flex;
    flex-flow: column;
    height: 100%;
  }

  .btn-delete-bookmark {
    background-color: $colour-danger;

    &:not([disabled]):active,
    &:not([disabled]):hover {
      background-color: $colour-text1;
      color: $colour-danger;
      border-color: $colour-text1;
    }
  }

  .buttons,
  .form-group,
  .header-panel {
    flex: none;
  }

  .mobile-landscape {
    overflow: hidden;
    margin-bottom: 1rem;
  }

  .tags-container {
    height: calc(100% - 3.1rem);
    overflow: auto;
    margin-bottom: 0;
    margin-top: 1rem;

    .badge {
      display: inline-flex;
      align-items: center;
      margin: 0 0.5rem 0.5rem 0;
      color: rgba($colour-text1, 0.9);
      background-color: $colour-text2;
      border: 0;
      font-size: 0.85rem;
      font-weight: normal;
      line-height: 1.2rem;
      max-width: 99%;

      &:active {
        i {
          color: $colour-link-highlight !important;
        }
      }

      &:hover,
      &:focus {
        cursor: pointer;

        i {
          color: $colour-link-highlight;
        }
      }

      i {
        transition: color ease-in-out 0.2s;
        color: $colour-link;
      }

      span {
        margin-right: 0.3rem;
        @include text-overflow-ellipsis;

        &:hover {
          color: inherit;
        }
      }
    }
  }

  .tags-input-container {
    border-radius: $border-radius-input;
    background-color: $colour-text1;
    overflow: hidden;
    margin-bottom: 0;

    input {
      text-transform: lowercase;
      position: relative;
      z-index: 50;
      background: transparent;
    }

    .lookahead-container {
      top: 0;
      left: 1rem;

      .lookahead,
      .measure {
        text-transform: lowercase;
      }
    }
  }

  .textarea-container {
    flex: 1 0 10rem;
    display: flex;
  }
}

#login-panel {
  form {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;

    .form-content {
      position: relative;
      height: 100%;
      width: 100%;
      display: flex;
      justify-content: center;

      & > div {
        position: absolute;
        top: 0;
        width: 100%;
        z-index: 10;
      }
    }
  }

  .btn-new-sync {
    text-transform: capitalize;
  }

  .btn-show-password {
    &:before {
      position: absolute;
      top: 50%;
      margin: auto;
      transform: translate(-50%, -50%);
      transition: opacity ease-in-out 0.2s;
      @include icon("\f715");
    }

    &.active:before {
      opacity: 0;
    }
  }

  .btn-validating {
    background-color: $colour-text1;
    border-color: $colour-text1;
    color: $colour-bg2;
    opacity: 1;

    .spinner-border-sm {
      border-color: $colour-bg2;
      border-right-color: transparent;
      height: 0.9rem;
      width: 0.9rem;
    }
  }

  .confirm {
    margin-bottom: 0;
    z-index: 10;
  }

  .form-content,
  .selected-service {
    a {
      &:active,
      &:focus,
      &:hover {
        color: $colour-text2;
        border-bottom-color: $colour-text2;
      }
    }

    .confirm {
      @extend .well;
    }
  }

  .form-group {
    input {
      width: 100%;
      font-family: $font-stack-code;
      line-height: 1.45rem;
      padding: 0.5rem 0.8rem;
      border: 1px solid $colour-text1;
      @include placeholder {
        font-family: $font-stack-regular;
        font-size: 1.1rem;
      }

      &[name="newServiceUrl"] {
        font-family: $font-stack-regular;
        font-size: 1.1rem;
      }
    }
  }

  .header-panel {
    z-index: 10;
  }

  .login-form-existing,
  .login-form-new,
  .update-service-panel {
    height: 100%;
    max-width: 22rem;
  }

  .login-form-existing {
    input[name="txtPassword"] {
      padding-right: 2.7rem;
    }
  }

  .login-form-new {
    input[name="txtPassword"] {
      position: relative;
      z-index: 20;
      background: transparent;
    }
  }

  .secret-form-group {
    margin-bottom: 1.5rem;

    .progress,
    .progress-bar-background {
      position: absolute;
      top: 0;
      font-size: 1.2rem;
      height: 100%;
      width: 100%;
      border-radius: $border-radius-input;
    }

    .progress {
      background-color: transparent;
      border: solid 0.1rem $colour-text1;
      z-index: 10;

      .progress-bar {
        background-color: $colour-danger;
      }
    }

    .progress-bar-background {
      background-color: $colour-text1;
    }
  }

  .selected-service {
    display: inline-flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 0.75rem;

    a {
      @include text-overflow-ellipsis;
    }

    label {
      white-space: nowrap;
      flex: 0 0;
      margin: 0 0.3rem 0 0;
    }

    .service-status {
      position: relative;
      margin-left: 0.25rem;
      top: 0.1rem;

      .loading .spinner-border {
        border-color: $colour-text1;
        border-right-color: transparent;
      }

      .status-background {
        position: absolute;
        top: 0.2rem;
        left: 0.1rem;
        height: 0.8rem;
        width: 0.8rem;
        z-index: -1;
        border-radius: 100%;
        background-color: $colour-text1;
      }
    }
  }

  .toggle-form {
    text-align: center;
    margin-top: 1.5rem;
  }

  .update-service-panel {
    .service-info {
      position: absolute;
      bottom: 0;
      width: 100%;

      ul {
        list-style: none;
        padding: 0;
        margin: 0 1rem 0.75rem;

        li {
          position: relative;
          padding-left: 40%;
          @include text-overflow-ellipsis;

          label {
            position: absolute;
            left: 0;
            font-weight: bold;
            margin-bottom: 0;
            color: $colour-text2 !important;
          }
        }
      }

      .service-message {
        max-height: 5rem;
        margin: 0 1rem 1rem;
      }

      .service-warning {
        font-size: 0.9rem;
        line-height: 1.2rem;
      }
    }
  }
}

#search-panel {
  .view-content {
    display: flex;
    flex-flow: column;
    padding: 0;

    .bookmark-list {
      .bookmark {
        border: none;
        border-radius: $border-radius-well;
        padding: 0;
        margin: 0 0 0.75rem;
        max-height: 25rem;
        overflow: hidden;
        transition: max-height 1s cubic-bezier(0, 1, 0, 1);
        position: relative;
        @include box-shadow;

        &:focus,
        &:hover {
          & > .bookmark-content {
            background-color: saturate(lighten($colour-bg2, 30%), 15%);
          }
        }

        &:hover {
          cursor: pointer;

          & > .btn-edit-bookmark {
            opacity: 0.4;
          }
        }

        &.folder {
          color: $colour-text1;
          box-shadow: none;
          transition: background-color ease-in-out 0.2s;
          max-height: none;

          &:hover {
            cursor: default;
          }

          &.open {
            & > .bookmark-content > .bookmark-heading {
              margin-bottom: 0.75rem;

              &:before {
                @include icon("\f07c");
              }

              &:hover:after {
                @include icon("\f106");
              }
            }
          }

          & > .bookmark-content {
            padding: 0.5rem 1rem;
            background-color: rgba($colour-text2, 0.3);

            & > .bookmark-heading {
              color: $colour-text1;
              padding-left: 1.75rem;

              &:before {
                position: absolute;
                left: 1rem;
                @include icon("\f07b");
              }

              &:after {
                position: absolute;
                right: 1rem;
                opacity: 0;
                font-size: 1.3em;
                color: $colour-link-highlight;
                @include icon("\f107");
              }

              &:hover {
                cursor: pointer;

                &:not(.opening):after {
                  opacity: 0.6;
                }
              }
            }

            .empty {
              margin: 0.25rem 0 0;
              text-align: center;
              font-style: italic;
            }

            .spinner-border {
              position: absolute;
              right: 1rem;
              top: 0;
              bottom: 0;
              margin: auto;
              opacity: 0.6;
            }
          }
        }

        &.ng-leave.ng-leave-active {
          margin-bottom: 0;
          max-height: 0;
          opacity: 0;
        }

        &.separator {
          height: 0.5rem;
          background-color: rgba($colour-text2, 0.15);
          box-shadow: none;

          &:hover {
            cursor: default;
          }
        }

        .bookmark-content {
          background-color: $colour-text1;
          border-radius: $border-radius-well;
          padding: 0.5rem 1rem 0.75rem;
          transition: background-color ease-in-out 0.2s;

          .bookmark-heading {
            color: $colour-text2;
            font-size: 1.2rem;
            font-weight: normal;
            line-height: 1.75rem;
            margin-bottom: 0;
            margin-right: 1.5rem;
            transition: color ease-in-out 0.2s;
            @include text-overflow-ellipsis;
          }

          .bookmark-text {
            color: $colour-text2;

            .description {
              font-size: 0.9rem;
              font-style: italic;
              line-height: 1.15rem;
            }

            .url {
              font-size: 0.85rem;
              color: $colour-link;
              white-space: nowrap;
              overflow: hidden;
              text-overflow: ellipsis;
              width: 100%;
            }
          }
        }

        .btn-edit-bookmark {
          position: absolute;
          top: 0.5rem;
          right: 1rem;
          font-size: 1.1rem;
          opacity: 0;

          &:hover {
            opacity: 1;
          }
        }

        .menu {
          position: absolute;
          width: 100%;
          height: 100%;
          display: flex;
          align-items: center;
          justify-content: space-evenly;
          background-color: rgba($colour-text2, 0.8);
          text-align: center;
          border-radius: $border-radius-well;
          z-index: 60;
          @include css-prefix(user-select, none);

          button {
            position: static;
            background-color: $colour-text1;
            color: $colour-text2;

            &.btn-delete-bookmark {
              color: $colour-danger;
            }
          }
        }
      }
    }

    .bookmark-tree-panel,
    .search-results-panel {
      flex: 0 1 100%;
      overflow: auto;
      padding: 0 0.75rem;

      & > h4 {
        font-size: 1.4rem;
        font-weight: normal;
        text-align: center;
      }
    }

    .header-panel {
      flex: none;
      margin-bottom: 0;
      padding: 0.75rem;

      .btn {
        &.btn-icon {
          margin-left: 0.5rem;
        }

        &.btn-toggle-bookmark {
          &.active {
            i {
              font-weight: 900;
            }
          }
        }
      }

      .search-form {
        flex: 0 1 100%;
        position: relative;
        border-radius: $border-radius-input;
        background-color: $colour-text1;
        margin-bottom: 0;

        label {
          position: absolute;
          top: 50%;
          left: 0.75rem;
          font-size: 0.85em;
          margin-top: -0.5em;
          margin-bottom: 0;
          color: $colour-link;
          z-index: 60;
        }

        input {
          position: relative;
          z-index: 50;
          padding: 0 1.5em;
          font-size: 1.1em;
          background: transparent;
          width: 100%;
          line-height: 1.5em;
          border: none;
          @include placeholder {
            color: $colour-link;
          }
        }

        .btn-clear {
          height: 1.7em;
          width: 1.7em;
          margin-top: -0.85em;
          font-size: 0.7em;
          line-height: 1.5em;
        }

        .lookahead-container {
          font-size: 1.1em;
          top: 0;
          left: 1.5em;
          width: calc(100% - 3em);
        }
      }
    }

    .search-results-panel {
      &.ng-hide {
        margin-top: 0;
      }
    }
  }
}

#settings-panel {
  a {
    border-bottom-color: $colour-text2;

    &:active,
    &:focus,
    &:hover {
      border-bottom-color: inherit;
    }
  }

  .about-panel {
    .buttons {
      display: flex;
      flex-direction: column;
      align-items: center;
      margin-top: 0.5rem;

      button {
        margin-right: 0;

        &#support {
          text-transform: none;
        }
      }
    }
  }

  .backup-restore-panel {
    #restoreForm {
      input[type="text"] {
        padding-right: 2rem;
      }

      textarea {
        height: 12rem;
        font-family: $font-stack-code;
        font-size: 0.8rem;
      }

      .form-group {
        margin-bottom: 0.4rem;
      }

      .spinner-border {
        position: absolute;
        right: 0.75rem;
        top: 0.6rem;
      }
    }
  }

  .header-panel,
  .panel-container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .header-panel {
    flex: none;
  }

  .panel-container {
    overflow-y: auto;
  }

  .setting-group {
    @extend .form-group;

    label {
      margin-bottom: 0.25rem;
    }

    p {
      font-size: 0.95rem;
    }

    #backupLink {
      font-size: 0.9rem;
    }

    .description {
      color: $colour-link;

      a {
        border-bottom-color: $colour-link;

        &:active,
        &:focus,
        &:hover {
          border-bottom-color: inherit;
        }
      }
    }

    .setting-value {
      position: absolute;
      top: 0;
      right: 0;
      height: auto;
      width: auto;
      padding: 0;
      color: $colour-text2;
      border: 0;
      border-radius: 0;
      background: transparent;
      transition: none;
    }
  }

  .sync-panel {
    .id-url {
      position: relative;
      display: block;
      text-align: center;
      width: 100%;
      margin-bottom: 0.5rem;
      font-family: $font-stack-code;
      font-size: 0.92rem;
    }

    .progress {
      height: 0.45rem;
      border-radius: 1rem;
      background-color: $colour-text2;
      overflow: visible;
      margin: 0.25rem 0 1.5rem;

      .progress-bar {
        background-color: $colour-bg2;
        transition: none;
        border-bottom-left-radius: 1rem;
        border-top-left-radius: 1rem;
      }
    }

    .max,
    .used {
      font-size: 0.8rem;
      position: absolute;
      margin-top: -1.5rem;
    }

    .max {
      right: 0;
      color: $colour-text2;
    }

    .used {
      color: $colour-bg2;
      left: 0;
    }

    .service-message {
      max-height: 7rem;
    }

    .status-text {
      color: $colour-link;
    }

    .service-url {
      position: relative;
      display: flex;
      justify-content: center;
      margin-bottom: 0.5rem;

      & > a {
        @include text-overflow-ellipsis;
      }

      .service-status {
        font-size: 0.9rem;
        padding-left: 0.4rem;
        margin-top: 0.1rem;
      }
    }

    .updates-available {
      @extend .description;
      font-size: 0.9rem;
      text-align: center;
      font-style: italic;
    }
  }

  .view-content {
    padding: 0.75rem 0 0;
  }

  .well {
    padding: 0;
    overflow: hidden;

    h4 {
      padding: 0.75rem 1rem;
      margin-bottom: 0;
    }

    .btn.btn-default {
      font-size: 1.1rem;
      line-height: 2.3rem;
    }

    .panel-content {
      padding: 0 1.25rem;
    }
  }
}

#information-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(8, 48, 57, 0.5);
  overflow: hidden;

  h4 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    line-height: 1.8rem;
  }

  p,
  ul {
    font-size: 1.1rem;
    line-height: 1.4rem;
  }

  ul {
    margin-bottom: 0.75rem;
    padding-left: 1rem;
  }

  .buttons {
    margin-top: 1rem;

    &.small {
      .btn {
        font-size: 1rem;
        line-height: 2.1rem;
        padding: 0 0.5rem;
      }
    }
  }

  .view-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem;
  }
}

#help-panel {
  .pagination {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;

    a {
      position: relative;

      &.next-link {
        margin-right: 0.5rem;

        span:after {
          content: "\203A";
          position: absolute;
          right: -0.5rem;
        }
      }

      &.prev-link {
        margin-left: 0.5rem;

        span:before {
          content: "\2039";
          position: absolute;
          left: -0.5rem;
        }
      }
    }
  }
}

#qr-panel {
  @extend .darker-overlay;
  flex-direction: column;
  padding: 2rem;

  p {
    text-align: center;
    margin-bottom: 1rem;
  }

  .buttons {
    margin-top: 0;

    button {
      display: block;
      margin: 1rem auto 0;
    }
  }

  #qr {
    height: 14rem;
    width: 14rem;
    margin-bottom: 1rem;
  }
}

#support-panel {
  h4 {
    margin-bottom: 1rem;
  }

  p,
  ul {
    font-size: 1rem;
    line-height: 1.25rem;
  }

  .buttons.small {
    margin: 0.5rem 0 1rem;
  }
}

#updated-panel {
  .buttons button {
    display: block;
    margin: 0 auto 1rem;
  }
}

#working-panel {
  @extend .overlay;

  h3 {
    @extend .ellipsis;

    color: $colour-link-highlight;
    font-size: 1.1rem;
    margin: 0.2rem;
  }

  .buttons {
    position: absolute;
    height: 50vh;
    width: 50vw;
    display: flex;
    align-items: flex-end;
    justify-content: center;

    .button {
      position: absolute;
    }
  }

  .spinner-border {
    position: absolute;
    width: 30vw;
    height: 30vw;
  }
}

#scan-panel {
  h3 {
    font-size: 1rem;
    text-align: center;
    margin: 1rem 0 0;
  }

  .buttons {
    flex: 0 8rem;

    button {
      margin-right: 1.75rem;
      background-color: $colour-text1;
      color: $colour-text2;

      &:last-child {
        margin-right: 0;
      }

      &.btn-delete-bookmark {
        background-color: $colour-danger;
      }

      &.enabled {
        color: $colour-warning;
      }
    }
  }

  .target {
    background: url("../img/scan.svg") 50% 50% no-repeat;
    flex: 1;
    width: 14rem;
    height: 14rem;
    opacity: 0.5;

    &.error {
      background-image: url("../img/scan_error.svg");
    }
  }

  .validation {
    position: absolute;
    top: 50%;
    margin-top: -2.5em;
    font-size: 1rem;
    padding: 0.25em 1em;
  }

  .view-content {
    align-items: center;
  }
}
