/* ==========================================================================
   MuleSoft Hub - Interactive Diagram Engine Styles
   Supports Hotspots, Step Player, Full-Screen Pinch/Zoom, and Dark/Light Themes
   ========================================================================== */

.hub-diagram {
  margin: 20px 0 28px 0;
  padding: 16px;
  background: var(--bg-card, #111827);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.hub-diagram-caption {
  font-size: 0.82rem;
  color: var(--text-dim, #94A3B8);
  margin-top: 10px;
  text-align: center;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
}

.hub-diagram svg,
.diagram-container svg {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

/* Hotspots */
g[data-step] {
  cursor: pointer;
  outline: none;
  transition: opacity 0.25s ease, filter 0.25s ease, transform 0.2s ease;
}

g[data-step]:focus-visible {
  filter: drop-shadow(0 0 8px #00F2FE);
}

.diagram-active g[data-step] {
  opacity: 0.35;
}

.diagram-active g[data-step].step-highlight {
  opacity: 1;
  filter: drop-shadow(0 0 10px rgba(0, 242, 254, 0.8));
}

.diagram-active g[data-step].step-highlight rect,
.diagram-active g[data-step].step-highlight circle {
  stroke: #00F2FE !important;
  stroke-width: 2px !important;
}

/* Tooltip Card */
.diagram-tooltip {
  position: absolute;
  z-index: 100;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(0, 242, 254, 0.4);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 8px;
  padding: 12px 16px;
  max-width: 320px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.diagram-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

.diagram-tooltip-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #00F2FE;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.diagram-tooltip-note {
  font-size: 0.8rem;
  line-height: 1.45;
  color: #E2E8F0;
}

/* Step Player Controls */
.diagram-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
}

.diagram-btn-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.diagram-ctrl-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #E2E8F0;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 6px;
  padding: 6px 12px;
  min-height: 36px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.diagram-ctrl-btn:hover {
  background: rgba(0, 242, 254, 0.15);
  border-color: #00F2FE;
  color: #00F2FE;
}

.diagram-step-counter {
  font-size: 0.78rem;
  font-family: var(--font-mono, monospace);
  color: var(--text-dim, #94A3B8);
}

.diagram-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.diagram-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: all 0.2s ease;
}

.diagram-dot.active {
  background: #00F2FE;
  box-shadow: 0 0 8px #00F2FE;
  transform: scale(1.25);
}

/* Light Theme Overrides */
[data-theme="light"] .hub-diagram {
  background: #FFFFFF;
  border-color: #E2E8F0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .diagram-tooltip {
  background: rgba(255, 255, 255, 0.98);
  border-color: #00A1E0;
  color: #0F172A;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .diagram-tooltip-title {
  color: #0077B6;
}

[data-theme="light"] .diagram-tooltip-note {
  color: #334155;
}

[data-theme="light"] .diagram-controls {
  background: #F8FAFC;
  border-color: #E2E8F0;
}

[data-theme="light"] .diagram-ctrl-btn {
  background: #FFFFFF;
  border-color: #CBD5E1;
  color: #1E293B;
}

[data-theme="light"] .diagram-ctrl-btn:hover {
  background: #E0F2FE;
  border-color: #00A1E0;
  color: #0077B6;
}

[data-theme="light"] .diagram-dot {
  background: #CBD5E1;
}

[data-theme="light"] .diagram-dot.active {
  background: #00A1E0;
  box-shadow: 0 0 6px rgba(0, 161, 224, 0.6);
}

/* Mobile Adjustments */
@media (max-width: 768px) {
  .hub-diagram {
    padding: 12px;
  }
  .diagram-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .diagram-btn-group {
    justify-content: center;
  }
  .diagram-dots {
    justify-content: center;
  }
  .diagram-step-counter {
    text-align: center;
  }
  .diagram-tooltip {
    position: static;
    max-width: 100%;
    margin-top: 10px;
    transform: none !important;
  }
}



.diagram-ctrl-btn { min-height: 44px !important; min-width: 44px !important; display: inline-flex; align-items: center; justify-content: center; }

