
$govuk-global-styles: true;

$dpr-images-path: '/assets/dpr/assets/images/';
$govuk-assets-path: '/assets/';
@import 'govuk-frontend/dist/govuk/all';

// Configure MoJ Frontend
$moj-assets-path: '/assets/';
$moj-images-path: '/assets/images/';
@import '@ministryofjustice/frontend/moj/all';

.govuk-width-container {
  max-width: 1170px !important;
}

.drp-reports-heading-container {
  position: relative;
}

.dpr-child-report {
  .govuk-table {
    border: solid 1px govuk-colour('mid-grey');

    th,
    td {
      padding: 10px;
    }
  }
}

.dpr-form--hidden {
  display: none;
}

.dpr-clear-button-styles {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  box-shadow: none;
  color: inherit;
  text-align: inherit;

  appearance: none;
  -webkit-appearance: none;
  border-radius: 0;
  cursor: pointer;

  // Reset interactive states
  &:hover,
  &:focus,
  &:active {
    background: none;
    color: inherit;
    box-shadow: none;
    outline: none;
    transform: none;
    filter: none;
  }

  &:focus-visible {
    outline: none;
  }
}
#dpr-recently-viewed-component,
#dpr-async-request-component,
#dpr-bookmarks-list {
  .govuk-table {
    margin-bottom: 0px;
    width: 100%;
  }

  th.dpr-req-product-head,
  th.dpr-req-name-head {
    width: 25%;
  }
  th.dpr-req-description-head {
    width: 30%;
  }
  th.dpr-bm-description-head {
    width: 50%;
  }
  th.dpr-req-filters-head {
    // width: 25%;
  }
  th.dpr-req-status-head {
    width: 100px;
    width: 9%;
  }
  th.dpr-bm-actions-head {
    width: 30%;
    text-align: right;
  }
  th.dpr-req-actions-head {
    width: 11%;
    text-align: right;
  }
  td.govuk-table__cell {
    vertical-align: top;
    font-size: 16px;
    padding-top: 20px;
    padding-bottom: 20px;
  }
  td.dpr-req-middle-cell {
    vertical-align: top;
  }

  td.dpr-req-cell__type {
    padding-top: 20px;
    min-width: 80px;
  }

  td.dpr-req-cell__status {
    padding-top: 20px;
  }

  tr:last-child {
    td {
      border: none;
    }
  }

  .govuk-table__cell:last-child {
    padding-right: 0px !important;
    text-align: right;
  }
}

#requested-reports-tab,
#recently-viewed-tab,
#my-bookmarks-tab {
  padding-left: 40px;
  padding-right: 40px;
}

.dpr-user-list-action {
  display: block;
}

.dpr-display-none {
  display: none;
}
.dpr-show-more {
  .dpr-show-hide-button {
    display: inline-block;
  }

  .dpr-show-more-content {
    display: inline;
  }
}

ul.dpr-card-group__item__filters-list {
  list-style-type: none;
  padding: 0;
  margin-top: 0px;

  li {
    float: left;
    margin-bottom: 0;
    padding: govuk-spacing(1);
    padding-left: 8px;
    padding-right: 8px;
    margin-bottom: govuk-spacing(1);
    margin-right: govuk-spacing(1);
  }

  li.dpr-query-summary {
    background-color: govuk-colour('light-grey');
  }

  li.dpr-interactive-query-summary {
    background-color: lighten(govuk-colour('light-blue'), 36%);
  }

  li:last-child {
    margin-bottom: govuk-spacing(0);
  }
}
// VARIANT 1 STYLES
.dpr-card-group-v1 {
  .card {
    margin-bottom: 30px;
    background: #fff;
    border: 1px solid #d9dadb;
    position: relative;
    padding: 25px;

    @media(min-width: 769px) and (max-width: 1019px) {
      margin-bottom: 10px;
    }

    @media(max-width: 768px) {
      margin-bottom: 0;
      min-height: 0 !important;
      a, p {
        font-size: 18px !important;
      }
    }
  }

  .card-wrapper {
    position: relative;
    height: 100%;
  }

  .card__heading {
    margin-top: 0;
    margin-bottom: 15px
  }

  .card__description {
    margin-bottom: 0
  }

  .card--clickable {
    border-bottom-width: 5px
  }

  .card--clickable:hover, .card--clickable:active {
    cursor: pointer
  }

  .card--clickable:hover .card__heading a, .card--clickable:hover .card__link, .card--clickable:active .card__heading a, .card--clickable:active .card__link {
    color: #003078;
    text-decoration: none
  }

  .card--clickable:hover .card__heading a:focus, .card--clickable:hover .card__link:focus, .card--clickable:active .card__heading a:focus, .card--clickable:active .card__link:focus {
    outline: 3px solid transparent;
    color: #0b0c0c;
    background-color: #fd0;
    box-shadow: 0 -2px #fd0, 0 4px #0b0c0c;
    text-decoration: none
  }

  .card--clickable:hover {
    border-color: #b1b4b6
  }

  .card--clickable:active {
    border-color: #b1b4b6;
    bottom: -1px
  }
}
// === END VARIANT 1 STYLES ===

