// File viewer container


// file viewer
.x-file-viewer {

  // MODIFIERS
  // layout full/aside
  &-full {
    @extend %layout-column,
    %overflow-hidden;

    // Set to remove extra white-spaces around the file preview area
    // .x-file-viewer-content, .layout-column
    .x-file-viewer-content, .layout-column {
      padding: 0 !important;
    }

    .btn.close {
      display: none;
    }

    .modal-title {
      @extend %text-truncate;
      @extend %w-100;
      padding: 0 !important;
    }
  }
  &-aside {
    @extend %layout-aside;
  }

  // TOOLBAR
  // toolbar ribbon for full doc viewer
  &-toolbar {
    @extend %d-flex,
            %flex-column,
            %align-items-center,
            %p-2,
            %p-md-3;

    @include custom-theme-color(primary, background-color);
    color: theme-color('light');

    a {
      color: theme-color('light');
      font-weight: $font-weight-bold;
    }

    p {
      @extend %mb-1,
              %mb-md-2;

      color: theme-color('primary-lighter');
    }
  }

  // CONTENT
  &-content {
    @extend %p-0;
  }

  // POWERED BY
  // Powered by lawconnect logo
  &-powered {
    width: 8.125rem;
    bottom: 2.5rem;
    right: 2rem;

    @include x-media-orientation(portrait) {
      width: 7.5rem;

      @include media-breakpoint-down(sm) {
        bottom: 7rem;
      }
    }
    @include x-media-orientation(landscape) {
      @include media-breakpoint-only(xs) {
        width: 6.25rem;
      }
      @include media-breakpoint-between(xs,sm) {
        right: 1rem;
      }
      @include media-breakpoint-between(sm,md) {
        width: 6.875rem;
      }
    }

    @include media-breakpoint-down(md) {
      bottom: 7rem;
      right: 1.5rem;
    }

    @include media-breakpoint-between(sm, md) {
      right: 3rem;
    }

    height: auto;
    position: fixed;
    background-color: transparent;

    > img {
      position: relative;
      z-index: 1;
    }

    &:after {
      content: '';
      display: block;
      position: absolute;
      left: 0;
      right: 0;
      top: calc(50% - 0.25rem);
      height: 0.5rem;
      background-color: rgba(253, 253, 253, 0.98);
      z-index: 0;
      border-radius: 10rem;
      opacity: 0.8;
      @include box-shadow(0 0 0.4375rem 0.8125rem rgba(253, 253, 253, 1));
    }
  }

  // PROMPT
  // File viewer messages/info
  &-prompt {
    text-align: center;

    p {
      @include media-breakpoint-down(md) {
        line-height: 1.2;
        font-size: 85%;
      }
    }
  }

  &-prompt-title {
    font-weight: $font-weight-medium;
    @include media-breakpoint-down(md) {
      line-height: 1.2;
      font-size: 1rem;
    }
  }
}

.x-file-viewer-container {
  @extend %x-flex-center,
          %overflow-auto,
          %position-relative,
          %bg-light-transparent,
          %h-100;

  > * {
    @extend %pt-3,
            %w-100;
  }
}

// CONTROLS
// File viewer controls
.x-file-viewer-controls {
  @extend %mb-2,
          %px-2,
          %d-flex,
          %position-relative,
          %overflow-hidden,
          %bg-info,
          .x-rounded-lg;

  @include box-shadow(0 0.125rem 0.1875rem rgba(0, 0, 0, 0.2));

  &-wrapper {
    @extend %w-100,
            %d-flex,
            %position-absolute,
            %justify-content-center,
            %pb-2;
    bottom: 0;
  }

  &-group {
    @extend %d-flex,
            %justify-content-center;
  }
}

.x-file-viewer-control-text {
  @extend %d-flex,
          %text-white,
          %align-items-center,
          %cursor-default,
          %text-noselect;
  width: 3rem;
}

.x-file-viewer-control-btn {
  @extend %btn,
          %btn-info,
          %x-btn-icon-only-md,
          .x-no-focus,
          %border-0,
          %cursor-pointer;

  @include media-breakpoint-up(lg) {
    @extend %x-btn-icon-only-md,
  }

  @include x-no-hover-focus-active {
    .x-icon {
      opacity: .8;
    }
  }

  .x-file-viewer-control-text & {
    @extend %btn-dark,
    %p-1;
  }

  &:disabled {
    opacity: 0.5;
    @extend %cursor-not-allowed;
  }

  @include border-radius(0,0);
}

.x-file-viewer-control-btn-link {
  @extend %btn,
          %btn-link,
          %x-btn-icon-only-lg,
          %text-white,
          %x-no-focus;

  @include x-no-hover-focus-active {
    opacity: .8;
    text-decoration: none;
  }
}

.x-file-viewer-control-input {
  @extend %text-center,
          %form-control,
          %p-0,
          %border-0;

  @include box-shadow(0 0 0 0.125rem theme-color('dark') inset !important);

  &::-webkit-outer-spin-button,
  &::-webkit-inner-spin-button {
    display: none;
    -webkit-appearance: none;
    margin: 0;
  }

  &[type=number] {
    -moz-appearance:textfield;
  }

  line-height: 1;
  color: theme-color('light') !important;
  background-color: lighten(theme-color('info'), 10%) !important;
}

.x-file-viewer-controls-pagination {
  min-width: 4.5rem;

  .x-file-viewer-control-btn {
    @extend %btn-block,
            %py-1;
    height: 100%;
  }

  .x-file-viewer-control-input {
    @extend %mx-auto,
            %mb-0;
    min-width: 2rem;
    width: auto !important;
    height: auto;
  }

  .x-file-viewer-control-input-group {
    @extend %h-100,
            %py-1,
            %d-inline-flex;
  }

  .x-file-viewer-pagination-total {
    @extend %d-flex;
    min-width: 2.3rem;
    color: white;
    height: 100%;
    justify-content: center;
    align-items: center;
    vertical-align: middle;
  }

  text-align: center;
}
