/* ========================================
   通用數據表格（DataTable）與視圖切換（ViewSwitcher）樣式
======================================== */

.data-table-wrapper {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table thead th {
  text-align: left;
  padding: 14px 16px;
  background: #f9fafb;
  color: #6b7280;
  font-weight: 600;
  font-size: 13px;
  border-bottom: 1px solid #e5e7eb;
  white-space: nowrap;
}

.data-table th.sortable {
  cursor: pointer;
  user-select: none;
}

.data-table th.sortable:hover {
  color: #2455A6;
}

.data-table .sort-icon {
  color: #9ca3af;
  font-size: 12px;
  margin-left: 4px;
}

.data-table th.select-column,
.data-table td.select-column {
  width: 44px;
  text-align: center;
}

.data-table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid #f3f4f6;
  color: #111827;
  vertical-align: middle;
}

.data-table tbody tr.data-row {
  transition: background 0.15s;
}

.data-table tbody tr.data-row:hover {
  background: #f9fafb;
}

.data-table tbody tr.data-row.selected {
  background: rgba(36, 85, 166, 0.06);
}

.data-table td.empty-row {
  text-align: center;
  color: #9ca3af;
  padding: 48px 16px;
  font-size: 15px;
}

.data-table input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* 分頁 */
.data-table-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px;
  flex-wrap: wrap;
  border-top: 1px solid #f3f4f6;
}

.pagination-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #374151;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s;
}

.pagination-btn:hover:not(:disabled):not(.active) {
  border-color: #2455A6;
  color: #2455A6;
}

.pagination-btn.active {
  background: #2455A6;
  border-color: #2455A6;
  color: #fff;
  font-weight: 600;
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-ellipsis {
  padding: 0 4px;
  color: #9ca3af;
}

/* 視圖切換 */
.view-switcher {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: #f3f4f6;
  border-radius: 10px;
}

.view-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: none;
  background: transparent;
  color: #6b7280;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
}

.view-btn:hover {
  color: #2455A6;
}

.view-btn.active {
  background: #fff;
  color: #2455A6;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.view-icon {
  font-size: 16px;
  line-height: 1;
}

/* 網格視圖 */
.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.event-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  transition: all 0.15s;
}

.event-card:hover {
  border-color: #2455A6;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.event-card-title {
  font-size: 16px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 8px;
}

.event-card-meta {
  font-size: 13px;
  color: #6b7280;
  margin: 4px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.event-card-badge {
  display: inline-block;
  margin-top: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.event-card-badge.open {
  background: #dcfce7;
  color: #166534;
}

.event-card-badge.closed {
  background: #fee2e2;
  color: #991b1b;
}

@media (max-width: 768px) {
  .data-table {
    font-size: 13px;
  }
  .data-table thead th,
  .data-table tbody td {
    padding: 10px 12px;
  }
}