// === VARIANT 2 STYLES ===
.dpr-card-group-v2 {
  .dpr-card-group__item {
    min-height: 120px;
    position: relative;

    &:hover {
      cursor: pointer;
    }

    .dpr-card-group__item-header {
      width: calc(100% - 15px);

      a:before {
        content: "";
        display: block;
        height: 8px;
        position: absolute;
        right: 3px;
        top: 29px;
        transform: translateY(0px) rotate(45deg) scale(1);
        width: 8px;
        border-right: 2px solid #0b0c0c;
        border-top: 2px solid #0b0c0c;
      }
    }
  }
}
// === END VARIANT 2 STYLES ===

.dpr-card-group {
  .card-loading {
    pointer-events: none;
  }

  .card-disabled {
    pointer-events: none;
  }

  .card-disabled:hover {
    pointer-events: none;
    border: 1px solid #d9dadb;
    bottom: 0;
  }

  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  column-gap: 30px;
  row-gap: 20px;

  @media(min-width: 769px) and (max-width: 1019px) {
    grid-template-columns: 1fr 1fr;
  }

  @media(max-width: 768px) {
    grid-template-columns: 1fr;

    a,
    p {
      font-size: 16px;
    }
  }
}.dpr-bookmark-link {
  font-size: 16px;
}

.bookmark-disabled {
  pointer-events: none;
  opacity: 0.5;
}
.dpr-report-page {
  .dpr-report-page__heading-container {
    position: relative;
    margin-top: govuk-spacing(5);
    margin-bottom: govuk-spacing(5);
  }
}

.dpr-columns-section-wrapper {
  .govuk-details {
    margin-bottom: 0;
  }
}

@media print {
  .dpr-columns-section-wrapper {
    display: none;
  }

  .dpr-report-page__heading-container {
    h1.govuk-heading-l {
      font-size: 20px;
    }
    p.govuk-body-s {
      font-size: 14px;
    }
  }
}

.dpr-table-container {
  @media screen {
    .print-header-footer,
    .govuk-table__header span,
    .screen-hide {
      display: none;
    }
  }
}

.dpr-report-interactive-actions {
  a.govuk-button {
    margin-top: -10px;
  }
}
.dpr-report-template-container {
  .dpr-report-template__page-totals--footer {
    margin-bottom: govuk-spacing(6);
  }
}
.dpr-report-totals p {
  text-align: right;
  margin-bottom: govuk-spacing(2);
}

@media print {
  .dpr-report-totals p {
    color: govuk-colour("black");
    font-weight: normal;
    text-align: right;
    margin-bottom: govuk-spacing(1);
    font-size: 12px;
  }
}
.dpr-summary-container-group {
  display: flex;
  position: relative;
  row-gap: 15px;
  flex-flow: column wrap;
  margin-top: govuk-spacing(6);

  .dpr-summary-container {
    min-width: 200px;
    width: fit-content;

    .govuk-table {
      border: solid 1px govuk-colour('mid-grey');
      margin-bottom: 0;

      th,
      td {
        padding: 10px;
      }
      th {
        background-color: govuk-colour('light-grey');
        border-bottom: 0px;
      }
    }
  }
}

.dpr-summary-container-group:has(td.govuk-table__cell) {
  border-bottom: 0px;
}

.dpr-summary-container-group-page-header {
  margin-top: govuk-spacing(6);
  margin-bottom: govuk-spacing(4);
}

.dpr-summary-container-group-page-footer {
  margin-bottom: 30px;
}

@media print {
  .dpr-summary-container-group {
    .dpr-summary-container {
      .govuk-table {
        th,
        td {
          padding: govuk-spacing(1);
        }
        th {
          background-color: govuk-colour('light-grey');
          border-bottom: 0px;
        }
      }
    }
  }
}
.dpr-report-section {
  margin-bottom: govuk-spacing(6);

  .dpr-report-section__title {
    position: sticky;
    top: 0;
    background-color: white;
    padding-top: govuk-spacing(2);
    padding-bottom: govuk-spacing(1);
    z-index: 100;
    border-bottom: solid 3px govuk-colour('light-blue');
    margin-bottom: govuk-spacing(6);

    h2.govuk-heading-m {
      margin-bottom: govuk-spacing(1);
    }
  }
}

@media print {
  .dpr-report-section {
    margin-bottom: govuk-spacing(2);

    .dpr-report-section__title {
      border-bottom: solid 2px govuk-colour('mid-grey');
      margin-bottom: govuk-spacing(0);

      h2.govuk-heading-m {
        font-size: 12px;
        .govuk-caption-m {
          font-size: 12px;
        }
      }
    }
  }
}
.dpr-report-section__actions {
  display: flex;

  .dpr-report-section__actions--left-aligned {
    flex: 1;
    text-align: left;
  }
  .dpr-report-section__actions--right-aligned {
    flex: 1;
    text-align: right;
  }
}

@media print {
  .dpr-report-section__actions {
    display: none;
  }
}
// Cannibalised from MoJ sortable table

