/* =========================================
   table.css
   テーブル共通スタイルとダークモード対応
   ========================================= */

/* ========== Base Table Styles ========== */
.table-responsive {
  border-radius: var(--radius-md);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  margin-bottom: 0;
  color: var(--text-primary);
}

.table thead th {
  background-color: var(--bg-secondary);
  border-bottom: 2px solid var(--border-primary);
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  text-align: left;
}

.table tbody td {
  padding: 1rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
}

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

.table tbody tr:hover {
  background-color: var(--bg-secondary);
}

/* ========== Dark Mode Support ========== */
.dark-mode .table-responsive,
[data-theme="dark"] .table-responsive {
  background-color: var(--dm-card);
  border: 1px solid var(--dm-border);
}

.dark-mode .table,
[data-theme="dark"] .table {
  color: var(--dm-foreground);
}

.dark-mode .table thead th,
[data-theme="dark"] .table thead th {
  background-color: rgba(71, 85, 105, 0.3);
  border-bottom-color: var(--dm-border);
  color: var(--dm-muted-foreground);
}

.dark-mode .table tbody td,
[data-theme="dark"] .table tbody td {
  border-bottom-color: var(--dm-border);
  color: var(--dm-foreground);
}

.dark-mode .table tbody tr:hover,
[data-theme="dark"] .table tbody tr:hover {
  background-color: rgba(71, 85, 105, 0.3);
}

.dark-mode .table a,
[data-theme="dark"] .table a {
  color: var(--dm-primary);
}

.dark-mode .table a:hover,
[data-theme="dark"] .table a:hover {
  color: var(--dm-primary-hover);
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
  .table {
    font-size: 0.875rem;
  }
  
  .table thead th,
  .table tbody td {
    padding: 0.5rem;
  }
}