/* Edit Mode — site-wide card cleanup UI */

/* ── Edit toggle button in nav ── */
.edit-mode-toggle {
  display: none; /* shown by JS when admin */
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-display, system-ui);
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  border: 1px solid var(--border-subtle, #d0d0d0);
  cursor: pointer;
  background: transparent;
  color: var(--text-muted, #888);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.edit-mode-toggle:hover {
  background: var(--bg-secondary, #f5f5f5);
  color: var(--text-primary, #111);
}
.edit-mode-toggle.active {
  background: #dc2626;
  color: #fff;
  border-color: #dc2626;
}
.edit-mode-toggle .edit-icon::before {
  content: "\270E"; /* pencil */
}
.edit-mode-toggle.active .edit-icon::before {
  content: "\2715"; /* X */
}

/* ── Card overlays in edit mode ── */
body.edit-mode .mono-card,
body.edit-mode .mono-feed-card {
  position: relative;
}
body.edit-mode .mono-card .edit-hide-btn,
body.edit-mode .mono-feed-card .edit-hide-btn {
  display: flex;
}

.edit-hide-btn {
  display: none;
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 2rem;
  height: 2rem;
  align-items: center;
  justify-content: center;
  background: rgba(220, 38, 38, 0.9);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  z-index: 20;
  font-size: 0.875rem;
  line-height: 1;
  transition: background 0.15s, transform 0.15s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.edit-hide-btn:hover {
  background: #dc2626;
  transform: scale(1.15);
}

/* Prevent card navigation in edit mode */
body.edit-mode .mono-card,
body.edit-mode .mono-feed-card {
  pointer-events: none;
}
body.edit-mode .mono-card .edit-hide-btn,
body.edit-mode .mono-feed-card .edit-hide-btn {
  pointer-events: auto;
}

/* Subtle edit mode indicator on cards */
body.edit-mode .mono-card::after,
body.edit-mode .mono-feed-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px dashed rgba(220, 38, 38, 0.3);
  border-radius: inherit;
  pointer-events: none;
  z-index: 10;
}

/* ── Hide animation ── */
.edit-hiding {
  transition: opacity 0.3s ease, transform 0.3s ease;
  opacity: 0 !important;
  transform: scale(0.9) !important;
}

/* ── Auto-hidden cards (localStorage filter) ── */
.edit-auto-hidden {
  display: none !important;
}

/* ── Hidden cards panel ── */
.edit-hidden-panel {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 9999;
  font-family: var(--font-display, system-ui);
  max-width: 320px;
}

.edit-hidden-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #1a1a1a;
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  transition: background 0.15s;
  border: 1px solid #333;
}
.edit-hidden-badge:hover {
  background: #2a2a2a;
}
.edit-hidden-count {
  background: #dc2626;
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: 10px;
  min-width: 1.25rem;
  text-align: center;
}

.edit-hidden-list {
  display: none;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  max-height: 300px;
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}
.edit-hidden-list.open {
  display: block;
}

.edit-hidden-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid #333;
  font-size: 0.75rem;
  color: #888;
}
.edit-hidden-list-actions {
  display: flex;
  gap: 0.35rem;
}
.edit-hidden-list-actions button {
  font-family: inherit;
  font-size: 0.6875rem;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  border: 1px solid #555;
  background: transparent;
  color: #aaa;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.edit-hidden-list-actions button:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.edit-hidden-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid #222;
  font-size: 0.75rem;
  color: #ccc;
}
.edit-hidden-item:last-child {
  border-bottom: none;
}
.edit-hidden-item-slug {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  margin-right: 0.5rem;
}
.edit-hidden-item button {
  font-family: inherit;
  font-size: 0.625rem;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  border: 1px solid #555;
  background: transparent;
  color: #888;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.edit-hidden-item button:hover {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border-color: #22c55e;
}

/* Empty state */
.edit-hidden-empty {
  padding: 1rem 0.75rem;
  text-align: center;
  font-size: 0.75rem;
  color: #666;
  font-style: italic;
}