.dpr-table-container {
  position: relative;

  .dpr-section-header {
    border-bottom: 0px;
    padding-left: govuk-spacing(0);

    &.govuk-table__cell {
      h2 {
        margin-top: 0px;
      }
    }
  }

  .govuk-table__cell {
    h2 {
      background-color: govuk-colour('light-grey');
      padding: govuk-spacing(2);
      padding-left: govuk-spacing(2);
      margin-bottom: govuk-spacing(0);
      margin-top: govuk-spacing(0);
    }
  }

  .dpr-overflow-gradient {
    display: none;
    width: 25px;
    height: 100%;
    background-color: rgba(177, 180, 182, 0.7);
    position: absolute;
    right: 0px;
    top: 0px;
    -webkit-mask-image: linear-gradient(to left, rgba(0, 0, 0, 1), rgba(0, 0, 0, 0));
    -webkit-mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position:
      left top,
      left bottom;
    z-index: 100;
  }

  .data-table-header-button {
    background-color: transparent;
    border-width: 0;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
    -webkit-box-shadow: 0 0 0 0;
    -moz-box-shadow: 0 0 0 0;
    box-shadow: 0 0 0 0;
    color: #005ea5;
    cursor: pointer;
    font-family: inherit;
    font-size: 1em;
    font-weight: inherit;
    margin: 0;
    padding: 0 10px 0 0;
    position: relative;
    text-align: inherit;
    text-decoration: none;
    white-space: nowrap;
  }

  .data-table-header-button-sort-none:before {
    content: ' \25bc';
    position: absolute;
    right: -1px;
    top: 9px;
    font-size: 0.5em;
  }

  .data-table-header-button-sort-none:after {
    content: ' \25b2';
    position: absolute;
    right: -1px;
    top: 1px;
    font-size: 0.5em;
  }

  .data-table-header-button-sort-ascending:after {
    content: ' \25b2';
    font-size: 0.8em;
    position: absolute;
    right: -5px;
    top: 2px;
  }

  .data-table-header-button-sort-descending:after {
    content: ' \25bc';
    font-size: 0.8em;
    position: absolute;
    right: -5px;
    top: 2px;
  }

  .data-table-cell-wrap-none {
    white-space: nowrap;
  }

  .data-table-cell-wrap-normal {
    white-space: normal;
  }

  .data-table-cell-wrap-break-words {
    word-break: break-all;
  }

  .data-table-cell-long-string {
    min-width: 300px;
  }

  #pageSize {
    min-width: 5em;
  }

  .govuk-table__cell--content {
    text-align: center;
  }

  a.disabled {
    pointer-events: none;
    cursor: default;
    opacity: 0.5;
  }

  .pagination {
    overflow: auto;
  }

  .data-table-page-size-container {
    height: 40px;
  }

  .data-table-page-size {
    float: right;

    @media (max-width: 640px) {
      width: 100%;
    }

    @media (max-width: 319px) {
      .govuk-form-group {
        margin-bottom: 0;
      }
      height: 72px;
      margin-bottom: govuk-spacing(2);
    }
  }

  @media (max-width: 319px) {
    #pageSize {
      width: 100%;
    }
  }

  .dpr-table-wrapper {
    overflow-x: scroll;
    transform: rotateX(180deg);

    .dpr-table-content {
      transform: rotateX(180deg);
    }
  }

  .table-row--no-border {
    border-bottom: none;
  }

  .govuk-table__cell h2 {
    margin-bottom: 0;
    margin-top: 40px;
  }

  .dpr-report-summary-cell {
    font-weight: bold;
    padding-top: govuk-spacing(3);
    padding-bottom: govuk-spacing(3);
  }

  .dpr-report-summary-cell-table-header {
    border-bottom: solid 4px govuk-colour('mid-grey');
    background-color: white;
  }

  .dpr-report-summary-cell-table-footer {
    border-top: solid 4px govuk-colour('mid-grey');
    border-bottom: solid 2px govuk-colour('mid-grey');
    background-color: white;
  }
}

.dpr-table-container--parent-child-section,
.dpr-table-container--parent-child,
.dpr-table-container--list-section,
.dpr-table-container--list {
  .govuk-table {
    td {
      padding-left: govuk-spacing(0);
    }
  }
  .govuk-table__header {
    padding-right: govuk-spacing(4);
    white-space: nowrap;
  }

  .govuk-table__header--long {
    white-space: normal;
    min-width: 170px;
  }

  .govuk-table__cell {
    padding-right: govuk-spacing(4);
  }
}

// Zebra stripes
.dpr-dashboard-list-container,
.dpr-table-container--list-section,
.dpr-table-container--list {
  .govuk-table__body {
    tr.govuk-table__row:nth-child(even) {
      background-color: govuk-colour('light-grey');
    }
  }
}

