/* tables.css - Modern Cyberpunk Table Styles */

/* Основные стили для таблиц */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: linear-gradient(135deg, rgba(17, 17, 42, 0.98), rgba(12, 12, 35, 0.98));
  border: 1px solid rgba(0, 200, 210, 0.25);
  margin-bottom: 2.5rem;
  border-radius: 16px;
  overflow: hidden;
  box-shadow:
    0 8px 32px rgba(0, 200, 210, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  position: relative;
}

/* Контейнер для таблицы с вкладкой */
.table-container {
  position: relative;
  margin: 2rem 0;
  isolation: isolate;
}

/* Заголовок-вкладка слева */
.table-tab {
  position: absolute;
  left: -1px;
  top: 20px;
  background: linear-gradient(135deg, #00cccc, #0088cc);
  color: #001133;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 12px 24px;
  border-radius: 12px 12px 0 0;
  transform: rotate(-90deg) translateX(-100%);
  transform-origin: left top;
  z-index: 10;
  box-shadow:
    -4px 4px 16px rgba(0, 0, 0, 0.3),
    inset 0 1px 1px rgba(255, 255, 255, 0.2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: 'Segoe UI', 'Roboto', sans-serif;
  min-width: 120px;
  text-align: center;
}

/* Заголовок таблицы */
caption {
  font-size: 1.4rem;
  color: #00eeee;
  font-weight: 700;
  margin-bottom: 1.5rem;
  text-align: left;
  padding: 1.5rem 2rem 0;
  text-shadow: 0 0 12px rgba(0, 238, 238, 0.6);
  font-family: 'Segoe UI', 'Roboto', sans-serif;
  letter-spacing: 0.5px;
}

/* Ячейки таблицы */
td {
  padding: 1.25rem 1.5rem;
  text-align: center; /* ← здесь горизонтальная центровка */
  vertical-align: middle; /* ← вертикальная центровка */
  color: #e0f0ff;
  font-size: 1rem;
  background-color: rgba(10, 15, 35, 0.7);
  border-bottom: 1px solid rgba(0, 200, 210, 0.15);
  font-family: 'Segoe UI', 'Roboto', sans-serif;
  line-height: 1.6;
  transition: all 0.3s ease;
  position: relative;
}

/* Заголовки столбцов */
th {
  padding: 1.25rem 1.5rem;
  text-align: center; /* ← здесь горизонтальная центровка */
  vertical-align: middle; /* ← вертикальная центровка */
  background: linear-gradient(to bottom,
    rgba(0, 200, 210, 0.15),
    rgba(0, 180, 200, 0.1));
  color: #00eeee;
  font-weight: 600;
  border-bottom: 2px solid rgba(0, 200, 210, 0.3);
  font-family: 'Segoe UI', 'Roboto', sans-serif;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
  overflow: hidden;
}


/* Градиентные границы для ячеек */
td::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(to bottom,
    transparent,
    rgba(0, 200, 210, 0.3),
    transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Четные строки */
tr:nth-child(even) td {
  background-color: rgba(15, 25, 45, 0.8);
}

/* Эффект при наведении на строку: только размытие границ */
tr:hover td {
    background-color: rgba(0, 200, 210, 0.12); /* легкая подсветка фона */
    transform: none; /* убираем смещение */
    transition: all 0.3s ease;
    backdrop-filter: blur(4px); /* размывает фон за ячейкой */
    border-color: rgba(0, 200, 210, 0.3); /* слегка подсвечивает границы */
}

tr:hover td::before {
  opacity: 1; /* оставляем подсветку границы */
}



tr:hover td::before {
  opacity: 1;
}

/* Последняя строка */
tr:last-child td {
  border-bottom: none;
}

/* Ссылки в таблице */
table a {
  color: #00dddd;
  text-decoration: none;
  transition: all 0.3s ease;
  font-weight: 500;
  position: relative;
  padding: 2px 4px;
  border-radius: 4px;
}

table a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg,
    rgba(0, 221, 221, 0.8),
    transparent);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

table a:hover {
  color: #00ffff;
  text-shadow: 0 0 8px rgba(0, 255, 255, 0.6);
  background: rgba(0, 200, 210, 0.1);
}

table a:hover::after {
  transform: scaleX(1);
}

/* Адаптивность для мобильных устройств */
@media (max-width: 1024px) {
  .table-tab {
    top: 15px;
    padding: 10px 20px;
    font-size: 0.9rem;
    min-width: 100px;
  }
}

@media (max-width: 768px) {
  .table-container {
    margin: 1.5rem 0;
  }

  table {
    border-radius: 12px;
    margin-bottom: 2rem;
  }

  .table-tab {
    position: relative;
    left: 0;
    top: 0;
    transform: none;
    border-radius: 8px 8px 0 0;
    margin-bottom: -1px;
    text-align: center;
    min-width: auto;
    width: fit-content;
  }

  caption {
    font-size: 1.2rem;
    padding: 1rem 1.5rem 0;
  }

  th, td {
    padding: 1rem;
    font-size: 0.95rem;
  }

  /* Скрываем некоторые столбцы на мобильных */
  .mobile-hidden {
    display: none;
  }
}

@media (max-width: 480px) {
  .table-tab {
    padding: 8px 16px;
    font-size: 0.85rem;
  }

  th, td {
    padding: 0.8rem;
    font-size: 0.9rem;
  }

  caption {
    font-size: 1.1rem;
    padding: 0.8rem 1.2rem 0;
  }
}

/* Скроллируемые таблицы */
table.scrollable {
  display: block;
  overflow-x: auto;
  border-radius: 16px;
}

/* Компактные таблицы */
table.compact th,
table.compact td {
  padding: 1rem 1.25rem;
  font-size: 0.95rem;
}

/* Стили для действий в таблице */
.table-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}

.table-btn {
  background: linear-gradient(135deg,
    rgba(0, 200, 210, 0.3),
    rgba(0, 180, 200, 0.2));
  border: 1px solid rgba(0, 200, 210, 0.4);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  color: #e0f0ff;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
  position: relative;
  overflow: hidden;
}

.table-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent);
  transition: left 0.5s ease;
}

.table-btn:hover {
  background: linear-gradient(135deg,
    rgba(0, 200, 210, 0.5),
    rgba(0, 160, 180, 0.4));
  border-color: rgba(0, 200, 210, 0.6);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 200, 210, 0.3);
}

.table-btn:hover::before {
  left: 100%;
}

/* Стили для статусов */
.status {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(0, 200, 210, 0.1);
  border: 1px solid rgba(0, 200, 210, 0.3);
}

.status-active {
  color: #00ffaa;
  background: rgba(0, 255, 170, 0.1);
  border-color: rgba(0, 255, 170, 0.3);
  box-shadow: 0 0 10px rgba(0, 255, 170, 0.2);
}

.status-inactive {
  color: #ff3366;
  background: rgba(255, 51, 102, 0.1);
  border-color: rgba(255, 51, 102, 0.3);
}

.status-pending {
  color: #ffcc00;
  background: rgba(255, 204, 0, 0.1);
  border-color: rgba(255, 204, 0, 0.3);
  box-shadow: 0 0 10px rgba(255, 204, 0, 0.2);
}

/* Анимация появления строк */
@keyframes rowAppear {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

tr {
  animation: rowAppear 0.4s ease-out;
}

tr:nth-child(2) { animation-delay: 0.05s; }
tr:nth-child(3) { animation-delay: 0.1s; }
tr:nth-child(4) { animation-delay: 0.15s; }
tr:nth-child(5) { animation-delay: 0.2s; }