@import '../variables';

/* Custom sort indicator
/ -------------------------------------------------
*/
.mat-sort-header-container {
  padding-right: $plt-padding-base;
}

/* Hides indicator behind header text */
.mat-sort-header-content {
  overflow-x: hidden;
}

.mat-sort-header-arrow[style] {
  height: 16px;
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  margin: auto 0;

  .mat-sort-header-stem {
    display: none;
  }

  .mat-sort-header-indicator {
    transform: none !important;

    .mat-sort-header-pointer-left, .mat-sort-header-pointer-right, .mat-sort-header-pointer-middle {
      display: none;
    }

    &::before {
      content: "";
      background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTciIHZpZXdCb3g9IjAgMCAxNiAxNyIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGc+CjxwYXRoIGQ9Ik00LjY2NjAyIDcuMTY2NUw3Ljk5OTM1IDEwLjQ5OThMMTEuMzMyNyA3LjE2NjVINC42NjYwMloiIGZpbGw9ImJsYWNrIi8+CjwvZz4KPC9zdmc+Cg==');
      position: absolute;
      top: 0;
      bottom: 0;
      width: 16px;
      height: 16px;
    }
  }
}

[aria-sort="ascending"] {
  .mat-sort-header-arrow {
    .mat-sort-header-indicator {
      &::before {
        transform: rotate(180deg);
      }
    }
  }
}

.theme-dark {
  .mat-sort-header-arrow[style] {
    .mat-sort-header-indicator {
      &::before {
        background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTciIHZpZXdCb3g9IjAgMCAxNiAxNyIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGc+CjxwYXRoIGQ9Ik00LjY2NjAyIDcuMTY2NUw3Ljk5OTM1IDEwLjQ5OThMMTEuMzMyNyA3LjE2NjVINC42NjYwMloiIGZpbGw9IndoaXRlIi8+CjwvZz4KPC9zdmc+Cg==');
      }
    }
  }
}