@media print {
  .dpr-table-container {
    .dpr-table-wrapper {
      overflow: visible;

      .govuk-table {
        font-size: 12px;
        margin-bottom: govuk-spacing(2);
      }

      .data-table-cell-long-string {
        min-width: auto;
      }

      .govuk-table__header {
        white-space: normal;
      }

      .govuk-table__cell--content.print-header-footer {
        font-size: 8px;
      }
    }
    .dpr-overflow-gradient {
      display: none;
      width: 0px;
    }
  }

  .govuk-footer {
    display: none;
  }

  .dpr-request-details,
  .govuk-main-wrapper,
  .govuk-width-container {
    max-width: 100% !important;
    margin: 0px;
    padding: 0px;
  }

  .govuk-table__body {
    tr.govuk-table__row:nth-child(odd) {
      background-color: transparent !important;
    }
  }

  a {
    color: black;
    text-decoration: none;
  }
}
.dpr-parent-child-data {
  padding-bottom: govuk-spacing(4);

  .govuk-table {
    tr:last-child {
      td {
        border-bottom: none;
      }
    }
  }

  .dpr-parent-child-data__parent {
    margin-bottom: govuk-spacing(3);

    .govuk-table {
      margin-bottom: govuk-spacing(0);
    }
  }

  .dpr-parent-child-data__child {
    .dpr-parent-child-data__child-table {
      padding: govuk-spacing(3);
      padding-top: govuk-spacing(1);
      padding-bottom: govuk-spacing(1);

      .govuk-table {
        margin-bottom: 0px;

        tr:last-child {
          td {
            border-bottom: none;
          }
        }
      }
    }

    margin-bottom: govuk-spacing(6);
    border: solid 1px #b1b4b6;
    border-left: solid 4px govuk-colour('light-blue');

    h2 {
      background-color: #f3f2f1;
      margin-bottom: 0px;
      padding: govuk-spacing(2);
      padding-left: govuk-spacing(3);
    }
  }
}

@media print {
  .dpr-parent-child-data {
    padding-bottom: govuk-spacing(2);

    .dpr-parent-child-data__parent {
      .dpr-table-container {
        .dpr-table-wrapper {
          .govuk-table__cell--content.print-header-footer--footer {
            display: none;
          }
        }
      }
    }

    .dpr-parent-child-data__child {
      .dpr-parent-child-data__child-table {
        padding: govuk-spacing(1);
        padding-bottom: 0px;
        padding-top: 0px;

        .dpr-table-container {
          .dpr-table-wrapper {
            .govuk-table__cell--content.print-header-footer {
              display: none;
            }
          }
        }
      }

      border-left: solid 1px govuk-colour('mid-grey');
      margin-bottom: govuk-spacing(2);

      h2 {
        font-size: 12px;
        padding: govuk-spacing(1);
      }
    }
  }
}
.dpr-pagination {
  overflow: auto;
}

.drp-pagination-rows-suffix {
  flex-grow: 1;
}

#page-size-select {
  min-width: 5em;
}

@media print {
  .dpr-pagination {
    display: none;
  }
}
.dpr-report-no-data-message {
  text-align: left;
  margin-top: govuk-spacing(6);

  p {
    margin-bottom: govuk-spacing(3);
  }
}
.dpr-report-header {
  padding-top: govuk-spacing(2);
  margin-bottom: govuk-spacing(2);

  .dpr-report-heading__actions {
    text-align: right;

    @media (max-width: 1019px) {
      order: 0;
      flex: 1 0 100%;
    }
  }

  .dpr-report-heading {
    display: flex;
    flex-wrap: wrap;

    .dpr-report-heading__title {
      flex: 1;

      #dpr-report-name {
        margin-bottom: govuk-spacing(2);
      }

      .govuk-heading-l {
        margin-bottom: govuk-spacing(4);
      }

      @media (max-width: 1019px) {
        order: 1;
        flex: 1 0 100%;
      }
    }
  }

  .dpr-report-details-print {
    display: none;
  }

  @media print {
    .dpr-report-heading__actions,
    .dpr-bookmark,
    .dpr-meta-data-details,
    .dpr-report-heading,
    .dpr-pagination {
      display: none;
    }

    .dpr-report-details-print {
      display: block;

      .dpr-request-details {
        p,
        ul,
        li,
        h1,
        h2 {
          font-size: 12px;
          margin-top: 0px;
          margin-bottom: 5px;
          padding-top: 0px;
        }
        ul {
          padding: 0;
          list-style-type: none;
          li {
            display: inline;
            padding-right: 10px;
          }
        }
        .dpr-request-details__table {
          margin-top: 0px;
          margin-bottom: 0px;

          tbody {
            vertical-align: top;
          }

          td {
            padding: 0px;
          }

          .dpr-request-details__table-heading {
            width: 15%;
          }
        }
      }
    }
  }
}
.dpr-download-message--hidden {
  display: none;
}

.download-success-panel {
  width: 70%;
}

.dpr-columns-section-wrapper {
  position: relative;

  .dpr-columns-section-heading {
    background-color: govuk-colour('light-grey');
    padding: govuk-spacing(2);
    padding-left: govuk-spacing(4);
    padding-right: govuk-spacing(4);
  
    p {
      margin-bottom: 0px;
    }
  }

  @media print {
    display: none;
  }

  .columns-section-button {
    min-width: 130px;
    padding-right: govuk-spacing(3);
    margin-bottom: govuk-spacing(0);

    .govuk-button-group {
      margin-bottom: 0px;
    }
  }

  .columns-section-header {
    position: absolute;
    width: calc(100% - 120px);
    left: 120px;
    top: 1px;

    @media(max-width: 640px) {
      top: -1px;
    }
  }
}
.dpr-columns-form {
  margin-left: govuk-spacing(2);

  .columns-container {
    position: relative;

    .govuk-checkboxes.govuk-checkboxes--small {
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
      column-gap: 10px;

      @media(min-width: 769px) and (max-width: 1019px) {
        grid-template-columns: 1fr 1fr;
      }

      @media(max-width: 768px) {
        grid-template-columns: 1fr;
      }
    }
  }

  .columns-header {
    padding-left: 10px;
    padding-top: 10px;
  }
}
.report-actions {
  text-align: right;
  position: relative;
  z-index: 100;
  margin-bottom: govuk-spacing(2);
  
  .moj-button-menu {
    display: block;
  }

  @media(max-width: 1019px) {
    width: 100%;
  }
}

