/**
 * EA Topology Styles
 * Migrated from Netlify Bank 16,000 EA visualization
 * Scoped under #enterprise-architecture-content to avoid conflicts
 */

/* CSS Custom Properties for EA */
#enterprise-architecture-content {
  --ea-bg: #f8f9fa; --ea-card: #ffffff; --ea-border: #dee2e6;
  --ea-text: #212529; --ea-muted: #6c757d; --ea-accent: #0d6efd;
  --ea-front: #198754; --ea-middle: #fd7e14; --ea-back: #6f42c1;
  --ea-corp: #0dcaf0; --ea-tech: #dc3545; --ea-digital: #20c997;
  --ea-shadow: 0 1px 3px rgba(0,0,0,.12);
}

/* EA Panel base */
#enterprise-architecture-content .ea-diagram {
  padding: 24px;
  max-width: 1600px;
  margin: 0 auto;
}
#enterprise-architecture-content .ea-diagram h2 {
  font-size: 22px;
  margin-bottom: 4px;
  color: var(--ea-text);
}
#enterprise-architecture-content .ea-diagram .ea-subtitle {
  color: var(--ea-muted);
  margin-bottom: 20px;
  font-size: 14px;
}

/* UML Package Box */
#enterprise-architecture-content .pkg {
  border: 2px solid #333;
  border-radius: 3px;
  margin: 8px;
  background: var(--ea-card);
  box-shadow: var(--ea-shadow);
  position: relative;
}
#enterprise-architecture-content .pkg-tab {
  position: absolute; top: -14px; left: 8px;
  background: inherit;
  border: 2px solid #333; border-bottom: 2px solid var(--ea-card);
  border-radius: 3px 3px 0 0;
  padding: 1px 10px; font-size: 11px; font-weight: 700; color: #333;
}
#enterprise-architecture-content .pkg-body {
  padding: 20px 12px 12px;
}

/* UML Class Box */
#enterprise-architecture-content .ea-cls {
  border: 2px solid #333;
  border-radius: 2px;
  background: var(--ea-card);
  box-shadow: var(--ea-shadow);
  min-width: 180px;
  display: inline-block;
  vertical-align: top;
  margin: 6px;
}
#enterprise-architecture-content .ea-cls-name {
  background: #e9ecef;
  padding: 6px 10px;
  font-weight: 700;
  font-size: 13px;
  border-bottom: 2px solid #333;
  text-align: center;
}
#enterprise-architecture-content .ea-cls-attrs {
  padding: 6px 10px;
  font-size: 12px;
  border-bottom: 1px solid #ccc;
}
#enterprise-architecture-content .ea-cls-ops {
  padding: 6px 10px;
  font-size: 12px;
  font-style: italic;
  color: var(--ea-muted);
}
#enterprise-architecture-content .ea-cls-attrs div,
#enterprise-architecture-content .ea-cls-ops div {
  padding: 1px 0;
}

/* Component boxes */
#enterprise-architecture-content .ea-comp {
  border: 2px solid #333;
  border-radius: 4px;
  background: var(--ea-card);
  box-shadow: var(--ea-shadow);
  padding: 10px 14px;
  margin: 6px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
  min-width: 200px;
}
#enterprise-architecture-content .ea-comp-icon {
  width: 28px; height: 28px;
  border: 2px solid #333; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; flex-shrink: 0;
}
#enterprise-architecture-content .ea-comp-text {
  font-size: 12px;
}
#enterprise-architecture-content .ea-comp-text strong {
  display: block; font-size: 13px;
}

/* Grid layouts */
#enterprise-architecture-content .ea-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
#enterprise-architecture-content .ea-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
#enterprise-architecture-content .ea-flex-wrap { display: flex; flex-wrap: wrap; gap: 8px; }

