/* ============================================================
   css/pages/report.css — CommunityRX
   Estilos de layout das páginas de relatório e dashboard.
   Design system (score-pill, card, mono, etc.) vem do RXCore.
   ============================================================ */

/* ── Contentor global ───────────────────────────────────────── */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.25rem 1rem 4rem;
}

/* ── Submit / upload ────────────────────────────────────────── */
.submit-section {
  margin-bottom: 2rem;
}

.submit-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3, #888898);
  margin-bottom: 0.375rem;
}

.submit-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text, #e8e8f0);
  margin-bottom: 0.875rem;
}

.submit-form {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.submit-input-wrap {
  flex: 1;
  position: relative;
}

.rx-input--file {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--wire, #ffffff1e);
  border-radius: 10px;
  background: var(--ink-2, #16161f);
  color: var(--text-2, #b8b8cc);
  font-size: 0.875rem;
  padding: 0 0.875rem;
  box-sizing: border-box;
  transition: border-color 0.15s;
}

.rx-input--file:hover,
.rx-input--file:focus-within {
  border-color: var(--amber, #f5a623);
}

.submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 1rem;
  min-height: 44px;
  background: var(--amber, #f5a623);
  color: var(--amber-ink, #1a0f00);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.875rem;
  transition: opacity 0.15s;
  flex-shrink: 0;
}

.submit-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Análises (lista) ───────────────────────────────────────── */
.analyses-header {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.analyses-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text, #e8e8f0);
}

.filter-bar-wrap { margin-bottom: 0.75rem; }

.filter-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.sort-controls { display: flex; gap: 0.375rem; }

.filter-bar-actions { display: flex; gap: 0.375rem; align-items: center; }

.manage-btn,
.bulk-delete-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.625rem;
  border: 1px solid var(--wire, #ffffff1e);
  border-radius: 8px;
  background: transparent;
  color: var(--text-2, #b8b8cc);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.manage-btn:hover { border-color: var(--amber); color: var(--amber); }
.bulk-delete-btn:hover { border-color: var(--red, #ef4444); color: var(--red, #ef4444); }

.bulk-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--amber);
  color: var(--amber-ink, #1a0f00);
  font-size: 0.625rem;
  font-weight: 700;
}

/* ── Analysis card ──────────────────────────────────────────── */
.analysis-card {
  border: 1px solid var(--wire, #ffffff1e);
  border-radius: 12px;
  background: var(--ink-2, #16161f);
  margin-bottom: 0.625rem;
  overflow: hidden;
  position: relative;
  transition: border-color 0.15s;
}

.analysis-card:hover { border-color: var(--wire-2, #ffffff33); }
.analysis-card.selected { border-color: var(--amber, #f5a623); }
.analysis-card.error { border-color: var(--red-wire, rgba(239,68,68,.35)); }

.analysis-card-clickable { padding: 0.875rem 1rem; cursor: default; }
.analysis-card-clickable.is-done { cursor: pointer; }

.analysis-card-header {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.analysis-checkbox {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--wire-2, #ffffff33);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  color: var(--amber-ink, #1a0f00);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.1s, border-color 0.1s;
}

.analysis-checkbox.checked {
  background: var(--amber);
  border-color: var(--amber);
}

.analysis-left { flex: 1; min-width: 0; }

.analysis-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text, #e8e8f0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.analysis-meta {
  font-size: 0.75rem;
  color: var(--text-3, #888898);
  margin-top: 0.125rem;
}

.analysis-score-inline {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
  flex-shrink: 0;
}

.analysis-date.analysis-date-top {
  position: absolute;
  top: 0.625rem;
  right: 0.875rem;
  font-size: 0.6875rem;
  color: var(--text-3, #888898);
}

/* ── Progress ───────────────────────────────────────────────── */
.analysis-progress { margin-top: 0.625rem; }

.analysis-progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-3);
  margin-bottom: 0.25rem;
}

.analysis-progress-bar {
  height: 3px;
  background: var(--wire);
  border-radius: 2px;
  overflow: hidden;
}

.analysis-progress-fill {
  height: 100%;
  background: var(--amber);
  border-radius: 2px;
  transition: width 0.4s ease;
}

.analysis-progress-fill.indeterminate {
  width: 40% !important;
  animation: indeterminate 1.4s ease infinite;
}

@keyframes indeterminate {
  0%  { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

/* ── Card body (expanded) ───────────────────────────────────── */
.analysis-card-body {
  border-top: 1px solid var(--wire);
  padding: 0.75rem 1rem;
}

.analysis-card-body-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.analysis-view-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.4375rem 0.875rem;
  border-radius: 8px;
  background: var(--amber);
  color: var(--amber-ink, #1a0f00);
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s;
}

.analysis-view-btn:hover { opacity: 0.85; }

/* ── Empty / skeleton ───────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-3);
}

.empty-icon { margin-bottom: 1rem; color: var(--wire-2); }
.empty-title { font-size: 1rem; font-weight: 600; color: var(--text-2); margin-bottom: 0.375rem; }
.empty-body { font-size: 0.875rem; }

.skeleton-card {
  border: 1px solid var(--wire);
  border-radius: 12px;
  background: var(--ink-2);
  padding: 0.875rem 1rem;
  margin-bottom: 0.625rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.skeleton {
  background: var(--wire);
  border-radius: 4px;
  animation: shimmer 1.2s ease infinite alternate;
}

@keyframes shimmer {
  from { opacity: 0.5; }
  to   { opacity: 1; }
}

/* ── Report page ────────────────────────────────────────────── */
.report-page { max-width: 640px; margin: 0 auto; padding: 1.25rem; }

.report-page .section-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 0.75rem;
}

.report-page .card {
  background: var(--ink-2);
  border: 1px solid var(--wire);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 0.625rem;
}

.report-page .card-danger { border-color: rgba(239,68,68,.45); }
.report-page .card-warning { border-color: rgba(245,158,11,.45); }
.report-page .card-info { border-color: var(--wire-2); }

.report-page section { margin-bottom: 1.5rem; }

.report-page .mono { font-family: 'DM Mono', monospace; }

/* ── Status badge ───────────────────────────────────────────── */
.analysis-status-badge {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-done     { background: var(--green, #22c55e); }
.status-pending,
.status-processing { background: var(--amber, #f5a623); animation: pulse 1.2s ease infinite alternate; }
.status-error,
.status-failed   { background: var(--red, #ef4444); }

@keyframes pulse {
  from { opacity: 0.5; }
  to   { opacity: 1; }
}

/* ── Error banner ───────────────────────────────────────────── */
.error-banner {
  display: none;
  background: rgba(239,68,68,.12);
  border: 1px solid rgba(239,68,68,.35);
  color: var(--red, #ef4444);
  border-radius: 8px;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

/* ── Nav (CommunityRX override) ─────────────────────────────── */
.nav-logo { font-size: 1rem; font-weight: 800; color: var(--text); text-decoration: none; }
.nav-logo span { color: var(--amber); }

/* ── Mobile ─────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .container { padding: 1rem 0.75rem 4rem; }
  .submit-form { flex-direction: column; }
  .submit-btn { width: 100%; }
  .analysis-date.analysis-date-top { display: none; }
}