@media print {
  .report-actions {
    display: none;
  }
}
.dpr-daterange__end-date {
  margin-bottom: govuk-spacing(3);
}

.dpr-daterange__start-date {
  margin-bottom: govuk-spacing(3);
}
 .dpr-interactive-filters {
  .multiselect-container {
    &.multiselect-container__full-width {
      .govuk-checkboxes.govuk-checkboxes--small {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        column-gap: 10px;

        @media (min-width: 769px) and (max-width: 1019px) {
          grid-template-columns: 1fr 1fr;
        }

        @media (max-width: 768px) {
          grid-template-columns: 1fr;
        }
      }
    }
  }
}

.multiselect-container:not(.multiselect-container__full-width) {
  .dpr-multi-select {
    &.dpr-multi-select-scroll {
      height: 250px;
      overflow-y: scroll;
      padding-left: 10px;
      background:
        linear-gradient(#fafaf9 33%, rgba(250, 250, 249, 0)),
        linear-gradient(rgba(250, 250, 249, 0), #fafaf9 66%) 0 100%,
        radial-gradient(farthest-side at 50% 0, rgba(34, 34, 34, 0.5), rgba(0, 0, 0, 0)),
        radial-gradient(farthest-side at 50% 100%, rgba(34, 34, 34, 0.5), rgba(0, 0, 0, 0)) 0 100%;
      background-repeat: no-repeat;
      background-color: rgb(250, 250, 249);
      background-size:
        100% 40px,
        100% 40px,
        100% 14px,
        100% 14px;

      /* Opera doesn’t support this in the shorthand */
      background-attachment: local, local, scroll, scroll;
    }
  }
}

.dpr-multiselect-action__hide-all,
.dpr-multiselect-action__view-all {
  &.dpr-multiselect-action--hide {
    display: none;
  }
}
.dpr-granular-date-range {
  .dpr-granular-date-range__inputs_wrapper {
      position: relative;
      display: grid;
      grid-template-areas: "header header" "start end";
      column-gap: govuk-spacing(4);
      margin-bottom: govuk-spacing(2);
    }


  .dpr-daterange__start-end-date-wrapper, .dpr-granular-date-range__inputs_wrapper {
    position: relative;
    display: grid;
    grid-template-areas: "header header" "start end";
    column-gap: govuk-spacing(4);
    row-gap: govuk-spacing(0);
  }

  .dpr-daterange__start-end-label {
    grid-area: header;
  }

  .dpr-daterange__start-date {
    grid-area: start;
  }

  .dpr-daterange__end-date {
    grid-area: end;
  }
}
 .dpr-date, .dpr-date-range {
  .govuk-form-group {
    margin-bottom: 0;
  }

  .daterange-set-to-minmax__container {
    margin-bottom: govuk-spacing(6);
    margin-top: govuk-spacing(3);
  }

  .daterange-set-to-minmax {
    display: block;
    cursor: pointer;
    text-align: left;
    margin-bottom: govuk-spacing(1);
    margin-top: govuk-spacing(0);
    color: govuk-colour("blue");

    &:hover {
      color: govuk-colour("dark-blue")
    }
  }
}
.dpr-autocomplete-text-input {
  position: relative;

  ul {
    background-color: white;
    display: inline-block;
    left: 0;
    list-style-type: none;
    margin: 0;
    padding: 0;
    position: absolute;
    top: 100%;
    width: 100%;
    z-index: 10000;
  }

  li {
    border: #b1b4b6 1px solid;
    border-top: 0;
    text-align: left;
    width: calc(100% - 2px);

    button, a {
      box-shadow: none;
      margin-bottom: 0;
      text-align: left;
      width: 100%;
    }
  }

  .autocomplete-text-input-item-hide {
    display: none;

    button {
      display: none;
    }
  }
}
.dpr-interactive-filters-section,
.dpr-columns-section-wrapper {
  border: solid 1px govuk-colour('mid-grey');
  margin-bottom: govuk-spacing(4);

  .dpr-interactive-filters-heading {
    padding: govuk-spacing(2);
    padding-left: govuk-spacing(4);
    padding-right: govuk-spacing(4);
    border-bottom: solid 1px govuk-colour('mid-grey');

    p {
      margin-bottom: 0px;
    }
  }

  .dpr-selected-filters {
    padding-bottom: govuk-spacing(2);
  }

  .dpr-interactive-save-defaults-actions {
    padding: govuk-spacing(4);
    padding-top: govuk-spacing(2);
    padding-bottom: govuk-spacing(2);
    background-color: white;
    border-top: solid 1px govuk-colour('mid-grey');
    border-bottom: solid 1px govuk-colour('mid-grey');
  }

  .dpr-interactive-filters-accordion {
    padding: govuk-spacing(3);
    padding-left: govuk-spacing(4);
    padding-right: govuk-spacing(4);
  }

  .dpr-interactive-filters {
    .filter-form-container {
      .filter-container {
        position: relative;
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        column-gap: govuk-spacing(3);
        row-gap: govuk-spacing(6);

        @media (min-width: 769px) and (max-width: 1019px) {
          grid-template-columns: 1fr 1fr;
        }

        @media (max-width: 768px) {
          grid-template-columns: 1fr;
        }

        .dpr-filter-item {
          border-bottom: 1px Solid govuk-colour('mid-grey');
          padding-right: govuk-spacing(3);

          .govuk-form-group {
            margin-bottom: govuk-spacing(2);
          }
        }

        .dpr-filter-item__span-2 {
          grid-column: span 2;
        }

        .dpr-filter-item__span-3 {
          grid-column: span 3;
        }
      }

      .filter-actions {
        margin-top: govuk-spacing(6);
        margin-bottom: govuk-spacing(0);
        margin-left: govuk-spacing(0);
        height: 40px;

        button {
          margin-bottom: 0px;
        }

        @media (max-width: 768px) {
          height: 80px;
        }

        .govuk-button-group {
          @media (max-width: 768px) {
            width: 100%;
          }
        }
      }
    }
  }

  .govuk-button-group {
    margin: 0px;
  }

  .govuk-details {
    margin-bottom: 0px;

    .govuk-details__text {
      padding-left: 0px;
      border-left: none;
    }
  }
}

@media print {
  .dpr-interactive-filters-section {
    border: 0px;

    .dpr-interactive-save-defaults-actions,
    .govuk-details {
      display: none;
    }
    .dpr-interactive-filters-accordion {
      padding: 0px;
    }
  }
}
.dpr-selected-filters-container {
  position: relative;

  .dpr-selected-filters {
    background-color: govuk-colour('light-grey');
    padding: govuk-spacing(4);
  }
}

@media print {
  .dpr-selected-filters-container {
    .dpr-selected-filters {
      background-color: white;
      padding: govuk-spacing(0);

      a,
      h2,
      p {
        font-size: 12px;
        text-decoration: none;
        margin-right: govuk-spacing(1);
        margin-bottom: govuk-spacing(1);
        color: govuk-colour('black');
      }
    }
  }
}
.dpr-scorecard-group {
  display: flex;
  flex-wrap: wrap;
  row-gap: 10px;
  column-gap: 10px;
  flex-direction: row; 
  
  .dpr-scorecard {
    flex-grow: 4;
    flex-shrink: 1;
    flex-basis: 30%;
    min-width: 220px;
  }
}
.dpr-scorecard {
  background-color: govuk-colour("light-grey");
  padding: govuk-spacing(2);
  padding-bottom: govuk-spacing(7);
  border-top: dotted 2px govuk-colour("mid-grey");
  position: relative;

  .dpr-scorecard__value {
    font-size: 36px;
    line-height: 1.1111111111;
    font-weight: 400;
    margin-top: 10px;
    display: inline-block;
    padding: govuk-spacing(1);
  }

  .dpr-scorecard__value {
    cursor: pointer;
  }

  .dpr-scorecard__value-from {
    position: absolute;
    bottom: 10px;
    margin-bottom: 0px;
  }

  .dpr-scorecard__value-description {
    display: none;
  }

  .dpr-scorecard__value-description--active {
    display: inline-block;
    vertical-align: middle;
    padding-left: govuk-spacing(1);
  }
}
.dashboard-visualisation-container {
  scroll-margin-top: 170px;
}
.dashboard-wrapper {
  .dashboard-sidebar {
    position: -webkit-sticky;
    position: sticky;
    overflow-y: scroll;
    max-height: 100vh;
    top: 4px;
    flex: 0 0 auto;
    align-self: flex-start;
    width: 250px;
    padding-right: govuk-spacing(8);

    .moj-side-navigation {
      padding-top: 0px;

      .moj-side-navigation__item:has(.dashboard-sidebar-nav-item) {
        padding-top: govuk-spacing(1);
        border-top: solid 1px govuk-colour("light-grey");
        margin-top: govuk-spacing(3);
      }

      .dashboard-sidebar-nav-item {
        font-weight: 700;
      }

      .moj-side-navigation__item:has(.dashboard-sidebar-sub-nav-item) {
        border-left: solid 3px govuk-colour("blue");
        margin-left: govuk-spacing(3);
      }
    }

    @media(max-width: 768px) {
      display: none;
    }

  }
}
.dashboard-section-break {
    border: 0px;
    border-bottom: 1px solid lighten(govuk-colour("mid-grey"), 15%);
    margin-top: govuk-spacing(6);
    margin-bottom: govuk-spacing(6);
  }

.dpr-dashboard-section {
  margin-top: govuk-spacing(6);
  scroll-margin-top: 170px;
  max-width: 100%;
}

.dashboard-visualisation-container {
  margin-top: govuk-spacing(6);
  margin-bottom: govuk-spacing(6);
  scroll-margin-top: 170px;
}
.dpr-dashboard-list-container {
  padding-bottom: govuk-spacing(4);

  .dpr-value-for {
    text-align: right;
    margin-bottom: 0px;
  }
}
.dashboard-wrapper {
  .dpr-interactive-filters-section {
    padding-bottom: 0;
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 1000;

    .dpr-interactive-filters-accordion {
      background-color: white;

      #dpr-interactive-filters-details {
        .govuk-details__summary {
          margin-bottom: 0px;
        }
      }
    }

    .dpr-interactive-filters {
      .filter-form-container {
        padding-bottom: govuk-spacing(0);  

        .filter-container {
          .dpr-filter-item {
            padding: govuk-spacing(0);
          }
        }
        .filter-actions {
          margin-bottom: govuk-spacing(0);
          margin-left: govuk-spacing(0);
          height: 40px;
        }
      }
    }

    .govuk-button-group {
      margin: 0px;
    }

    .govuk-details {
      margin-bottom: 0px;

      .govuk-details__summary {
        margin-bottom: govuk-spacing(4);
      }

      .govuk-details__text {
        padding-left: 0px;
        border-left: none;
      }
    }
  }
}
.dashboard-wrapper {
  display: flex;
  flex-direction: row;

  .dashboard-content {
    width: 870px;
  }
}

@media (max-width: 768px) {
  .dashboard-wrapper {
    .dashboard-sidebar {
      display: none;
    }

    .dashboard-content {
      width: 100%;
    }
  }
}
.dpr-chart-tab-table {
  min-height: 350px;
}
 .dpr-chart-card {
  padding-top: govuk-spacing(0);
  padding-bottom: govuk-spacing(6);
}

.chart-tabs-container {
  display: grid;
  grid-template-columns: 4fr 1fr;
  column-gap: 30px;
  row-gap: 20px;

  @media (max-width: 1019px) {
    grid-template-columns: 1fr;
  }
}

.dpr-chart-tabs {
  margin-bottom: 0px;
}

.dpr-chart-details-value {
  font-size: 36px;
  margin-bottom: 0px;
  line-height: 1;
  margin-bottom: govuk-spacing(1);
}

.dpr-chart-details-label {
  margin-bottom: govuk-spacing(2);
  border-bottom: dotted 2px #b1b4b6;
}

.dpr-dotted-unterline {
  border-bottom: dotted 2px #b1b4b6;
}

.dpr-chart-details-legend {
  margin-bottom: govuk-spacing(1);
}

.chart-tabs-details {
  position: relative;

  .chart-tabs-details__item {
    &.chart-tabs-details__item--meta {
      width: 100%;
      position: absolute;
      bottom: 0px;
    }

    &.chart-tabs-details__item--tooltip {
      display: none;
    }

    p:last-of-type {
      margin-bottom: 0px;
    }
  }
}

.metric-break {
  border: 0px;
  border-bottom: 1px solid #b1b4b6;
  margin-top: govuk-spacing(6);
}

@media (max-width: 768px) {
  .chart-tabs-details {
    display: none;
  }
}
.chart-canvas {
  height: 100% !important;
  width: 100% !important;
}

.chart-colour__blue {
  background-color: govuk-colour("blue")
}

.chart-colour__purple {
  background-color: govuk-colour("bright-purple")
}

.chart-colour__purple {
  background-color: govuk-colour("bright-purple")
}

.chart-colour__green {
  background-color: govuk-colour("green")
}
.chart-colour__dark_blue {
  background-color: govuk-colour("dark-blue")
}

@for $i from 1 through 200 {
  .dpr-chart-height-#{$i} {
    height: $i * 80px !important;
  }
}

