/*
 * StudyHub.AZ Table Styles
 * Filename: tables.css
 * Author: Ostwind by Dr.FC
 * Таблицы и их стили
 */

/* === TABLES (Universal) === */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 40px;
  background: #ffffff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
  font-size: 1rem;
  color: var(--color-text-main);
}

th, td {
  padding: 16px 24px;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  vertical-align: middle;
}

th {
  background-color: #eaf4fd;
  color: var(--color-primary);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.95rem;
  letter-spacing: 0.4px;
}

td {
  color: #333;
  font-weight: 500;
  background-color: rgba(255, 255, 255, 0.98);
}

tr:hover td {
  background-color: #f9fcff;
  transition: background 0.3s ease;
}

tr:last-child td {
  border-bottom: none;
}

/* === TABLE STRIPED === */
/* Чередующиеся цвета строк для лучшей читаемости */
.table-striped tbody tr:nth-child(odd) {
  background-color: rgba(255, 255, 255, 0.98);
}

.table-striped tbody tr:nth-child(even) {
  background-color: rgba(234, 244, 253, 0.3);
}

.table-striped tbody tr:hover {
  background-color: #f9fcff;
  transition: background 0.3s ease;
}

/* === FLAGS === */
.flag-table {
  margin: 24px auto 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.flag-table * {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.flag-td {
  padding: 0;
  border: none;
}

.flag-button {
  background: transparent;
  border: none;
  padding: 6px;
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: none;
}

.flag-button:hover {
  transform: scale(1.1);
}

.flag-button.flag-active {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  box-shadow: 0 0 6px rgba(11, 122, 62, 0.4);
}

.flag-img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  display: block;
}

/* === TARIFF TABLE IMPROVEMENTS === */
.tariff-table {
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.08);
  text-align: center;
}

/* === RESPONSIVE TABLE HEADERS === */
.responsive-header {
  text-align: center;
  font-size: 1rem;
  padding: 12px 10px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  color: var(--color-primary);
  font-weight: 700;
}

.responsive-header i {
  color: var(--color-primary);
  font-size: 1.2rem;
}

/* === ENHANCED TABLE STYLES === */
table.departments-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  margin: var(--space-lg) 0;
}

table.departments-table th {
  background: var(--color-primary);
  color: white;
  position: sticky;
  top: 0;
}

table.departments-table th:first-child {
  border-top-left-radius: var(--radius);
}

table.departments-table th:last-child {
  border-top-right-radius: var(--radius);
}

table.departments-table tr:hover td {
  background: var(--color-bg-light);
}

table.departments-table td.status-cell {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
} 

/* === 🎨 ADMIN TABLE STYLES === */
/* StudyHub.AZ - Admin Panel Table Styles */

.admin-table {
  width: 100%;
  background-color: rgba(15, 23, 42, 0.95);
  color: #fff;
  border-collapse: collapse;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.admin-table th, .admin-table td {
  padding: 16px 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  text-align: left;
}

.admin-table th {
  background-color: rgba(12, 60, 120, 0.6);
  font-weight: 700;
}

.admin-actions {
  display: flex;
  gap: 12px;
}

/* Dark mode override for admin tables */
/* Стили темной темы перенесены в theme-loader.css согласно архитектуре */

/* === SUPER ADMIN DATA TABLE === */

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.data-table th {
    background: var(--color-bg-light);
    font-weight: 600;
    color: var(--color-text-main);
}

.data-table td {
    color: var(--color-text-secondary);
}

.data-table code {
    background: var(--color-bg-light);
    padding: 0.2rem 0.4rem;
    border-radius: var(--radius-sm);
    font-family: 'Courier New', monospace;
    border: 1px solid var(--color-border);
}

/* Table Container */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
}

/* === BADGES === */

.badge {
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-success {
    background: var(--color-accent);
    color: white;
}

.badge-danger {
    background: var(--color-error);
    color: white;
}

.badge-warning {
    background: #ffc107;
    color: #212529;
}

.badge-info {
    background: #17a2b8;
    color: white;
}

/* === 🎯 ТАБЛИЦЫ В МОДАЛЬНЫХ ОКНАХ === */
/* Классы для таблиц внутри модальных окон */
.modal-table-full-width {
  width: 100%;
  border-collapse: collapse;
}

.modal-table-header-row {
  background: #f8f9fa;
  border-bottom: 2px solid #dee2e6;
}

.modal-table-header-cell {
  padding: 0.75rem;
  text-align: left;
  font-weight: 600;
}

.modal-table-body-row {
  border-bottom: 1px solid #dee2e6;
}

.modal-table-body-row-alt {
  border-bottom: 1px solid #dee2e6;
  background: #f8f9fa;
}

.modal-table-cell {
  padding: 0.75rem;
}

.modal-table-footer-container {
  display: flex;
  justify-content: space-between;
  width: 100%;
  align-items: center;
}

.modal-table-footer-text {
  color: #666;
  font-size: 0.9rem;
}