/* styles.css -- Big Minds Automations Visual */

/* === Reset & Base === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #0f172a;
  color: #e2e8f0;
  min-height: 100vh;
  padding: 40px 24px;
  -webkit-font-smoothing: antialiased;
}

/* === Layout === */
.container { max-width: 1100px; margin: 0 auto; }

/* === Header === */
.header { text-align: center; margin-bottom: 48px; }
.header h1 {
  font-size: 1.75rem;
  font-weight: 600;
  color: #f8fafc;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}
.header p {
  color: #94a3b8;
  font-size: 0.95rem;
  max-width: 500px;
  margin: 0 auto;
}

/* === Nav Pills === */
.nav-pills {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 40px;
}
.pill {
  padding: 8px 20px;
  border-radius: 24px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
  font-family: inherit;
  background: #1e293b;
  color: #94a3b8;
  border-color: #334155;
}
.pill:hover { border-color: #3b82f6; color: #e2e8f0; }
.pill.active { background: #3b82f6; color: white; border-color: #3b82f6; }

/* === Category Cards === */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 48px;
}

.category-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 24px 24px 24px 28px;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}
.category-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  border-radius: 12px 0 0 12px;
  background: var(--cat-color);
}
.category-card:hover {
  transform: translateY(-2px);
  border-color: var(--cat-color);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--cat-color) 10%, transparent);
}

.card-top { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 12px; }

.card-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--cat-color) 12%, transparent);
  color: var(--cat-color);
}
.card-icon svg { width: 22px; height: 22px; }

.card-title { font-size: 1.05rem; font-weight: 600; color: #f1f5f9; margin-bottom: 2px; }
.card-count { font-size: 0.8rem; color: #64748b; }
.card-desc { font-size: 0.88rem; color: #94a3b8; line-height: 1.55; }

/* === Category Detail View === */
.category-detail { animation: fadeIn 0.2s ease; }

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #3b82f6;
  font-size: 0.85rem;
  cursor: pointer;
  margin-bottom: 16px;
  font-weight: 500;
  background: none;
  border: none;
  font-family: inherit;
}
.back-btn:hover { color: #60a5fa; }
.back-btn svg { width: 16px; height: 16px; }

.detail-header { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.detail-header .card-icon { width: 36px; height: 36px; }
.detail-header .card-icon svg { width: 20px; height: 20px; }
.detail-header h2 { font-size: 1.3rem; font-weight: 600; color: #f1f5f9; }
.detail-subtitle { color: #94a3b8; font-size: 0.9rem; margin-bottom: 24px; }

/* === Automation Items === */
.automation-list { display: flex; flex-direction: column; gap: 10px; }

.automation-item {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 16px 20px;
  cursor: pointer;
  transition: all 0.2s;
}
.automation-item:hover { border-color: #475569; }
.automation-item.open { border-color: var(--cat-color, #3b82f6); }

.auto-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.auto-name { font-weight: 500; font-size: 0.95rem; color: #e2e8f0; }
.auto-trigger {
  font-size: 0.78rem; color: #64748b;
  display: flex; align-items: center; gap: 5px;
  flex-shrink: 0; white-space: nowrap;
}
.auto-trigger svg { width: 14px; height: 14px; opacity: 0.7; }
.auto-oneliner { font-size: 0.85rem; color: #94a3b8; margin-top: 4px; }

.auto-detail {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #1e293b;
  display: none;
  animation: fadeIn 0.2s ease;
}
.automation-item.open .auto-detail { display: block; }

.auto-chevron {
  width: 16px; height: 16px;
  color: #475569;
  transition: transform 0.2s;
  flex-shrink: 0;
}
.automation-item.open .auto-chevron { transform: rotate(90deg); }

/* === Detail Sections === */
.detail-section { margin-bottom: 14px; }
.detail-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  margin-bottom: 6px;
  font-weight: 600;
}
.detail-text { font-size: 0.85rem; color: #cbd5e1; line-height: 1.5; }
.detail-value {
  font-size: 0.85rem;
  color: var(--cat-color, #3b82f6);
  font-style: italic;
  line-height: 1.5;
}

/* === Flow Steps (horizontal) === */
.flow-steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 8px 0 16px;
  flex-wrap: wrap;
}
.flow-step {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 0.8rem;
  color: #cbd5e1;
  white-space: nowrap;
}
.flow-arrow { padding: 0 6px; color: #475569; display: flex; align-items: center; }
.flow-arrow svg { width: 16px; height: 16px; }

/* === Flow Steps (vertical, for 5+ steps) === */
.flow-steps.vertical {
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}
.flow-steps.vertical .flow-step { white-space: normal; }
.flow-steps.vertical .flow-arrow {
  padding: 4px 0 4px 20px;
  transform: rotate(90deg);
}

/* === System Badges === */
.system-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 4px;
  padding: 3px 10px;
  font-size: 0.75rem;
  color: #94a3b8;
}

/* === Systems Map === */
.systems-map-container { width: 100%; min-height: 500px; }
.systems-map-container svg { width: 100%; height: auto; }

.system-node rect {
  rx: 8; ry: 8;
  stroke-width: 1;
  transition: all 0.2s;
}
.system-node text {
  fill: #e2e8f0;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
}
.system-node.highlighted rect { stroke-width: 2; }
.system-node.dimmed { opacity: 0.2; }

.group-label {
  fill: #64748b;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.automation-node rect {
  fill: #1e293b;
  stroke: #334155;
  rx: 6; ry: 6;
  transition: all 0.2s;
}
.automation-node text {
  fill: #cbd5e1;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
}
.automation-node.highlighted rect { stroke-width: 2; fill: #253349; }
.automation-node.dimmed { opacity: 0.2; }

.link {
  fill: none;
  stroke: #334155;
  stroke-width: 1;
  transition: all 0.2s;
}
.link.highlighted { stroke: #3b82f6; stroke-width: 2; opacity: 1; }
.link.dimmed { opacity: 0.05; }

/* === Animations === */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === Responsive === */
@media (max-width: 700px) {
  body { padding: 24px 16px; }
  .category-grid { grid-template-columns: 1fr; }
  .flow-steps { flex-direction: column; align-items: flex-start; }
  .flow-steps .flow-arrow { transform: rotate(90deg); padding: 4px 0 4px 20px; }
  .auto-header { flex-direction: column; align-items: flex-start; gap: 4px; }
}