/* Division colors */
#enterprise-architecture-content .div-front { border-color: var(--ea-front); }
#enterprise-architecture-content .div-front .pkg-tab,
#enterprise-architecture-content .div-front .ea-cls-name { border-color: var(--ea-front); background: #d1e7dd; }
#enterprise-architecture-content .div-middle { border-color: var(--ea-middle); }
#enterprise-architecture-content .div-middle .pkg-tab,
#enterprise-architecture-content .div-middle .ea-cls-name { border-color: var(--ea-middle); background: #ffe5d0; }
#enterprise-architecture-content .div-back { border-color: var(--ea-back); }
#enterprise-architecture-content .div-back .pkg-tab,
#enterprise-architecture-content .div-back .ea-cls-name { border-color: var(--ea-back); background: #e2d9f3; }
#enterprise-architecture-content .div-corp { border-color: var(--ea-corp); }
#enterprise-architecture-content .div-corp .pkg-tab,
#enterprise-architecture-content .div-corp .ea-cls-name { border-color: var(--ea-corp); background: #cff4fc; }
#enterprise-architecture-content .div-tech { border-color: var(--ea-tech); }
#enterprise-architecture-content .div-tech .pkg-tab,
#enterprise-architecture-content .div-tech .ea-cls-name { border-color: var(--ea-tech); background: #f8d7da; }
#enterprise-architecture-content .div-digital { border-color: var(--ea-digital); }
#enterprise-architecture-content .div-digital .pkg-tab,
#enterprise-architecture-content .div-digital .ea-cls-name { border-color: var(--ea-digital); background: #d2f4ea; }

/* Swimlane */
#enterprise-architecture-content .ea-swimlane {
  border: 1px solid #ccc; margin: 12px 0; border-radius: 4px; overflow: hidden;
}
#enterprise-architecture-content .ea-swimlane-header {
  background: #e9ecef; padding: 6px 12px; font-weight: 700; font-size: 13px; border-bottom: 1px solid #ccc;
}
#enterprise-architecture-content .ea-swimlane-body {
  padding: 8px 12px;
}
#enterprise-architecture-content .ea-step-flow {
  display: flex; align-items: flex-start; flex-wrap: wrap; gap: 4px;
}
#enterprise-architecture-content .ea-step-box {
  border: 1px solid #666; border-radius: 4px; padding: 6px 10px; font-size: 11px;
  background: #fff; min-width: 120px; max-width: 180px;
}
#enterprise-architecture-content .ea-step-box.decision {
  border-color: #fd7e14; background: #fff8f0;
}
#enterprise-architecture-content .ea-step-box strong {
  display: block; font-size: 12px;
}
#enterprise-architecture-content .ea-step-arrow {
  color: #999; font-size: 18px; align-self: center;
}

/* Data object */
#enterprise-architecture-content .ea-data-obj {
  border: 2px solid #333; border-radius: 2px;
  background: var(--ea-card); margin: 6px;
  display: inline-block; vertical-align: top; min-width: 220px;
}
#enterprise-architecture-content .ea-data-obj-name {
  padding: 6px 10px; font-weight: 700; font-size: 13px;
  border-bottom: 2px solid #333; text-align: center;
}
#enterprise-architecture-content .ea-data-obj-name.pii { background: #f8d7da; }
#enterprise-architecture-content .ea-data-obj-name.conf { background: #fff3cd; }
#enterprise-architecture-content .ea-data-obj-name.hconf { background: #dc3545; color: #fff; }
#enterprise-architecture-content .ea-data-obj-body {
  padding: 6px 10px; font-size: 11px;
}
#enterprise-architecture-content .ea-data-obj-body div { padding: 1px 0; }

/* EA Legend */
#enterprise-architecture-content .ea-legend {
  display: flex; gap: 12px; flex-wrap: wrap; margin: 12px 0;
  padding: 10px; background: #f0f0f0; border-radius: 6px; font-size: 12px;
}
#enterprise-architecture-content .ea-legend-item {
  display: flex; align-items: center; gap: 4px;
}
#enterprise-architecture-content .ea-legend-swatch {
  width: 14px; height: 14px; border: 1px solid #333; border-radius: 2px;
}

/* EA Stats */
#enterprise-architecture-content .ea-stats {
  display: flex; gap: 16px; margin: 16px 0; flex-wrap: wrap;
}
#enterprise-architecture-content .ea-stat-card {
  background: var(--ea-card); border: 1px solid var(--ea-border);
  border-radius: 8px; padding: 12px 20px; box-shadow: var(--ea-shadow);
}
#enterprise-architecture-content .ea-stat-card .num {
  font-size: 28px; font-weight: 700; color: var(--ea-accent);
}
#enterprise-architecture-content .ea-stat-card .label {
  font-size: 12px; color: var(--ea-muted);
}

#enterprise-architecture-content .ea-section-title {
  font-size: 16px; font-weight: 700; margin: 20px 0 10px;
  padding-bottom: 6px; border-bottom: 2px solid #333;
}

