/* PostsList.module.css — creator post management list */

.layout {
  display: flex;
  gap: 0;
  min-height: 60vh;
}

.content {
  flex: 1;
  min-width: 0;
  padding: 2rem 2.5rem;
}

/* ── Header ────────────────────────────────────────────────────────────────── */

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
}

.pageTitle {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0;
}

.newBtn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: var(--color-accent, #22d3ee);
  color: var(--color-bg, #0f172a);
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s;
}

.newBtn:hover {
  opacity: 0.85;
}

/* ── Table (desktop) ───────────────────────────────────────────────────────── */

.tableWrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted, var(--color-text-secondary));
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--color-border);
}

.table td {
  padding: 0.75rem;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.table tr:hover td {
  background: var(--color-bg-surface-hover, rgba(255, 255, 255, 0.03));
}

.titleCell {
  font-weight: 500;
  color: var(--color-text-primary);
}

/* ── Status badges ─────────────────────────────────────────────────────────── */

.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.725rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badgePublished {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

.badgeDraft {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
}

/* ── Actions ───────────────────────────────────────────────────────────────── */

.actions {
  display: flex;
  gap: 0.5rem;
}

.editBtn,
.deleteBtn {
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.editBtn {
  background: transparent;
  color: var(--color-text-secondary);
}

.editBtn:hover {
  background: var(--color-bg-surface-hover, #334155);
  border-color: var(--color-accent, #22d3ee);
  color: var(--color-accent, #22d3ee);
}

.deleteBtn {
  background: transparent;
  color: var(--color-text-secondary);
}

.deleteBtn:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
  color: #ef4444;
}

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

/* ── Mobile cards ──────────────────────────────────────────────────────────── */

.mobileCards {
  display: none;
}

/* ── States ────────────────────────────────────────────────────────────────── */

.loading {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
  padding: 2rem 0;
}

.error {
  color: var(--color-error, #ef4444);
  font-size: 0.95rem;
  padding: 2rem 0;
}

.empty {
  color: var(--color-text-muted, var(--color-text-secondary));
  font-size: 0.925rem;
  padding: 2rem 0;
  text-align: center;
}

/* ── Confirm dialog ────────────────────────────────────────────────────────── */

.confirmOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.confirmDialog {
  background: var(--color-bg-surface, #1e293b);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.5rem;
  max-width: 400px;
  width: 90%;
}

.confirmTitle {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0 0 0.5rem;
}

.confirmText {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  margin: 0 0 1.25rem;
}

.confirmActions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.confirmCancel {
  padding: 0.45rem 1rem;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-text-secondary);
  cursor: pointer;
  font-size: 0.875rem;
}

.confirmDelete {
  padding: 0.45rem 1rem;
  background: #ef4444;
  border: none;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
}

.confirmDelete:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ── Responsive ────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .content {
    padding: 1.25rem;
  }

  .tableWrap {
    display: none;
  }

  .mobileCards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  .mobileCard {
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .mobileCardTitle {
    font-weight: 500;
    color: var(--color-text-primary);
    font-size: 0.925rem;
  }

  .mobileCardMeta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    flex-wrap: wrap;
  }

  .mobileCardActions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.25rem;
  }
}
