/* ==========================================================================
   MIGO AXIS TIER-1 STRATEGY CONSULTING VISUALIZATION SYSTEM STYLES
   Editorial, Minimalist, Data-First, Restrained.
   Inspired by Tier-1 Strategy visual excellence.
   ========================================================================== */

.migo-viz-container {
  position: relative;
  width: 100%;
  margin: 1.5rem 0;
  padding: 1.75rem 1.5rem;
  background: var(--surface, #FFFFFF);
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 8px;
  box-sizing: border-box;
  font-family: var(--font-body, "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  color: var(--text-primary, #0F172A);
  overflow: visible;
  transition: background 0.25s ease, border-color 0.25s ease;
}

/* Dark mode section adaptation */
.theme-dark .migo-viz-container,
.section-dark .migo-viz-container,
.section-navy .migo-viz-container {
  background: #0D0F24;
  border-color: rgba(255, 255, 255, 0.08);
  color: #F8FAFC;
}

/* 1. EDITORIAL HEADER */
.migo-viz-header {
  margin-bottom: 1.25rem;
}

.migo-viz-title {
  font-family: var(--font-display, "Space Grotesk", sans-serif);
  font-size: clamp(1.2rem, 2.2vw, 1.65rem);
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: -0.02em;
  margin: 0 0 0.4rem 0;
  color: inherit;
}

.migo-viz-subtitle {
  font-size: clamp(0.88rem, 1.3vw, 1.02rem);
  color: #64748B;
  line-height: 1.5;
  margin: 0 0 0.5rem 0;
}

.theme-dark .migo-viz-subtitle,
.section-dark .migo-viz-subtitle,
.section-navy .migo-viz-subtitle {
  color: #94A3B8;
}

.migo-viz-instruction {
  font-size: 0.82rem;
  font-style: italic;
  color: #94A3B8;
  margin-top: 0.25rem;
  font-family: var(--font-body, sans-serif);
}

/* 2. EDITORIAL TOP LEGEND */
.migo-viz-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.migo-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: transparent;
  border: none;
  padding: 2px 4px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  color: #475569;
  border-radius: 4px;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.theme-dark .migo-legend-item,
.section-dark .migo-legend-item,
.section-navy .migo-legend-item {
  color: #CBD5E1;
}

.migo-legend-item:hover {
  background: rgba(0, 0, 0, 0.04);
}

.theme-dark .migo-legend-item:hover,
.section-dark .migo-legend-item:hover,
.section-navy .migo-legend-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.migo-legend-item[aria-pressed="false"] {
  opacity: 0.4;
}

.migo-legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  display: inline-block;
  flex-shrink: 0;
}

/* 3. SVG CANVAS */
.migo-viz-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.migo-viz-svg:focus {
  outline: 2px solid var(--gold, #C59B27);
  outline-offset: 4px;
}

/* 4. EDITORIAL TOOLTIP */
.migo-viz-tooltip {
  background: rgba(13, 15, 36, 0.95);
  color: #F8FAFC;
  border: 1px solid rgba(197, 155, 39, 0.45);
  box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 8px;
  padding: 0.85rem 1.15rem;
  min-width: 200px;
  max-width: 360px;
  font-size: 0.84rem;
  z-index: 99999;
}

.migo-tt-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding-bottom: 0.4rem;
  margin-bottom: 0.5rem;
}

.migo-tt-title {
  display: block;
  font-family: var(--font-display, "Space Grotesk", sans-serif);
  font-weight: 700;
  font-size: 0.96rem;
  color: #FFF;
}

.migo-tt-subtitle {
  display: block;
  font-size: 0.72rem;
  color: #94A3B8;
  margin-top: 2px;
}

.migo-tt-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.migo-tt-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.migo-tt-row-left {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.migo-tt-swatch {
  width: 8px;
  height: 8px;
  border-radius: 1.5px;
  display: inline-block;
}

.migo-tt-label {
  color: #CBD5E1;
  font-size: 0.82rem;
}

.migo-tt-val {
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  color: #FFF;
}

.migo-tt-badge {
  color: var(--gold, #C59B27);
  font-weight: 600;
  margin-left: 2px;
}

.migo-tt-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  margin-top: 0.5rem;
  padding-top: 0.35rem;
  font-size: 0.7rem;
  color: #8B90A0;
}

/* 5. INTEGRATED SUMMARY TABLE (Executive Style) */
.migo-viz-table-wrapper {
  margin-top: 1.5rem;
  border-top: 1px solid var(--border, #E2E8F0);
  padding-top: 1rem;
  overflow-x: auto;
}

.theme-dark .migo-viz-table-wrapper,
.section-dark .migo-viz-table-wrapper,
.section-navy .migo-viz-table-wrapper {
  border-color: rgba(255, 255, 255, 0.08);
}

.migo-viz-table-title {
  font-family: var(--font-display, "Space Grotesk", sans-serif);
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: inherit;
}

.migo-viz-summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  text-align: center;
}

.migo-viz-summary-table th {
  padding: 0.4rem 0.5rem;
  font-weight: 600;
  color: #64748B;
  border-bottom: 1px solid var(--border, #E2E8F0);
}

.theme-dark .migo-viz-summary-table th,
.section-dark .migo-viz-summary-table th,
.section-navy .migo-viz-summary-table th {
  color: #94A3B8;
  border-color: rgba(255, 255, 255, 0.08);
}

.migo-viz-summary-table td {
  padding: 0.5rem 0.5rem;
  font-family: var(--font-mono, monospace);
  font-weight: 700;
}

.migo-viz-summary-table .migo-td-series {
  text-align: left;
  font-family: var(--font-body, sans-serif);
  font-weight: 600;
  padding-left: 0;
  white-space: nowrap;
}

/* 6. EDITORIAL FOOTER */
.migo-viz-footer {
  margin-top: 1.25rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border, #E2E8F0);
  font-size: 0.76rem;
  color: #64748B;
  line-height: 1.5;
}

.theme-dark .migo-viz-footer,
.section-dark .migo-viz-footer,
.section-navy .migo-viz-footer {
  border-color: rgba(255, 255, 255, 0.08);
  color: #94A3B8;
}

.migo-viz-notes {
  margin-bottom: 0.25rem;
}

.migo-viz-source {
  font-weight: 500;
  color: inherit;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .migo-viz-container {
    padding: 1.25rem 1rem;
    margin: 1rem 0;
  }
  .migo-viz-legend {
    gap: 0.75rem;
  }
  .migo-viz-summary-table th,
  .migo-viz-summary-table td {
    padding: 0.35rem 0.3rem;
    font-size: 0.74rem;
  }
}

/* 7. AXIS TITLES */
.migo-axis-title {
  font-family: var(--font-display, "Space Grotesk", sans-serif);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  fill: #CBD5E1;
}

/* 8. GLOBAL CORRIDOR MAP ANIMATIONS & EXECUTIVE CONSOLE (OPHZ Zooming Inspired) */
@keyframes migoBeaconPulse {
  0% {
    r: 6px;
    opacity: 0.85;
  }
  70% {
    r: 22px;
    opacity: 0.25;
  }
  100% {
    r: 28px;
    opacity: 0;
  }
}

@keyframes migoCorridorFlow {
  0% {
    stroke-dashoffset: 56;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

/* Explicit Dark Console Card for Maps (Zero Light Background Leak) */
.migo-map-container,
.migo-viz-container.migo-map-container {
  background: #090D1A !important;
  border: 1px solid rgba(197, 155, 39, 0.35) !important;
  border-radius: 12px !important;
  padding: 1.25rem 1.5rem !important;
  color: #FFFFFF !important;
  box-shadow: 0 16px 36px rgba(13, 15, 36, 0.35) !important;
  position: relative !important;
  overflow: hidden !important;
}

.migo-map-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.migo-map-filter-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.migo-map-zoom-group {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(13, 15, 36, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 0.2rem 0.35rem;
}

.migo-map-zoom-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #F8FAFC;
  width: 26px;
  height: 26px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono, monospace);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1;
  padding: 0;
}

.migo-map-zoom-btn:hover {
  background: rgba(197, 155, 39, 0.25);
  border-color: #C59B27;
  color: #FFFFFF;
}

.migo-map-zoom-btn:active {
  transform: scale(0.95);
}

.migo-map-zoom-readout {
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  color: #94A3B8;
  padding: 0 0.35rem;
  min-width: 34px;
  text-align: center;
  user-select: none;
}

.migo-map-pill:hover,
.migo-matrix-pill:hover {
  background: rgba(197, 155, 39, 0.15) !important;
  color: #FFFFFF !important;
  border-color: rgba(197, 155, 39, 0.5) !important;
}

.migo-matrix-container {
  overflow: visible;
}