/* Zachman Table */
#enterprise-architecture-content .ea-zachman {
  border-collapse: collapse; width: 100%; font-size: 12px; margin: 16px 0;
}
#enterprise-architecture-content .ea-zachman th,
#enterprise-architecture-content .ea-zachman td {
  border: 2px solid #333; padding: 8px 10px; vertical-align: top;
}
#enterprise-architecture-content .ea-zachman th {
  background: #1e293b; color: #fff; font-weight: 700; text-align: center; font-size: 12px;
}
#enterprise-architecture-content .ea-zachman th.row-header {
  background: #334155; text-align: left; width: 140px; min-width: 140px;
}
#enterprise-architecture-content .ea-zachman th.col-header {
  min-width: 130px;
}
#enterprise-architecture-content .ea-zachman td {
  background: var(--ea-card);
}
#enterprise-architecture-content .ea-zachman td strong {
  display: block; font-size: 11px; color: var(--ea-accent); margin-bottom: 2px;
}
#enterprise-architecture-content .ea-zachman td .zcount {
  font-weight: 700; font-size: 16px; color: #333;
}
#enterprise-architecture-content .ea-zachman td .zdetail {
  color: var(--ea-muted); font-size: 11px; margin-top: 3px; line-height: 1.4;
}
#enterprise-architecture-content .ea-zachman tr:nth-child(2) td { background: #f0fdf4; }
#enterprise-architecture-content .ea-zachman tr:nth-child(3) td { background: #eff6ff; }
#enterprise-architecture-content .ea-zachman tr:nth-child(4) td { background: #fefce8; }
#enterprise-architecture-content .ea-zachman tr:nth-child(5) td { background: #fff7ed; }
#enterprise-architecture-content .ea-zachman tr:nth-child(6) td { background: #fdf2f8; }
#enterprise-architecture-content .ea-zachman tr:nth-child(7) td { background: #f5f3ff; }
#enterprise-architecture-content .ea-zachman .z-row-label {
  font-size: 13px; font-weight: 700;
}
#enterprise-architecture-content .ea-zachman .z-row-who {
  font-size: 11px; color: #94a3b8; font-style: italic; display: block; margin-top: 2px;
}

/* Layer stack */
#enterprise-architecture-content .ea-layer-stack {
  display: flex; flex-direction: column; gap: 0; max-width: 1200px; margin: 20px 0;
}
#enterprise-architecture-content .ea-layer {
  border: 2px solid #333; border-bottom: none; padding: 14px 18px;
  display: flex; align-items: center; gap: 16px;
}
#enterprise-architecture-content .ea-layer:last-child {
  border-bottom: 2px solid #333;
}
#enterprise-architecture-content .ea-layer-num {
  width: 36px; height: 36px; border-radius: 50%; border: 2px solid #333;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 16px; flex-shrink: 0;
}
#enterprise-architecture-content .ea-layer-content { flex: 1; }
#enterprise-architecture-content .ea-layer-content h4 { font-size: 14px; margin-bottom: 2px; }
#enterprise-architecture-content .ea-layer-content p { font-size: 12px; color: var(--ea-muted); margin: 0; }
#enterprise-architecture-content .ea-layer-sheets {
  display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px;
}
#enterprise-architecture-content .ea-layer-sheet {
  padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600;
  border: 1px solid #ccc; background: #f8f9fa;
}

/* ============================================================================
 * SVG Topology styles
 * ============================================================================ */

#enterprise-architecture-content .ea-topo-svg {
  width: 100%; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px;
}
#enterprise-architecture-content .ea-topo-svg text {
  font-family: 'Segoe UI', system-ui, sans-serif;
}
#enterprise-architecture-content .topo-zone { rx: 8; ry: 8; stroke-width: 2; stroke-dasharray: 6,3; }
#enterprise-architecture-content .topo-node { cursor: pointer; transition: opacity 0.2s; }
#enterprise-architecture-content .topo-node:hover .node-bg {
  stroke-width: 3; filter: drop-shadow(0 2px 6px rgba(0,0,0,.25));
}
#enterprise-architecture-content .topo-link {
  stroke-width: 2; fill: none; transition: opacity 0.3s;
}
#enterprise-architecture-content .topo-link.faded { opacity: 0.08; }
#enterprise-architecture-content .topo-node.faded { opacity: 0.15; }
#enterprise-architecture-content .topo-link-label {
  font-size: 9px; fill: #666; pointer-events: none;
}

