/* ============================================
   CraigClaw Components — alive & industrial
   ============================================ */

/* ---- Animations ---- */
@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 0 0 rgba(63, 185, 80, 0.5); }
  50% { box-shadow: 0 0 0 4px rgba(63, 185, 80, 0); }
}

@keyframes pulse-amber {
  0%, 100% { box-shadow: 0 0 0 0 rgba(210, 153, 34, 0.5); }
  50% { box-shadow: 0 0 0 4px rgba(210, 153, 34, 0); }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slide-in {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Staggered card entrance */
.animate-in {
  animation: fade-up 350ms ease forwards;
  opacity: 0;
}

.animate-in:nth-child(1) { animation-delay: 0ms; }
.animate-in:nth-child(2) { animation-delay: 60ms; }
.animate-in:nth-child(3) { animation-delay: 120ms; }
.animate-in:nth-child(4) { animation-delay: 180ms; }
.animate-in:nth-child(5) { animation-delay: 240ms; }
.animate-in:nth-child(6) { animation-delay: 300ms; }
.animate-in:nth-child(7) { animation-delay: 360ms; }
.animate-in:nth-child(8) { animation-delay: 420ms; }

/* ---- Status Dots ---- */
.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-green {
  background: var(--green);
  animation: pulse-green 2s ease-in-out infinite;
}

.dot-amber {
  background: var(--amber);
  animation: pulse-amber 2s ease-in-out infinite;
}

.dot-red {
  background: var(--red);
}

.dot-blue {
  background: var(--blue);
}

.dot-sm {
  width: 6px;
  height: 6px;
}

/* ---- Greeting ---- */
.greeting {
  margin-bottom: 24px;
}

.greeting-text {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

.greeting-sub {
  font-size: 13px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  margin-top: 2px;
}

/* ---- Stat Cards — colored accents ---- */
.stat-card {
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
}

.stat-card:hover {
  border-color: var(--border-light);
  transform: translateY(-1px);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
}

.stat-card.stat-blue::before { background: var(--blue); }
.stat-card.stat-green::before { background: var(--green); }
.stat-card.stat-amber::before { background: var(--amber); }
.stat-card.stat-purple::before { background: var(--purple); }
.stat-card.stat-red::before { background: var(--red); }
.stat-card.stat-cyan::before { background: var(--cyan); }
.stat-card.stat-orange::before { background: var(--orange); }

.stat-card .stat-icon {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 20px;
  height: 20px;
  color: var(--text-tertiary);
  opacity: 0.5;
}

.stat-card .stat-value {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.stat-val-main {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
}

.stat-val-secondary {
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--text-tertiary);
}

.stat-val-green { color: var(--green); }
.stat-val-amber { color: var(--amber); }
.stat-val-red { color: var(--red); }
.stat-val-blue { color: var(--blue); }
.stat-val-purple { color: var(--purple); }

/* ---- Project Tags ---- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.tag-blue   { background: var(--blue-dim);   color: var(--blue); }
.tag-green  { background: var(--green-dim);  color: var(--green); }
.tag-amber  { background: var(--amber-dim);  color: var(--amber); }
.tag-red    { background: var(--red-dim);    color: var(--red); }
.tag-purple { background: var(--purple-dim); color: var(--purple); }
.tag-cyan   { background: var(--cyan-dim);   color: var(--cyan); }
.tag-orange { background: var(--orange-dim); color: var(--orange); }

/* ---- Task List ---- */
.task-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  cursor: default;
}

.task-item:hover {
  background: var(--bg-hover);
}

.task-check {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  border: 1.5px solid var(--border-light);
  flex-shrink: 0;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.task-check:hover {
  border-color: var(--green);
}

.task-check.checked {
  background: var(--green);
  border-color: var(--green);
}

.task-check.checked svg {
  width: 10px;
  height: 10px;
  color: #fff;
}

.task-text {
  font-size: 13px;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
}

.task-text.done {
  text-decoration: line-through;
  color: var(--text-tertiary);
}

.task-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* ---- Fleet Mini Cards ---- */
.fleet-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.fleet-unit {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  transition: all var(--transition);
}

.fleet-unit:hover {
  border-color: var(--border-light);
  background: var(--bg-hover);
}

.fleet-unit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.fleet-unit-name {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.fleet-unit-ip {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
}

.fleet-unit-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-secondary);
}

/* ---- Activity Feed ---- */
.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

.activity-feed::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: var(--border);
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  position: relative;
  animation: slide-in 300ms ease forwards;
  opacity: 0;
}

.activity-item:nth-child(1) { animation-delay: 50ms; }
.activity-item:nth-child(2) { animation-delay: 100ms; }
.activity-item:nth-child(3) { animation-delay: 150ms; }
.activity-item:nth-child(4) { animation-delay: 200ms; }
.activity-item:nth-child(5) { animation-delay: 250ms; }

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
  z-index: 1;
  border: 2px solid var(--card-bg);
  outline: 1px solid var(--border);
}

.activity-dot.dot-color-blue   { background: var(--blue); outline-color: var(--blue-dim); }
.activity-dot.dot-color-green  { background: var(--green); outline-color: var(--green-dim); }
.activity-dot.dot-color-amber  { background: var(--amber); outline-color: var(--amber-dim); }
.activity-dot.dot-color-red    { background: var(--red); outline-color: var(--red-dim); }
.activity-dot.dot-color-purple { background: var(--purple); outline-color: var(--purple-dim); }
.activity-dot.dot-color-cyan   { background: var(--cyan); outline-color: var(--cyan-dim); }

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

.activity-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.activity-text strong {
  color: var(--text-primary);
  font-weight: 600;
}

.activity-time {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-tertiary);
  margin-top: 1px;
}

/* ---- Quick Actions Bar ---- */
.quick-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.quick-action {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.quick-action:hover {
  background: var(--bg-hover);
  border-color: var(--border-light);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.quick-action svg {
  width: 16px;
  height: 16px;
}

.quick-action.qa-green:hover  { border-color: var(--green); color: var(--green); }
.quick-action.qa-amber:hover  { border-color: var(--amber); color: var(--amber); }
.quick-action.qa-blue:hover   { border-color: var(--blue); color: var(--blue); }
.quick-action.qa-purple:hover { border-color: var(--purple); color: var(--purple); }

/* ---- Progress Bar ---- */
.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 500ms ease;
}

.progress-blue   .progress-fill { background: var(--blue); }
.progress-green  .progress-fill { background: var(--green); }
.progress-amber  .progress-fill { background: var(--amber); }
.progress-red    .progress-fill { background: var(--red); }
.progress-purple .progress-fill { background: var(--purple); }
.progress-cyan   .progress-fill { background: var(--cyan); }

/* ---- Section Headers inside cards ---- */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.section-title svg {
  width: 14px;
  height: 14px;
  color: var(--text-tertiary);
}

.section-link {
  font-size: 12px;
  color: var(--blue);
  text-decoration: none;
  font-weight: 500;
}

.section-link:hover {
  text-decoration: underline;
}

/* ---- Dashboard Grid ---- */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 900px) {
  .dash-grid { grid-template-columns: 1fr; }
  .fleet-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .quick-actions { flex-direction: column; }
  .quick-action { justify-content: center; }
}
