/* 
 * Semantic CSS classes for List Pages 
 * Replaces Tailwind classes for specific list pages
 */

/* Header Section */
.list-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 2rem;
}

.list-title-container {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.list-title {
  color: var(--text-body);
  font-size: 1.875rem; /* 3xl */
  font-weight: 900; /* black */
  line-height: 1.25; /* tight */
  letter-spacing: -0.025em; /* tracking-tight */
}

.list-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  width: 100%;
}

@media (min-width: 640px) {
  .list-actions {
    width: auto;
  }
}

.btn-create {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.25rem; /* rounded */
  background-color: var(--color-primary); /* sky-400 */
  color: #ffffff;
  padding: 0 1.5rem;
  height: 2.75rem; /* h-11 */
  font-size: 0.875rem; /* text-sm */
  font-weight: 700; /* font-bold */
  letter-spacing: 0.025em; /* tracking-wide */
  transition: all 0.2s;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); /* shadow-sm */
  overflow: hidden;
  width: 100%;
}
.disabled-link {
  pointer-events: none;
  color: gray; /* 可选：改变颜色以表示禁用状态 */
  cursor: not-allowed; /* 可选：改变鼠标指针样式 */
  background-color: #f5f5f5; /* 可选：改变背景颜色以表示禁用状态 */
}

.btn-create:hover {
  background-color: var(--color-primary-hover); /* sky-500 */
}

.btn-create-text {
  transition: opacity 0.2s;
}

.btn-create-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-primary-hover); /* sky-500 */
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.btn-loader-icon {
  color: #ffffff;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.btn-create.btn-loading {
  cursor: not-allowed;
  opacity: 0.9;
}

.btn-create.btn-loading .btn-create-text {
  opacity: 0;
}

.btn-create.btn-loading .btn-create-loader {
  opacity: 1;
}

.list-action-note {
  font-size: 0.75rem; /* text-xs */
  color: var(--color-slate-500); /* slate-500 */
  font-weight: 500; /* font-medium */
  letter-spacing: 0.025em; /* tracking-wide */
  text-transform: uppercase;
  text-align: center;
  width: 100%;
}

html.dark .list-action-note {
  color: var(--color-slate-400); /* dark:text-slate-400 */
}

/* Stats */
.list-stats-container {
  display: flex;
  margin-bottom: 1rem;
}

.list-stat-box {
  background-color: var(--bg-card); /* white / slate-900 */
  padding: 0.5rem 0.75rem; /* py-2 px-3 */
  border-radius: 0.375rem; /* rounded-md */
  border: 1px solid var(--border-color); /* slate-200 / slate-800 */
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); /* shadow-sm */
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.list-stat-label {
  color: var(--color-slate-500);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em; /* tracking-wider */
}

html.dark .list-stat-label {
  color: var(--color-slate-400);
}

.list-stat-value {
  color: var(--text-body); /* text-slate-900 / white */
  font-size: 1rem; /* text-base */
  font-weight: 900; /* font-black */
}

/* Table Container */
.list-table-card {
  background-color: var(--bg-card);
  border-radius: 0.5rem; /* rounded-lg */
  border: 1px solid var(--border-color);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.list-table-wrapper {
  overflow-x: auto;
  overflow-y: auto;
  max-height: calc(100vh - 250px);
}

.list-table {
  width: 100%;
  text-align: left;
  border-collapse: collapse;
}

/* Table Header */
.list-table-head {
  position: sticky;
  top: 0;
  z-index: 10;
}

.list-table-head-row {
  background-color: var(--color-slate-100);
  border-bottom: 1px solid var(--color-slate-200);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

html.dark .list-table-head-row {
  background-color: var(--color-slate-800);
  border-bottom-color: var(--color-slate-700);
}

.list-table-th {
  padding: 1rem; /* px-4 py-4 */
  font-size: 0.75rem; /* text-xs */
  font-weight: 700;
  color: var(--color-slate-500);
  text-transform: uppercase;
  letter-spacing: 0.05em; /* tracking-wider */
  white-space: nowrap;
}

.list-th-sub {
  display: block;
  margin-top: 0.125rem;
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--color-slate-400);
  letter-spacing: 0.05em;
}

html.dark .list-table-th {
  color: var(--color-slate-400);
}

html.dark .list-th-sub {
  color: var(--color-slate-500);
}

.list-table-th.th-center {
  text-align: center;
}

/* Table Body */
.list-table-body {
  /* No special styles needed here, rows handle borders */
}

.list-table-row {
  transition: background-color 0.2s;
  border-top: 1px solid var(--color-slate-100);
}

.list-table-row:first-child {
  border-top: none;
}

html.dark .list-table-row {
  border-top-color: var(--color-slate-800);
}

.list-table-row:hover {
  background-color: #f0f9ff; /* sky-50 */
}

html.dark .list-table-row:hover {
  background-color: rgba(12, 74, 110, 0.3); /* sky-900/30 */
}

/* Table Cells */
.list-table-td {
  padding: 1rem;
  font-size: 0.875rem; /* text-sm */
  color: #000000; /* text-black */
  transition: color 0.2s;
}

.list-td-multi {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.list-td-multi-item {
  line-height: 1.15;
  white-space: nowrap;
}

html.dark .list-table-td {
  color: var(--color-slate-200);
}

.list-table-td.td-id {
  font-weight: 500;
}

.list-table-td.td-bold {
  font-weight: 700;
}

.list-table-td.td-badge {
  /* Prevent group-hover text color change on badge cells */
}

.list-table-td.td-link {
  color: #000000 !important; /* text-black */
  /* font-weight: 700; */
  cursor: pointer;
}

html.dark .list-table-td.td-link {
  color: var(--color-slate-200) !important;
}

.list-table-td.td-link:hover {
  text-decoration: underline;
}

.list-table-td.td-truncate {
  max-width: 250px;
  white-space: normal;
  word-break: break-word;
}

.list-table-td.td-center {
  text-align: center;
}

.list-table-td.td-time {
  font-size: 0.75rem; /* text-xs */
}

/* Internal links inside regular tds */
.list-link {
  color: #000000;
  font-weight: 700;
  text-decoration: none;
}

html.dark .list-link {
  color: var(--color-slate-200);
}

.list-link:hover {
  text-decoration: underline;
}

/* Badges */
.list-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem; /* px-2 py-1 */
  border-radius: 0.25rem;
  font-size: 0.875rem; /* text-[10px] */
  /* font-weight: 700; */
  line-height: 1;
}


/* Attachment Action */
.list-table-action {
  display: inline-block;
  color: var(--color-slate-400);
  transition: color 0.2s;
}

.list-table-action:hover {
  color: var(--color-primary) !important;
}

html.dark .list-table-action {
  color: var(--color-slate-400);
}
html.dark .list-table-action:hover {
  color: var(--color-primary) !important;
}
