/* ═══════════════════════════════════════════════════════════════
   EVIDENT — Empty States
   
   First-time UX, zero-data states, and error recovery.
   Illustrations + actionable CTAs for better engagement.
   ═══════════════════════════════════════════════════════════════ */

/* ── Base Empty State ───────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 3rem 1.5rem;
  max-width: 480px;
  margin: 0 auto;
}

.empty-state--inline {
  padding: 2rem 1rem;
}

.empty-state--compact {
  padding: 1.5rem 1rem;
}

.empty-state--large {
  padding: 5rem 2rem;
  max-width: 600px;
}

/* ── Illustrations ──────────────────────────────────────────── */
.empty-state__illustration {
  width: 160px;
  height: 160px;
  margin-bottom: 1.5rem;
  color: var(--text-muted, #9ca3af);
}

.empty-state--compact .empty-state__illustration {
  width: 80px;
  height: 80px;
  margin-bottom: 1rem;
}

.empty-state--large .empty-state__illustration {
  width: 200px;
  height: 200px;
  margin-bottom: 2rem;
}

/* Icon variants */
.empty-state__icon {
  width: 64px;
  height: 64px;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-elevated, #f3f4f6);
  border-radius: 50%;
  color: var(--text-muted, #9ca3af);
}

.empty-state__icon svg {
  width: 28px;
  height: 28px;
}

/* ── Typography ──────────────────────────────────────────────── */
.empty-state__title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary, #111827);
  margin: 0 0 0.5rem;
}

.empty-state--large .empty-state__title {
  font-size: 1.5rem;
}

.empty-state__description {
  font-size: 0.9375rem;
  color: var(--text-secondary, #6b7280);
  line-height: 1.6;
  margin: 0 0 1.5rem;
}

.empty-state--compact .empty-state__description {
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

/* ── Actions ──────────────────────────────────────────────────── */
.empty-state__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.empty-state__actions--stacked {
  flex-direction: column;
  align-items: center;
}

.empty-state__actions--stacked .btn {
  width: 100%;
  max-width: 280px;
}

/* ── Specific Empty States ─────────────────────────────────── */

/* No cases (dashboard) */
.empty-state--no-cases .empty-state__illustration {
  /* Custom case folder illustration */
}

/* No files (evidence) */
.empty-state--no-files .empty-state__illustration {
  /* Custom file/document illustration */
}

/* No search results */
.empty-state--no-results .empty-state__illustration {
  /* Custom search/magnifying glass illustration */
}

/* No notifications */
.empty-state--no-notifications .empty-state__illustration {
  /* Custom bell/notification illustration */
}

/* Error state */
.empty-state--error .empty-state__icon {
  background: #fee2e2;
  color: #ef4444;
}

.empty-state--error .empty-state__title {
  color: #dc2626;
}

/* Success/Complete state */
.empty-state--success .empty-state__icon {
  background: #d1fae5;
  color: #22c55e;
}

.empty-state--success .empty-state__title {
  color: #065f46;
}

/* ── First Run / Onboarding ──────────────────────────────────── */
.empty-state--first-run {
  background: linear-gradient(135deg, var(--surface-card, #fff) 0%, rgb(59 130 246 / 5%) 100%);
  border: 2px dashed var(--border-default, #e5e7eb);
  border-radius: var(--radius-lg, 12px);
  padding: 4rem 2rem;
}

.empty-state--first-run:hover {
  border-color: var(--color-primary, #3b82f6);
  background: linear-gradient(135deg, var(--surface-card, #fff) 0%, rgb(59 130 246 / 8%) 100%);
}

/* Quick start checklist */
.empty-state__checklist {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  text-align: left;
  width: 100%;
  max-width: 320px;
}

.empty-state__checklist-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-subtle, #f3f4f6);
}

.empty-state__checklist-item:last-child {
  border-bottom: none;
}

.empty-state__checklist-check {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #d1fae5;
  color: #22c55e;
  border-radius: 50%;
  flex-shrink: 0;
}

.empty-state__checklist-check--pending {
  background: var(--surface-elevated, #f3f4f6);
  color: var(--text-muted, #9ca3af);
}

.empty-state__checklist-text {
  font-size: 0.9375rem;
  color: var(--text-secondary, #6b7280);
}

.empty-state__checklist-text--complete {
  color: var(--text-muted, #9ca3af);
  text-decoration: line-through;
}

/* ── Feature Discovery ───────────────────────────────────────── */
.empty-state__feature-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  width: 100%;
  margin-top: 1.5rem;
}

.empty-state__feature-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem;
  background: var(--surface-elevated, #f9fafb);
  border: 1px solid var(--border-subtle, #e5e7eb);
  border-radius: var(--radius-md, 8px);
  text-decoration: none;
  transition: all 0.2s ease;
}

.empty-state__feature-card:hover {
  border-color: var(--color-primary, #3b82f6);
  box-shadow: var(--shadow-sm, 0 2px 8px rgb(0 0 0 / 5%));
}

.empty-state__feature-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border-radius: 12px;
  margin-bottom: 1rem;
  color: var(--color-primary, #3b82f6);
}

.empty-state__feature-title {
  font-weight: 600;
  color: var(--text-primary, #111827);
  margin: 0 0 0.25rem;
}

.empty-state__feature-desc {
  font-size: 0.875rem;
  color: var(--text-secondary, #6b7280);
  text-align: center;
  margin: 0;
}

/* ── Upgrade Prompt (in empty state) ─────────────────────────── */
.empty-state__upgrade {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 1px solid #f59e0b;
  border-radius: var(--radius-md, 8px);
}

.empty-state__upgrade-title {
  font-weight: 600;
  color: #92400e;
  margin: 0 0 0.25rem;
}

.empty-state__upgrade-text {
  font-size: 0.875rem;
  color: #a16207;
  margin: 0 0 0.75rem;
}

/* ── Error Recovery ─────────────────────────────────────────── */
.empty-state__error-details {
  margin: 1rem 0;
  padding: 1rem;
  background: #fee2e2;
  border-radius: var(--radius-md, 8px);
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  font-size: 0.8125rem;
  color: #991b1b;
  text-align: left;
  max-width: 100%;
  overflow-x: auto;
}

.empty-state__retry-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.empty-state__retry-btn .spinner {
  width: 16px;
  height: 16px;
}

/* ── Inline Empty (for lists) ───────────────────────────────── */
.empty-state--inline-list {
  flex-direction: row;
  justify-content: flex-start;
  text-align: left;
  padding: 1.5rem;
  gap: 1rem;
}

.empty-state--inline-list .empty-state__icon {
  margin: 0;
  width: 48px;
  height: 48px;
}

.empty-state--inline-list .empty-state__content {
  flex: 1;
}

.empty-state--inline-list .empty-state__title {
  margin-bottom: 0.25rem;
}

.empty-state--inline-list .empty-state__description {
  margin-bottom: 0.75rem;
}

/* ── Spotlight/Tour Tooltip ─────────────────────────────────── */
.empty-state__spotlight {
  position: relative;
  background: var(--color-primary, #3b82f6);
  color: white;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md, 8px);
  margin-bottom: 1.5rem;
}

.empty-state__spotlight::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid var(--color-primary, #3b82f6);
}

.empty-state__spotlight-title {
  font-weight: 600;
  margin: 0 0 0.25rem;
}

.empty-state__spotlight-text {
  font-size: 0.875rem;
  opacity: 0.9;
  margin: 0;
}

/* ── Loading Empty (skeleton) ──────────────────────────────── */
.empty-state--loading .empty-state__illustration {
  background: var(--loading-skeleton-base, #e5e7eb);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (width <= 640px) {
  .empty-state {
    padding: 2rem 1rem;
  }

  .empty-state--large {
    padding: 3rem 1.5rem;
  }

  .empty-state__feature-cards {
    grid-template-columns: 1fr;
  }

  .empty-state--first-run {
    padding: 2.5rem 1.5rem;
  }
}
