/* Dashboard Styles - Activity Feed + Pipeline Visualization */

/* ========================================
   Agent type indicator colors
   ======================================== */
:root {
  --agent-literature: #4a90d9;
  --agent-clinical: #2ecc71;
  --agent-structural: #9b59b6;
  --agent-synthesis: #e67e22;
  --pipeline-rejected: #e74c3c;
}


/* ========================================
   Activity Feed
   ======================================== */

.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 480px;
  overflow-y: auto;
}

/* Custom scrollbar for activity feed */
.activity-feed::-webkit-scrollbar {
  width: 4px;
}

.activity-feed::-webkit-scrollbar-track {
  background: var(--surface-1);
}

.activity-feed::-webkit-scrollbar-thumb {
  background: var(--border);
}

/* Activity feed status badge */
.activity-feed__status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.activity-feed__status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--agent-clinical);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}


/* Activity item */
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.25rem;
}

.activity-item__icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
}

.activity-item__icon::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  border-radius: 2px;
  background: var(--surface-0);
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
}

.activity-item__icon--literature {
  background: var(--agent-literature);
}

.activity-item__icon--clinical {
  background: var(--agent-clinical);
}

.activity-item__icon--structural {
  background: var(--agent-structural);
}

.activity-item__icon--synthesis {
  background: var(--agent-synthesis);
}

.activity-item__content {
  flex: 1;
  min-width: 0;
}

.activity-item__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  flex-wrap: wrap;
}

.activity-item__agent {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-variant: small-caps;
}

.activity-item__dot {
  color: var(--text-tertiary);
  font-size: 0.875rem;
}

.activity-item__protein {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--accent-primary);
  text-decoration: none;
  transition: color 0.15s ease;
}

.activity-item__protein:hover {
  color: var(--accent-secondary);
}

.activity-item__summary {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.activity-item__time {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-tertiary);
  white-space: nowrap;
  flex-shrink: 0;
  padding-top: 0.1rem;
}


/* Activity feed empty state */
.activity-feed__empty {
  padding: 3rem 2rem;
  text-align: center;
}

.activity-feed__empty p {
  color: var(--text-tertiary);
  font-size: 0.875rem;
  margin: 0;
}


/* ========================================
   Pipeline Visualization
   ======================================== */

.pipeline {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0 0;
  gap: 0;
}

.pipeline__step {
  flex: 1;
  text-align: center;
  position: relative;
}

/* Connecting line between steps */
.pipeline__step::after {
  content: '';
  position: absolute;
  top: 14px;
  left: calc(50% + 16px);
  right: calc(-50% + 16px);
  height: 2px;
  background: var(--border);
  z-index: 0;
}

.pipeline__step:last-child::after {
  display: none;
}

/* Completed step connecting line */
.pipeline__step.is-complete::after {
  background: var(--accent-primary);
}

/* Marker (circle) */
.pipeline__marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface-1);
  position: relative;
  z-index: 1;
  transition: all 0.2s ease;
}

/* Completed step marker */
.pipeline__step.is-complete .pipeline__marker {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

/* Checkmark for completed steps */
.pipeline__step.is-complete .pipeline__marker::before {
  content: '';
  display: block;
  width: 8px;
  height: 12px;
  border-right: 2px solid var(--surface-0);
  border-bottom: 2px solid var(--surface-0);
  transform: rotate(45deg) translate(-1px, -1px);
}

/* Active step marker */
.pipeline__step.is-active .pipeline__marker {
  border-color: var(--accent-primary);
  box-shadow: 0 0 12px var(--accent-glow);
}

/* Active step pulsing dot */
.pipeline__step.is-active .pipeline__marker::before {
  content: '';
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-primary);
  animation: pulse-dot 2s ease-in-out infinite;
}

/* Rejected step marker */
.pipeline__step.is-rejected .pipeline__marker {
  background: var(--pipeline-rejected);
  border-color: var(--pipeline-rejected);
}

.pipeline__step.is-rejected .pipeline__marker::before {
  content: '';
  display: block;
  width: 12px;
  height: 2px;
  background: var(--surface-0);
  border-radius: 1px;
}

/* Label below marker */
.pipeline__label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.4rem;
}

