@use 'sass:math';
@use 'variables' as *;
$sm-mobile: 575.98;
$mobile: 767.98;
$medium-mobile: 375;
$tablet: 991.98;
$desktop: 1199.98;
$lg-desktop: 1399.98;

// Small mobiles (landscape phones, less than 576px)
@mixin sm-mobile() {
  @media only screen and (max-width: ($sm-mobile * 1px)) {
    @content;
  }
}

// Small devices (landscape phones, less than 768px)
@mixin mobile {
  @media only screen and (max-width: ($mobile * 1px)) {
    @content;
  }
}

// Medium mobiles (phones, less than 375px)
@mixin medium-mobile() {
  @media only screen and (max-width: ($medium-mobile * 1px)) {
    @content;
  }
}

// Medium devices (tablets, less than 992px)
@mixin tablet {
  @media only screen and (max-width: ($tablet * 1px)) {
    @content;
  }
}

// Large devices (desktops, less than 1200px)
@mixin desktop {
  @media only screen and (max-width: ($desktop * 1px)) {
    @content;
  }
}

// X-Large devices (large desktops, less than 1400px)
@mixin lg-desktop {
  @media only screen and (max-width: ($lg-desktop * 1px)) {
    @content;
  }
}

@include export-module('smartpdfviewer-theme') {
  /* stylelint-disable value-no-vendor-prefix */
  /* stylelint-disable property-no-vendor-prefix */
  .e-control.e-smart-pdfviewer {
    min-height: $spv-height-500;
    position: relative;

    .e-pv-pdfviewer-container {
      width: $spv-width-p100;
      height: $spv-height-p100;
      float: left;
    }

    .e-spv-smart-assistanceview + .e-dlg-container .e-popup.e-control.e-popup-open {
      .e-footer-content button {
        @if $skin-name=='Material3' {
          border-radius: $spv-radius-20;
        }
      }

      .e-dlg-header-content .e-btn.e-dlg-closeicon-btn {
        @if $skin-name=='highcontrast' {
          padding-top: $spv-spacing-0 !important;/* stylelint-disable-line declaration-no-important */
        }
      }
    }

    .e-spv-smart-assistanceview {
      width: $spv-width-p100;
      height: $spv-height-p100;

      .e-aiassistview .e-view-container {
        width: $spv-width-95p;

        .e-spv-assist-view-banner-content {
          width: $spv-width-p100;
          height: $spv-height-240;
          font-size: $spv-text-sm;
          display: flex;
          flex-direction: column;
          align-items: center;
          justify-content: center;
          margin-bottom: $spv-spacing-56;

          .e-assistview-icon::before {
            font-size: $spv-font-icon-32;
          }
        }
      }

      .e-aiassistview .e-footer {
        margin-bottom: $spv-spacing-12;
        margin-top: $spv-spacing-12;
        width: $spv-width-95p;
      }
    }
    
    .e-aiassistview {
      border: none;
    }

    .e-spv-smart-assistanceview-mobile {
      width: $spv-width-p100;
      position: absolute;
      z-index: 1001;
      margin-left: $spv-spacing-0;
      top: 0;
    }

    // .hide-initial-prompt #e-prompt-item_0 {
    //   display: none;
    // }

    .ai-disclaimer {
      font-size: $spv-text-xxs;
      color: $spv-assit-disclaimer-color;
      margin-bottom: $spv-spacing-4;
      text-align: center;
    }

    .e-aiassistview .e-output-icon {
      margin-left: $spv-spacing-0;
    }

    .e-smart-pdfviewer .e-spv-smart-assistanceview .e-aiassistview .e-views::-webkit-scrollbar,
    .e-aiassistview .e-custom-view::-webkit-scrollbar,
    .e-smart-pdfviewer .e-spv-smart-assistanceview .e-aiassistview .e-assistview-content-section::-webkit-scrollbar {
      width: $spv-width-3;
    }

    .e-views,
    .e-custom-view,
    .e-smart-pdfviewer .e-spv-smart-assistanceview .e-aiassistview .e-assistview-content-section {
      &::-webkit-scrollbar-thumb {
        background: $scrollbar-color;
      }
    }

    .e-control.e-smart-pdfviewer {
      &.e-views,
      &.e-custom-view,
      &.e-smart-pdfviewer .e-spv-smart-assistanceview .e-aiassistview .e-assistview-content-section {
        &::-webkit-scrollbar-track {
          background: $scrollbar-background-color;
        }
      }
    }

    .e-aiassistview .e-view-header {
      display: none;
    }
    
    .e-aiassistview .e-view-content {
      height: $spv-height-p100;
    }

    .e-spv-block {
      display: block;
    }

    .e-spv-none {
      display: none;
    }
    
    .e-spv-smart-redcatview {
      width: $spv-width-p100;
      height: $spv-height-p100;

      .e-spv-redact-options,
      .e-spv-redact-patterns {
        height: $spv-height-p100;
        overflow: auto;
      }

      // .e-spv-redact-patterns .e-icons.interaction.e-icon-collapsible {
      //   display: none !important;/* stylelint-disable-line declaration-no-important */
      //   cursor: unset !important; /* stylelint-disable-line declaration-no-important */
      // }

      // .e-spv-redact-patterns .e-icons.interaction.e-icon-expandable {
      //   display: none !important;/* stylelint-disable-line declaration-no-important */
      //   cursor: unset !important; /* stylelint-disable-line declaration-no-important */
      // }

      .e-spv-redact-container {
        width: $spv-width-p100;
        height: $spv-height-p100;
        padding-left: $spv-spacing-0;
        padding-right: $spv-spacing-0;
        display: flex;
        flex-direction: column;
        flex: 1;
        overflow: hidden;

        .e-spv-pattern-tree-view .e-list-item .e-checkbox-wrapper {
          pointer-events: none;
        }
      }

      .e-treeview .e-list-item {
        @if $skin-name == 'bootstrap5' {
          padding: $spv-spacing-0;
        }
        padding: $spv-spacing-2 $spv-spacing-0;
        white-space: unset !important;/* stylelint-disable-line declaration-no-important */
      }

      .e-treeview .e-list-text {
        width: $spv-width-fit;
        @if $skin-name=='tailwind' {
          line-height: $spv-line-height-40;
        }
      }

      .e-treeview{
        border: none;
        @if $skin-name == 'tailwind3' {
          background: none;
        }
      }

      .e-spv-button-container {
        padding: $spv-spacing-14;
        text-align: center;
        border-top: $spv-border-1 solid;
        border-color: $spv-control-border-color;
      }
      .e-spv-scan-button,
      .e-spv-redact-btn {
        height: $spv-redact-btn-height;
        @if $skin-name == 'bootstrap5.3' {
          line-height: $spv-line-height-24;
        }
      }
      .e-spv-scan-button {
        width: $spv-width-198;
        border: none;
        font-size: $spv-text-base;
        @if ($skin-name == 'highcontrast' or $skin-name == 'fabric' or $skin-name == 'fabric-dark') {
          border-radius: $spv-radius-0;
        }
        @else if ($skin-name == 'tailwind3') {
          border-radius: $spv-radius-6;
        }
        @else if ($skin-name == 'material' or $skin-name == 'material-dark') {
          border-radius: $spv-radius-2;
        }
        @else {
          border-radius: $spv-radius-4;
        }
      }

      .e-spv-redact-button-container {
        padding: $spv-spacing-14 $spv-spacing-0 $spv-spacing-0;
        text-align: center;
        border-top: $spv-border-1 solid;
        border-color: $spv-control-border-color;
        display: flex;
        justify-content: center;
        gap: $spv-redact-btn-gap;
      }

      .e-spv-spinner-redact {
        right: 12.5%;
        top: 50%;
      }

      .e-spv-blur-container {
        position: absolute;
        background-color: rgba($spv-redact-background-color, .3);
        width: $spv-width-p100;
        height: $spv-height-p100;
      }

      .e-spv-redact-body {
        padding: $spv-spacing-0;
        height: $spv-height-p100;
        display: flex;
        flex-direction: column;
      }

      .e-spv-redact-btn {
        width: $spv-width-96;
        padding: $spv-spacing-0 !important;/* stylelint-disable-line declaration-no-important */
        font-size: $spv-text-sm !important;/* stylelint-disable-line declaration-no-important */
      }

      .e-spv-smart-redactview-mobile {
        width: $spv-width-p100;
        position: absolute;
        z-index: 1001;
        margin-left: $spv-spacing-0;
        top: 0;
      }
    }
    
    .e-toolbar-item .e-tbar-btn-text.e-spv-smartfill-text {
      display: inline-block;
      font-weight: normal;
      @if $skin-name == 'material' or $skin-name == 'material-dark' {
        padding-top: $spv-spacing-2;
      }
    }

    .e-toolbar-pop .e-toolbar-item .e-tbar-btn.e-btn {
      justify-content: flex-start;
    }

    .e-toolbar-item .e-btn.e-spv-btn {
      align-items: center;
      justify-content: center;
      height: $spv-height-32;
      text-decoration: none;
      @if $skin-name == 'highcontrast' {
        padding: $spv-spacing-0 $spv-spacing-12;
      }
      @else if $skin-name == 'tailwind' or $skin-name == 'tailwind-dark' or $skin-name == 'tailwind3' or $skin-name == 'fabric' or $skin-name == 'fabric-dark'  {
        padding: $spv-spacing-0 $spv-spacing-8;
      }
    }

    .e-toolbar .e-toolbar-item.e-overlay .e-icons{
      @if $skin-name == 'material' or $skin-name == 'material-dark'{
        font-size: $spv-text-base;
        width: $spv-width-2em;
      }
      @if $skin-name == 'Material3'{
        margin-bottom: $spv-spacing-4;
      }
    }

    .e-spv-smart-paste-icon {
      font-size: $spv-text-base !important;/* stylelint-disable-line declaration-no-important */
      @if $skin-name == 'Material3' {
        font-size: $spv-text-lg !important;/* stylelint-disable-line declaration-no-important */
      }
    }
  }
  
  .e-pv-mobile-view.e-smart-pdfviewer .e-pv-modern-side-panel-template-content {
    position: relative;
  }

  .e-pv-toolbar.e-toolbar:not(.e-rtl) .e-toolbar-pop .e-toolbar-item .e-tbar-btn.e-btn .e-spv-smart-paste-icon {
    padding: $spv-toolbar-popup-icon-padding;
  }

  .e-pv-toolbar.e-toolbar .e-toolbar-items .e-toolbar-item .e-tbar-btn.e-btn .e-icons.e-spv-smart-paste-icon.e-btn-icon {
    @if $skin-name == 'bootstrap5' or $skin-name == 'bootstrap5.3' or $skin-name=='FluentUI' {
      padding-left: $spv-spacing-4;
      line-height: $spv-line-height-16;
    }
    @if $skin-name=='FluentUI' {
      padding-bottom: $spv-spacing-0;
    }
  }
}
