/* ===================================================================
   NEXUS AGENTS — N8N STYLE INNER PAGES & PRODUCT STYLES
   Agents, Products, Features, Playground, Pricing, Docs, Contact, Settings
   =================================================================== */

/* Agent Fleet Cards — Crisp Boxy n8n Aesthetics */
.agent-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 24px;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: 0px;
  transition: all 0.2s ease;
  box-shadow: none;
}

.agent-card:hover {
  border-color: var(--n8n-coral);
  transform: translateY(-2px);
  box-shadow: none;
}

.ac-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 12px;
}

.agent-icon {
  width: 48px;
  height: 48px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: 0px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--n8n-coral);
  flex-shrink: 0;
  box-shadow: none;
}

.agent-card h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.agent-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  flex-grow: 1;
  margin-bottom: 22px;
  line-height: 1.6;
}

.agent-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.agent-stats .n {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--n8n-coral);
}

.agent-stats .l {
  font-size: 0.72rem;
  color: var(--text-faint);
  margin-top: 2px;
}

/* Feature Rows & Architecture Highlights */
.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(28px, 5vw, 56px);
  align-items: center;
  padding: clamp(32px, 5vw, 64px) 0;
  border-bottom: 1px solid var(--border);
}

.feature-row:last-child {
  border-bottom: none;
}

.feature-row.reverse {
  direction: rtl;
}
.feature-row.reverse > * {
  direction: ltr;
}

.feature-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 20px 0 24px;
}

.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.feature-list svg {
  width: 20px;
  height: 20px;
  color: var(--emerald);
  flex-shrink: 0;
  margin-top: 2px;
}

/* Product Specific Metrics & Capability Cards */
.metrics-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 24px;
  margin-bottom: 32px;
}

.metric-card {
  padding: 18px 20px;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: 0px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.metric-card .m-val {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--n8n-coral);
}

.metric-card .m-lbl {
  font-size: 0.78rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.capability-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.capability-box {
  padding: 24px;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: 0px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.2s ease;
}

.capability-box:hover {
  border-color: var(--n8n-coral);
}

.capability-box .cap-icon {
  width: 40px;
  height: 40px;
  background: var(--surface-raised);
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--n8n-coral);
}

.capability-box h4 {
  font-size: 1.05rem;
  color: var(--text);
}

.capability-box p {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Workflow Pipeline Integration Nodes (n8n Aesthetic) */
.workflow-pipeline {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow-x: auto;
  padding: 20px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 0px;
  margin-top: 20px;
}

.wf-node {
  padding: 12px 18px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 0px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--text);
  border-left: 3px solid var(--n8n-coral);
}

.wf-arrow {
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 1.1rem;
}

/* Interactive Playground Grid — n8n Boxy Console Feel */
.playground-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: clamp(20px, 3vw, 32px);
  align-items: start;
}

.agent-selector-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.agent-select-item {
  padding: 14px 18px;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: 0px;
  cursor: pointer;
  min-height: var(--touch-target-min);
  transition: all 0.2s ease;
}

.agent-select-item:hover {
  border-color: var(--border-strong);
  background: var(--surface-raised);
  transform: translateX(2px);
}

.agent-select-item.active {
  border-color: var(--n8n-coral);
  background: rgba(255, 109, 90, 0.1);
  box-shadow: none;
  border-left: 3px solid var(--n8n-coral);
}

.agent-select-item h4 {
  font-size: 0.95rem;
  margin-bottom: 4px;
  color: var(--text);
}

.agent-select-item p {
  font-size: 0.8rem;
  color: var(--text-faint);
}

.chat-simulator {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: 0px;
  display: flex;
  flex-direction: column;
  height: clamp(450px, 65vh, 600px);
  max-width: 100%;
  box-shadow: none;
  overflow: hidden;
}