.dpr-chart {
  height: 400px;
}

.dpr-matrix-chart {
  height: 700px;
}

.dpr-canvas-wrapper {
  height: 100%;
}
.dpr-chart-legend {
  padding-top: 15px;
  font-family: 'GDS Transport';
  font-size: 16px;

  .dpr-pie-chart-title {
    text-align: center;
    font-weight: 800;
    margin-bottom: govuk-spacing(2);
  }

  ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;

    li {
      display: inline-flex;
      margin-bottom: 6px;
      align-items: center;
      margin-left: govuk-spacing(1);
      margin-right: govuk-spacing(1);


      span {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 50px;
        height: 24px;
        color: #fff;
        font-size: 16px;
        margin-right: 4px;
      }
    }
  }
}
.dpr-unauthorised-report-hide, .dpr-missing-report-hide, .dpr-live-report-hide, .dpr-report-type-hide {
  display: none;
}
.search-option-hide {
  display: none;
}

.dpr-search-inputs {
  position: relative;
  display: grid;
  grid-template-columns: 2fr 1fr;
  column-gap: govuk-spacing(3);
  row-gap: govuk-spacing(3);

  .govuk-form-group {
    margin-bottom: govuk-spacing(3);
  }
}

.dpr-catalogue-totals {
  float: right;
}