.pipeline__step.is-active .pipeline__label {
  color: var(--accent-primary);
  font-weight: 600;
}

.pipeline__step.is-complete .pipeline__label {
  color: var(--text-secondary);
}

.pipeline__step.is-rejected .pipeline__label {
  color: var(--pipeline-rejected);
  font-weight: 600;
}


/* ========================================
   Recent Hypotheses Section
   ======================================== */

.recent-hypotheses {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.hypothesis-card {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.hypothesis-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.hypothesis-card__protein {
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
}

.hypothesis-card__status {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.hypothesis-card__status--submitted {
  border-color: var(--text-tertiary);
  color: var(--text-tertiary);
}

.hypothesis-card__status--validating {
  border-color: var(--agent-literature);
  color: var(--agent-literature);
}

.hypothesis-card__status--validated {
  border-color: var(--agent-clinical);
  color: var(--agent-clinical);
}

.hypothesis-card__status--queued {
  border-color: var(--agent-synthesis);
  color: var(--agent-synthesis);
}

.hypothesis-card__status--folding {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.hypothesis-card__status--complete {
  border-color: var(--agent-clinical);
  color: var(--agent-clinical);
}

.hypothesis-card__status--rejected {
  border-color: var(--pipeline-rejected);
  color: var(--pipeline-rejected);
}


/* Recent hypotheses empty state */
.recent-hypotheses__empty {
  padding: 3rem 2rem;
  text-align: center;
}

.recent-hypotheses__empty p {
  color: var(--text-tertiary);
  font-size: 0.875rem;
  margin: 0;
}


/* ========================================
   Responsive
   ======================================== */

/* Stack pipeline vertically on small screens */
@media (max-width: 479px) {
  .pipeline {
    flex-direction: column;
    gap: 0.25rem;
  }

  .pipeline__step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-align: left;
  }

  .pipeline__step::after {
    content: '';
    position: absolute;
    top: calc(50% + 16px);
    bottom: calc(-50% + 16px);
    left: 14px;
    right: auto;
    width: 2px;
    height: auto;
  }

  .pipeline__step:last-child::after {
    display: none;
  }

  .pipeline__label {
    margin-top: 0;
    font-size: 0.6875rem;
  }

  .activity-item {
    flex-wrap: wrap;
  }

  .activity-item__time {
    width: 100%;
    padding-left: calc(32px + 1rem);
  }
}


/* ========================================
   Agent Findings on Fold Page
   ======================================== */

.agent-findings {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.agent-findings__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.agent-findings__count {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-primary);
  font-weight: 600;
}

.agent-findings__updated {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

/* Group container for each agent type */
.agent-findings__group {
  margin-bottom: 1.5rem;
}

.agent-findings__group:last-child {
  margin-bottom: 0;
}

.agent-findings__group-title {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-variant: small-caps;
  padding-bottom: 0.5rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.agent-findings__group-count {
  font-weight: 400;
  color: var(--text-tertiary);
}

/* Individual finding card */
.finding-card {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.finding-card:last-child {
  margin-bottom: 0;
}

.finding-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.finding-card__agent {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.5rem;
  border-radius: 2px;
}

.finding-card__agent--literature {
  background: var(--agent-literature);
  color: var(--surface-0);
}

.finding-card__agent--clinical {
  background: var(--agent-clinical);
  color: var(--surface-0);
}

.finding-card__agent--structural {
  background: var(--agent-structural);
  color: var(--surface-0);
}

.finding-card__agent--synthesis {
  background: var(--agent-synthesis);
  color: var(--surface-0);
}

.finding-card__summary {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

.finding-card__time {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-tertiary);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Empty state */
.agent-findings__empty {
  text-align: center;
  padding: 2rem 1.5rem;
  color: var(--text-tertiary);
  font-size: 0.875rem;
}

/* Loading state with opacity pulse */
.agent-findings__loading {
  text-align: center;
  padding: 2rem 1.5rem;
  color: var(--text-tertiary);
  font-size: 0.875rem;
  animation: findings-pulse 1.5s ease-in-out infinite;
}

@keyframes findings-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Responsive adjustments for findings */
@media (max-width: 479px) {
  .finding-card__header {
    flex-wrap: wrap;
  }

  .finding-card__time {
    width: 100%;
  }
}