.chat-header {
  padding: 16px 22px;
  background: var(--surface-raised);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chat-messages {
  flex-grow: 1;
  padding: 22px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.msg {
  max-width: 85%;
  padding: 12px 18px;
  border-radius: 0px;
  font-size: 0.88rem;
  line-height: 1.6;
  word-break: break-word;
  box-shadow: none;
}

.msg.user {
  align-self: flex-end;
  background: var(--n8n-coral);
  color: #FFFFFF;
  border: 1px solid var(--n8n-coral);
}

.msg.agent {
  align-self: flex-start;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  color: var(--text);
}

.msg.system {
  align-self: center;
  background: rgba(255, 109, 90, 0.08);
  border: 1px solid rgba(255, 109, 90, 0.25);
  color: var(--n8n-coral);
  font-size: 0.8rem;
  font-family: var(--font-mono);
  border-radius: 0px;
  padding: 6px 16px;
}

.chat-input-area {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
  background: var(--surface);
}

.chat-input-area input {
  flex-grow: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 0px;
  padding: 10px 18px;
  color: var(--text);
  min-height: 42px;
  transition: all 0.2s ease;
}

.chat-input-area input:focus {
  border-color: var(--n8n-coral);
  box-shadow: none;
  outline: none;
}

/* Pricing Grid — Crisp Boxy Cards */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(20px, 3vw, 28px);
  align-items: stretch;
}

.pricing-card {
  display: flex;
  flex-direction: column;
  position: relative;
  height: 100%;
  padding: 28px;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: 0px;
  transition: border-color 0.2s ease;
}

.pricing-card:hover {
  transform: translateY(-2px);
  border-color: var(--n8n-coral);
  box-shadow: none;
}

.pricing-card.featured {
  border-color: var(--n8n-coral);
  background: rgba(255, 109, 90, 0.04);
  box-shadow: none;
}

.price-title {
  font-size: 1.35rem;
  margin-bottom: 8px;
  color: var(--text);
}

.price-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.price-amount {
  font-family: var(--font-mono);
  font-size: clamp(2rem, 3.5vw, 2.6rem);
  font-weight: 800;
  color: var(--text);
  margin-bottom: 24px;
}

.price-amount span {
  font-size: 0.9rem;
  color: var(--text-faint);
  font-weight: 400;
}

.price-features {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
  flex-grow: 1;
}

.price-features li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.price-features svg {
  width: 18px;
  height: 18px;
  color: var(--emerald);
  flex-shrink: 0;
}

/* Developer Docs Layout */
.docs-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: clamp(24px, 4vw, 44px);
}

.docs-sidebar {
  position: sticky;
  top: calc(var(--topbar-height) + 20px);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.docs-nav-item {
  padding: 10px 16px;
  font-size: 0.88rem;
  color: var(--text-muted);
  border-radius: 0px;
  min-height: 40px;
  display: flex;
  align-items: center;
  transition: all 0.2s ease;
  border-left: 2px solid transparent;
}

.docs-nav-item:hover, .docs-nav-item.active {
  background: rgba(255, 109, 90, 0.1);
  color: var(--n8n-coral);
  font-weight: 600;
  border-left: 2px solid var(--n8n-coral);
}

.docs-content {
  display: flex;
  flex-direction: column;
  gap: 40px;
  min-width: 0;
}

.docs-block {
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.docs-block:last-child {
  border-bottom: none;
}

/* Contact Layout */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 4vw, 44px);
}

.contact-card {
  display: flex;
  gap: 16px;
  padding: 22px;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: 0px;
  margin-bottom: 20px;
  transition: border-color 0.2s ease;
}

.contact-card:hover {
  border-color: var(--n8n-coral);
  box-shadow: none;
}

.contact-card-icon {
  width: 48px;
  height: 48px;
  background: var(--emerald-soft);
  border: 1px solid var(--emerald-border);
  color: var(--emerald);
  border-radius: 0px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Settings Toggle Rows */
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
  gap: 16px;
}

.settings-row:last-child {
  border-bottom: none;
}

.settings-row h4 {
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.settings-row p {
  font-size: 0.84rem;
  color: var(--text-muted);
}

.toggle {
  width: 48px;
  height: 26px;
  border-radius: 0px;
  background: var(--surface-raised);
  border: 1px solid var(--border-strong);
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.toggle.on {
  background: var(--n8n-coral);
  border-color: var(--n8n-coral);
  box-shadow: none;
}

.toggle::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 0px;
  background: #FFFFFF;
  top: 2px;
  left: 2px;
  transition: transform 0.2s ease;
}

.toggle.on::after {
  transform: translateX(22px);
}

/* Responsive Overrides */
@media (max-width: 1024px) {
  .feature-row { grid-template-columns: 1fr; gap: 24px; }
  .feature-row.reverse { direction: ltr; }
  .playground-grid { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
  .docs-grid { grid-template-columns: 1fr; }
  .docs-sidebar { 
    position: static; 
    display: flex; 
    flex-direction: row; 
    overflow-x: auto; 
    gap: 8px; 
    padding-bottom: 8px; 
    border-bottom: 1px solid var(--border); 
    margin-bottom: 24px;
    -webkit-overflow-scrolling: touch;
  }
  .docs-nav-item { white-space: nowrap; flex-shrink: 0; }
  .contact-grid { grid-template-columns: 1fr; gap: 28px; }
  .workflow-pipeline { flex-direction: column; align-items: stretch; }
  .wf-arrow { text-align: center; transform: rotate(90deg); margin: 4px 0; }
}

@media (max-width: 768px) {
  .chat-simulator { height: clamp(380px, 55vh, 500px); }
  .msg { max-width: 92%; }
}

@media (max-width: 480px) {
  .agent-stats { grid-template-columns: repeat(3, 1fr); gap: 4px; padding-top: 12px; }
  .agent-stats .n { font-size: 0.82rem; }
  .agent-stats .l { font-size: 0.65rem; }
}