.dpr-search-option-hide {
  display: none;
}
.dpr-search-table {
  table-layout: fixed;
  width: 100%;

  th:nth-child(1),
  td:nth-child(1) {
    width: 25%;
  }

  th:nth-child(2),
  td:nth-child(2) {
    width: 25%;
  }

  th:nth-child(3),
  td:nth-child(3) {
    width: 35%;
  }

  th:nth-child(4),
  td:nth-child(4) {
    width: 15%;
  }

  th:nth-child(4) {
    text-align: right;
  }

  td.govuk-table__cell {
    font-size: 16px;
    padding: 20px 40px 20px 0;
  }

  .govuk-table__cell:last-child {
    padding-right: 0px !important;
    text-align: right;
  }
}
.dpr-catalogue-filters {
  border: Solid 1px govuk-colour('mid-grey');
  margin-bottom: govuk-spacing(6);;

  .dpr-catalogue-filters--heading {
    padding: govuk-spacing(4);
    background-color: govuk-colour('light-grey');

    h2 {
      margin: 0px;
    }
  }
  .dpr-catalogue-filters--content {
    padding: govuk-spacing(4);
    
    .dpr-catalogue-filters--content-filters {
      column-gap: govuk-spacing(6);
      display: grid;
      grid-template-columns: 1fr 1fr;
      position: relative;
      row-gap: 15px;
    }

    .govuk-details {
      margin-bottom: 0px;

      .govuk-details__text {
        border-left: none;
        padding-bottom: 0px;
      }
    }
  }
}
 .dpr-request-status-tag {
  font-size: 16px;
  letter-spacing: 1px;
  margin-right: 5px;
  padding-top: 2px;
}