/* Tooltip */
#enterprise-architecture-content .ea-tooltip {
  position: fixed; background: #1e293b; color: #e2e8f0;
  padding: 10px 14px; border-radius: 6px; font-size: 12px;
  max-width: 300px; pointer-events: none; z-index: 200;
  box-shadow: 0 4px 12px rgba(0,0,0,.3); display: none; line-height: 1.5;
}
#enterprise-architecture-content .ea-tooltip strong {
  color: #fff; display: block; margin-bottom: 4px; font-size: 13px;
}
#enterprise-architecture-content .ea-tooltip .tt-badge {
  display: inline-block; padding: 1px 6px; border-radius: 4px;
  font-size: 10px; font-weight: 600; margin-left: 4px;
}
#enterprise-architecture-content .ea-tooltip .tt-critical { background: #dc3545; color: #fff; }
#enterprise-architecture-content .ea-tooltip .tt-high { background: #fd7e14; color: #fff; }
#enterprise-architecture-content .ea-tooltip .tt-medium { background: #ffc107; color: #333; }

/* Rel section */
#enterprise-architecture-content .ea-rel-section {
  margin: 16px 0; padding: 12px; background: #f8f9fa; border-radius: 6px; border: 1px solid #dee2e6;
}
#enterprise-architecture-content .ea-rel-section h4 { font-size: 14px; margin-bottom: 8px; }

/* ============================================================================
 * Professional Light Theme for Applications (Updated Sprint 36)
 * ============================================================================ */
#ea-applications .ea-diagram { background: #f8fafc; border-radius: 8px; }
#ea-applications .ea-topo-svg { background: #ffffff; border-color: #e2e8f0; border-radius: 8px; }
#ea-applications .ea-subtitle { color: #64748b; }
#ea-applications h2 { color: #1e293b; }
#ea-applications .ea-legend { background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px 16px; }
#ea-applications .ea-legend-item { color: #475569; }
#ea-applications .topo-node .node-bg { fill: #ffffff; }
#ea-applications .topo-node:hover .node-bg { filter: drop-shadow(0 2px 6px rgba(0,0,0,0.15)); }
#ea-applications .topo-node .node-name { font-size: 11px; font-weight: 700; fill: #1e293b; }
#ea-applications .topo-node .node-vendor { font-size: 10px; fill: #64748b; }
#ea-applications .topo-link { stroke-width: 1.5; opacity: 0.6; }
#ea-applications .topo-link.highlight { opacity: 1; stroke-width: 3; }
#ea-applications .topo-link.dimmed { opacity: 0.12; }

/* ============================================================================
 * Professional Light Theme for Infrastructure (Updated Sprint 36)
 * ============================================================================ */
#ea-infrastructure .ea-diagram { background: #f8fafc; border-radius: 8px; }
#ea-infrastructure .ea-topo-svg { background: #ffffff; border-color: #e2e8f0; border-radius: 8px; }
#ea-infrastructure .ea-subtitle { color: #64748b; }
#ea-infrastructure h2 { color: #1e293b; }
#ea-infrastructure .ea-legend { background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 10px; padding: 14px 20px; }
#ea-infrastructure .ea-legend-item { color: #475569; }
#ea-infrastructure .ea-legend .legend-title { font-size: 11px; font-weight: 700; color: #64748b; text-transform: uppercase; }
#ea-infrastructure .ea-legend .swatch { width: 32px; height: 3px; border-radius: 2px; }
#ea-infrastructure .ea-legend .swatch.dashed { background: repeating-linear-gradient(90deg, var(--c) 0 6px, transparent 6px 9px); }
#ea-infrastructure .ea-legend .swatch.dotted { background: repeating-linear-gradient(90deg, var(--c) 0 2px, transparent 2px 6px); }
#ea-infrastructure .ea-legend .zone-swatch { width: 20px; height: 14px; border-radius: 3px; border: 2px solid; }
#ea-infrastructure .topo-node text.node-name { font-size: 11px; font-weight: 700; fill: #1e293b; }
#ea-infrastructure .topo-node text.node-spec { font-size: 9px; fill: #64748b; }
#ea-infrastructure .topo-zone text.zone-label { font-size: 15px; font-weight: 700; }

/* Data tab styles */
#ea-data .entity-name { font-size: 12px; font-weight: 700; fill: #1e293b; }
#ea-data .entity-attr { font-size: 10px; fill: #475569; }
#ea-data .entity-source { font-size: 9px; fill: #94a3b8; }
#ea-data .topo-link-label { font-size: 11px; font-weight: 600; }

/* Responsive */
@media (max-width: 900px) {
  #enterprise-architecture-content .ea-grid-2,
  #enterprise-architecture-content .ea-grid-3 { grid-template-columns: 1fr; }
  #enterprise-architecture-content .ea-zachman { font-size: 10px; }
  #enterprise-architecture-content .ea-zachman th,
  #enterprise-architecture-content .ea-zachman td { padding: 4px 6px; }
}
