/* Material Table Styles */
.mat-table-container {
  border-radius: 10px;
  overflow: hidden;
}

/* Обёртка для горизонтальной прокрутки таблицы */
.table-scroll-wrapper {
  overflow-x: auto;
}

.mat-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  text-align: center;
}

.mat-table th {
  position: relative;
  padding: 0.5em;
  background-color: #2a2a2a;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s;
  white-space: nowrap;
  user-select: none;
  min-width: 50px; /* Минимальная ширина для ресайза */
}

.mat-table .resize-handle {
  position: absolute;
  top: 0;
  right: -2px;
  width: 4px;
  height: 100%;
  background: transparent;
  cursor: col-resize;
}

.mat-table th:hover {
  background-color: #444;
}

.mat-table th.active {
  background-color: #ff3333;
}

.mat-table td {
  background-color: #1c1c1c;
  padding: 0.5em;
  transition: background-color 0.3s;
  white-space: nowrap;
}

.mat-table tr:hover td {
  background-color: #252525;
}

/* Стили для иконки сортировки */
.mat-table .sort-icon {
  margin-left: 5px;
  padding: 3px;
  width: 10px; /* Фиксированная ширина иконки */
  height: 10px; /* Фиксированная высота иконки */
  opacity: 0; /* Скрыта по умолчанию */
  transition: opacity 0.2s; /* Плавное появление */
  border: solid #fff;
  border-width: 0 4px 4px 0;
  transform: rotate(-135deg);
}

.mat-table th:hover .sort-icon {
  opacity: 0.5; /* Полупрозрачная при наведении */
}

.mat-table th.active .sort-icon {
  opacity: 1; /* Полная видимость при активной сортировке */
}

.mat-table .sort-icon.asc {
  transform: rotate(-135deg); /* Стрелка вверх */
}

.mat-table .sort-icon.desc {
  transform: rotate(45deg); /* Стрелка вниз */
}

.mat-table img.table_edit {
  width: 18px;
  height: 18px;
  margin: 0 4px;
  cursor: pointer;
  vertical-align: middle;
}

.mat-table .green-circle,
.mat-table .red-circle,
.mat-table .yellow-circle {
  display: inline-block;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  margin-right: 2px;
}

.mat-table .green-circle {
  background-color: #4caf50;
}

.mat-table .red-circle {
  background-color: #f44336;
}

.mat-table .yellow-circle {
  background-color: #ffeb3b;
}

.mat-table .copyable-domain {
  cursor: pointer;
  text-decoration: underline;
  color: #90caf9;
}

/* Paginator Styles */
.mat-paginator-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5em;
  background-color: #2a2a2a;
}

.mat-paginator-page-size {
  display: flex;
  align-items: center;
  margin-right: 1em;
}

.mat-paginator-page-size-label {
  margin-right: 0.5em;
}

.mat-select-container {
  position: relative;
  display: inline-block;
}

.mat-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: #333;
  border-radius: 4px;
  padding: 8px 32px 8px 12px;
  color: #fff;
  cursor: pointer;
  outline: none;
  min-width: 70px;
}

.mat-select-arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.mat-paginator-range-actions {
  display: flex;
  align-items: center;
}

.mat-paginator-range-label {
  margin: 0 1em;
}

.mat-paginator-navigation-button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background-color: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  margin: 0 4px;
  outline: none;
  padding: 0;
  transition: background-color 0.3s;
}

.mat-paginator-navigation-button:hover:not([disabled]) {
  background-color: rgba(255, 255, 255, 0.1);
}

.mat-paginator-navigation-button[disabled] {
  opacity: 0.4;
  cursor: default;
}

.mat-paginator-navigation-button svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

@media screen and (max-width: 590px) {
  .mat-paginator-container {
    flex-wrap: wrap;
    justify-content: center;
    padding: 8px;
  }

  .mat-paginator-page-size {
    margin-bottom: 8px;
    margin-right: 0;
    width: 100%;
    justify-content: center;
  }

  .mat-paginator-range-actions {
    width: 100%;
    justify-content: center;
  }

  .mat-table th,
  .mat-table td {
    padding: 8px;
  }

  .mat-paginator-range-label {
    margin: 0 8px;
  }

  .mat-paginator-navigation-button {
    width: 32px;
    height: 32px;
  }
}
