/* ==========================================================================
   ACCELFLOWSYSTEMS DESIGN SYSTEM - DASHBOARD & GRAPH
   ========================================================================== */

/* Demo Banner */
.demo-banner {
  background-color: var(--ink-900);
  color: var(--slate-200);
  padding: 10px var(--space-5);
  font-size: var(--text-xs);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.demo-banner-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.demo-banner-badge {
  background: var(--accent);
  color: var(--white);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* Demo App Layout */
.demo-app-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 72px - 38px);
  background: var(--paper);
}

/* Demo Sidebar */
.demo-sidebar {
  background: var(--white);
  border-right: var(--border-light);
  padding: var(--space-5) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.demo-sidebar-section-title {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--slate-400);
  margin-bottom: var(--space-2);
  padding-left: var(--space-3);
}

.demo-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.demo-nav-item button,
.demo-nav-item a {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px var(--space-3);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--slate-600);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.demo-nav-item button:hover,
.demo-nav-item a:hover {
  background: var(--slate-100);
  color: var(--ink-950);
}

.demo-nav-item.active button,
.demo-nav-item.active a {
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 600;
}

.demo-nav-icon {
  width: 18px;
  height: 18px;
  margin-right: var(--space-3);
  flex-shrink: 0;
}

/* Demo Main Content */
.demo-main {
  padding: var(--space-8);
  overflow-y: auto;
  max-height: calc(100vh - 72px - 38px);
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

/* Graph Container */
.graph-container {
  width: 100%;
  height: 540px;
  background: var(--white);
  border: var(--border-light);
  border-radius: var(--radius-panel);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-subtle);
}

.graph-controls {
  position: absolute;
  bottom: var(--space-4);
  right: var(--space-4);
  display: flex;
  gap: var(--space-2);
  background: var(--white);
  border: var(--border-mid);
  padding: 4px;
  border-radius: var(--radius-button);
  box-shadow: var(--shadow-subtle);
  z-index: 10;
}

.graph-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--slate-600);
  background: transparent;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.graph-btn:hover {
  background: var(--slate-100);
  color: var(--ink-950);
}

.graph-legend {
  position: absolute;
  top: var(--space-4);
  left: var(--space-4);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border: var(--border-light);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  z-index: 10;
}

.graph-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--slate-600);
  font-weight: 500;
}

/* SVG Graph Elements */
svg.dependency-graph-canvas {
  width: 100%;
  height: 100%;
  user-select: none;
  cursor: grab;
}

svg.dependency-graph-canvas:active {
  cursor: grabbing;
}

.graph-edge {
  stroke: #DDE2E7;
  stroke-width: 1.5;
  stroke-linecap: round;
  transition: stroke var(--transition-normal), stroke-width var(--transition-normal);
}

.graph-edge.active {
  stroke: var(--accent);
  stroke-width: 2.5;
}

.graph-edge.scenario-affected {
  stroke: var(--danger);
  stroke-width: 2.5;
  stroke-dasharray: 4, 4;
  animation: dashAnimation 1s linear infinite;
}

@keyframes dashAnimation {
  from { stroke-dashoffset: 8; }
  to { stroke-dashoffset: 0; }
}

.graph-node {
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.graph-node:hover {
  transform: scale(1.04);
}

.graph-node circle, .graph-node rect {
  transition: stroke var(--transition-fast), fill var(--transition-fast), filter var(--transition-fast);
}

.graph-node text {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  fill: var(--ink-900);
  pointer-events: none;
}

.graph-node.dimmed {
  opacity: 0.25;
}

.graph-node.highlighted circle,
.graph-node.highlighted rect {
  stroke: var(--accent);
  stroke-width: 3px;
  filter: drop-shadow(0 0 6px rgba(49, 92, 255, 0.4));
}

.graph-node.affected circle,
.graph-node.affected rect {
  stroke: var(--danger);
  stroke-width: 3px;
  filter: drop-shadow(0 0 8px rgba(197, 58, 58, 0.5));
}

/* Scenario Simulator Card */
.scenario-panel {
  background: var(--ink-950);
  color: var(--white);
  border-radius: var(--radius-panel);
  border: var(--border-dark);
  padding: var(--space-8);
  position: relative;
  overflow: hidden;
}

.scenario-panel::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(197, 58, 58, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

/* Document Preview Modal */
.doc-preview-modal {
  position: fixed;
  inset: 0;
  background: rgba(11, 13, 16, 0.55);
  backdrop-filter: blur(4px);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.doc-preview-modal.is-visible {
  opacity: 1;
  visibility: visible;
}

.doc-preview-card {
  width: 100%;
  max-width: 640px;
  background: var(--white);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-modal);
  border: var(--border-light);
  overflow: hidden;
  transform: translateY(12px);
  transition: transform var(--transition-normal);
}

.doc-preview-modal.is-visible .doc-preview-card {
  transform: translateY(0);
}
