/**
 * @file
 * Pager
 *
 * Contains styles for the pager on listing pages.
 */

 @use '_helper' as *;
 
.pager,
.faculty__list .footer-table {
  margin-top: 30px;
  margin-bottom: 60px;
  @media screen and (min-width: $break-medium) {
    margin-top: 50px;
  }

  @media screen and (min-width: $break-large) {
    margin-top: 60px;
    margin-bottom: 100px;
    
  }
}

.pager__list {
  display: flex;
  justify-content: center;
  padding: 0;
  margin: 0 -3px;
  list-style-type: none;
}

.pager__item {
  margin: 0 3px;

  &.pager__item--ellipsis {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;

    @media screen and (min-width: $break-medium) {
      width: 45px;
      height: 45px;
    }
  }

  &.pager__item--ellipsis-next {
    display: none;

    @media screen and (min-width: $break-medium) {
      display: flex;
    }
  }

  a {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    width: 35px;
    height: 35px;
    border-radius: 100em;
    color: $color-black;
    background-color: $color-blue-light;

    &:hover {
      text-decoration: underline;
    }

    &[aria-current=true] {
      background-color: transparent;
      border: 0.5px solid;
    }

    @media screen and (min-width: $break-medium) {
      width: 45px;
      height: 45px;
    }
    
  }


  &::before {
    content: none;
  }
}

.pager__item .icon-arrow-left,
.pager__item .icon-arrow-right,
.paginate_button.previous,
.paginate_button.next {
  color: transparent;
  overflow: hidden;
  display: inline-block;
  position: relative;
  background-color: transparent;
  text-decoration: none;
  vertical-align: middle;
  width: 35px;
  height: 35px;
  font-size: 0;
  margin: 0 4px;

  @media screen and (min-width: $break-medium) {
    width: 45px;
    height: 45px;
  }

  &:hover:after {
    border-color: $color-blue-dark;
  }

  &:after {
    position: absolute;
    top: 55%;
    left: 34%;
    content: '';
    height: 8px;
    width: 8px;
    border-top: 2px solid black;
    border-right: 2px solid black;
    transform: rotate(45deg) translate(-50%, -50%);

    @media screen and (min-width: $break-medium) {
      height: 9px;
      width: 9px;
    }
  }
}

.pager__item .icon-arrow-left,
.paginate_button.previous {
  &:after {
    border: 0;
    left: 40%;
    border-bottom: 2px solid #000;
    border-left: 2px solid #000;
  }
}

// OU Directory
.faculty__list .footer-table {
  justify-content: center;
  align-items: center;
}
.dataTables_paginate {
  display: flex;
  justify-content: center;
  align-items: center;
}
.dataTables_paginate span {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  margin: 0 -3px;

  .ellipsis {
    width: 35px;
    height: 35px;
    margin: 0 3px;

    @media screen and (min-width: $break-medium) {
      width: 45px;
      height: 45px;
    }
  }

  .paginate_button  {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    width: 35px;
    height: 35px;
    border-radius: 100em;
    margin: 0 3px;
    color: $color-black;
    background-color: $color-blue-light;
    font-weight: 700;
    cursor: pointer;
 

    &:hover {
      text-decoration: underline;
    }

    &[aria-current=true] {
      background-color: transparent;
      border: 0.5px solid;
      font-weight: 400;
    }

    @media screen and (min-width: $break-medium) {
      width: 45px;
      height: 45px;
    }
    

  }
}

.footer-table {
  @media (min-width: $break-medium) {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
  }

  @media screen and (min-width: $break-large) {
    gap: 20px 25px;
    margin-left: -20px;
  }

  .dataTables_info {
    padding-left: 10px;
    height: 38px;
    border-left: 1px solid;
    display: flex;
    align-items: center;
    gap: 0 4px;

    @media screen and (min-width: $break-medium) {
      padding-left: 20px;
    }
  }

  .table-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;

    @media screen and (min-width: $break-medium) {
      gap: 20px;
      margin-top: 0;
    }
  }

  .table-length-wrap {

    &::after {
      content: '';
      width: 5px;
      height: 5px;
      position: absolute;
      top: calc(50% - 2px);
      left: 85.5px;
      transform: translateY(-50%) rotate(-45deg);
      border-bottom: 1.5px solid $color-black;
      border-left: 1.5px solid $color-black;
      pointer-events: none;

      @media screen and (min-width: $break-medium) {
        left: 180px;
      }
    }
    select {
      @include body;
      padding: 7.5px 13px 9.5px;
      padding-right: 30px;
      background-color: $color-white;
      border: solid 1px $color-gray;
      border-radius: 5px;
      margin-right: 10px;
      @media screen and (min-width: $break-medium) {
        margin-right: 15px;
        width: 201px;
      }
      @media screen and (min-width: $break-large) {
        padding: 7px 13px;
      }
    }
   }
  .dataTables_length {
    position: relative;
  }
}

.pager__wrap {
  @media screen and (min-width: $break-large) {
    margin: 60px 0 100px;
    margin-bottom: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
  }

  .pager {
    margin-bottom: 20px;

    @media screen and (min-width: $break-large) {
      margin: 0;
    }
  }

  .pager__info {
    margin-bottom: 60px;

    @media screen and (min-width: $break-large) {
      margin: 0;
    }
  }
}

.pager__info {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 27px;

  @media screen and (min-width: $break-medium) {
    justify-content: center;
    flex-direction: row;
    gap: 20px;
  }
}

.pager__control {
  display: flex;
  align-items: center;
  gap: 10px;

  @media screen and (min-width: $break-medium) {
    gap: 20px;
  }

  select {
    padding-right: 35px;

    @media screen and (min-width: $break-medium) {
      min-width: 201px;
    }

    @media screen and (min-width: $break-large) {
      min-width: 213px;
    }
  }
}

.pager__count {
  padding-left: 10px;
  position: relative;

  @media screen and (min-width: $break-medium) {
    padding-left: 20px;
  }

  &::before {
    content: '';
    height: 38px;
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    border-left: solid 1px $color-black;
  }

  span {
    font-weight: 700;
  }
}