.dpr-request-status-tag--small {
  font-size: 16px;
}
.dpr-request-details {
  margin-bottom: govuk-spacing(6);

  .dpr-request-details__table-heading_name {
    margin-bottom: 0px;
    font-weight: 800;
  }

  .dpr-request-details__table {
    border-spacing: 0px;
    width: 100%;

    tbody {
      vertical-align: top;
    }

    .dpr-request-details__table-heading {
      width: 14%;
      // text-align: right;
    }

    ul {
      margin-top: 0px;
      margin-bottom: 0px;
      padding-inline-start: 20px;
    }

    td {
      padding: govuk-spacing(1);
    }
  }
}

.dpr-meta-data-details {
  margin-bottom: govuk-spacing(6);

  .govuk-details__text {
    padding-left: 0px;
    border-left: none;
  }
}
.govuk-error-message--hidden,
.query-error-summary--hidden,
.async-filters-form--hidden {
  display: none;
}

.dpr-filters {
  .dpr-filters-container {
    column-gap: govuk-spacing(6);
    display: grid;
    grid-template-columns: 1fr 1fr;
    position: relative;
    row-gap: 15px;

    @media (max-width: 768px) {
      grid-template-columns: 1fr;
    }

    .dpr-async-request-filters__section {
      border: solid 1px govuk-colour('mid-grey');
      margin-bottom: govuk-spacing(6);

      .dpr-async-request-filters__section--heading {
        background-color: govuk-colour('mid-grey');
        padding: govuk-spacing(2);
        padding-left: govuk-spacing(4);
        padding-right: govuk-spacing(4);

        p {
          margin-bottom: 0px;
        }
      }

      .dpr-request-save-filters-container {
        padding: govuk-spacing(4);
        padding-bottom: govuk-spacing(2);
        padding-top: govuk-spacing(2);
        border-top: solid 1px govuk-colour('mid-grey');
        border-bottom: solid 1px govuk-colour('mid-grey');
        background-color: white;
      }

      .dpr-async-request-filters__section--actions {
        padding: govuk-spacing(4);

        .govuk-button-group {
          margin-bottom: 0px;

          button,
          .dpr-reset-columns-button {
            margin-bottom: 0px;
          }
        }
      }

      .filter-container {
        padding-left: govuk-spacing(4);
        padding-right: govuk-spacing(4);
        display: block;
      }
    }

    .dpr-filter-item {
      background-color: none;
      border-bottom: 1px Solid govuk-colour('mid-grey');
      padding-top: govuk-spacing(5);

      &:last-child {
        border-bottom: none;
      }
    }
  }
}
button {
  &.dpr-selected-filter {
    background-color: white;
    padding: govuk-spacing(3);
    padding-top: govuk-spacing(2);
    padding-bottom: govuk-spacing(2);
    border: solid 1px black;
    margin-right: govuk-spacing(1);
    margin-bottom: govuk-spacing(1);
    font-size: 16px;
    cursor: pointer;

    &::after {
      content: '×';
      display: inline-block;
      margin-left: govuk-spacing(2);
      font-size: 18px;
      font-weight: bold;
      line-height: 1;
      vertical-align: middle;
    }

    &:hover {
      background-color: black;
      color: white;
      border-color: black;
    }

    &:hover::after {
      color: white;
    }

    &:focus {
      background-color: #ffdd00;
      color: black;
      outline: none;
    }

    &:focus::after {
      color: black;
    }
  }
}

@media print {
  button {
    &.dpr-selected-filter {
      background-color: white;
      padding: 0px;
      font-size: 12px;
      border: 0px;

      &::after {
        content: none;
      }
    }
  }
}
