/* Table Styles for GLOA Observation App */

/* Table Sections */
.table-section {
  margin-bottom: var(--spacing-xxl);
}

.table-section h2 {
  color: var(--primary-color);
  font-size: var(--font-size-xxl);
  margin-bottom: var(--spacing-lg);
}

/* Statistics Grid */
.stats-section {
  margin-bottom: var(--spacing-xxl);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--spacing-lg);
}

.stat-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  padding: var(--spacing-lg);
  border-radius: var(--border-radius);
  border: 2px solid var(--border-color);
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--box-shadow-lg);
}

.stat-value {
  font-size: var(--font-size-xxxl);
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: var(--spacing-sm);
}

.stat-label {
  font-size: var(--font-size-sm);
  color: var(--dark-gray);
  font-weight: 600;
}

/* Table Container */
.table-container {
  overflow-x: auto;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
}

/* Table */
table {
  width: 100%;
  border-collapse: collapse;
  background-color: white;
}

thead {
  background-color: var(--primary-color);
  color: white;
}

thead th {
  padding: var(--spacing-md);
  text-align: left;
  font-weight: 600;
  font-size: var(--font-size-base);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.2s;
}

tbody tr:hover {
  background-color: #f0f7ff;
}

tbody tr:last-child {
  border-bottom: none;
}

tbody td {
  padding: var(--spacing-md);
  color: var(--text-color);
}

/* Table Actions */
.table-actions {
  display: flex;
  gap: var(--spacing-sm);
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all 0.2s;
  font-size: var(--font-size-lg);
}

.btn-edit {
  background-color: var(--secondary-color);
  color: white;
}

.btn-edit:hover {
  background-color: #3a7bc8;
}

.btn-delete {
  background-color: var(--danger-color);
  color: white;
}

.btn-delete:hover {
  background-color: #c82333;
}

/* Email Status Badge */
.email-badge {
  display: inline-block;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: calc(var(--border-radius) / 2);
  font-size: var(--font-size-sm);
  font-weight: 600;
}

.email-badge.sent {
  background-color: #d4edda;
  color: #155724;
}

.email-badge.not-sent {
  background-color: #fff3cd;
  color: #856404;
}

/* Empty State */
tbody tr.empty-row td {
  text-align: center;
  padding: var(--spacing-xxl);
  color: var(--dark-gray);
  font-style: italic;
}

/* Sort Indicators (for future enhancement) */
th.sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: calc(var(--spacing-md) + 16px);
}

th.sortable::after {
  content: '⇅';
  position: absolute;
  right: var(--spacing-md);
  opacity: 0.5;
}

th.sortable.sorted-asc::after {
  content: '↑';
  opacity: 1;
}

th.sortable.sorted-desc::after {
  content: '↓';
  opacity: 1;
}

/* Rating Display */
.rating-display {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.rating-value {
  font-weight: 700;
  color: var(--primary-color);
}

.rating-stars {
  color: #ffc107;
}

/* Responsive Tables */
@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .table-container {
    font-size: var(--font-size-sm);
  }

  thead th,
  tbody td {
    padding: var(--spacing-sm);
  }

  /* Stack table rows on mobile for better readability */
  table.responsive {
    display: block;
  }

  table.responsive thead {
    display: none;
  }

  table.responsive tbody {
    display: block;
  }

  table.responsive tr {
    display: block;
    margin-bottom: var(--spacing-lg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
  }

  table.responsive td {
    display: flex;
    justify-content: space-between;
    padding: var(--spacing-sm);
    border-bottom: 1px solid var(--light-gray);
  }

  table.responsive td:last-child {
    border-bottom: none;
  }

  table.responsive td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--dark-gray);
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}
