/* ==============================================================================
   ORISTATUS DASHBOARD — ESTILOS OFICIALES ORION PRODUCCIONES
   Soporte adaptativo: Luxury Dark (Obsidiana/Cian/Oro) & Scenic Light Mode
   ============================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Paleta Dark Orion (Default) */
  --ori-bg: #090a0f;
  --ori-bg-subtle: #0f1118;
  --ori-card-bg: #141722;
  --ori-card-border: #23283b;
  --ori-card-hover: #1c2030;
  
  --ori-text: #f8fafc;
  --ori-text-muted: #94a3b8;
  --ori-text-dim: #64748b;

  --ori-cyan: #00e5ff;
  --ori-cyan-glow: rgba(0, 229, 255, 0.25);
  --ori-blue: #38bdf8;
  --ori-gold: #e5c07b;
  --ori-gold-glow: rgba(229, 192, 123, 0.2);

  --ori-success: #10b981;
  --ori-warning: #f59e0b;
  --ori-danger: #ef4444;

  --ori-topo-line: #38bdf8;
  --ori-topo-line-glow: rgba(56, 189, 248, 0.5);
  --ori-topo-line-active: #00e5ff;

  --ori-font-main: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --ori-font-mono: 'JetBrains Mono', monospace;
}

/* Modo Claro de Orion */
[data-theme="light"] {
  --ori-bg: #f8fafc;
  --ori-bg-subtle: #f1f5f9;
  --ori-card-bg: #ffffff;
  --ori-card-border: #e2e8f0;
  --ori-card-hover: #f8fafc;
  
  --ori-text: #0f172a;
  --ori-text-muted: #475569;
  --ori-text-dim: #94a3b8;

  --ori-cyan: #0284c7;
  --ori-cyan-glow: rgba(2, 132, 199, 0.15);
  --ori-blue: #0369a1;
  --ori-gold: #b45309;
  --ori-gold-glow: rgba(180, 83, 9, 0.12);

  --ori-topo-line: #0284c7;
  --ori-topo-line-glow: rgba(2, 132, 199, 0.3);
  --ori-topo-line-active: #0369a1;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

body {
  background-color: var(--ori-bg);
  color: var(--ori-text);
  font-family: var(--ori-font-main);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Tipografía Mono */
.font-mono {
  font-family: var(--ori-font-mono);
}

/* Tarjetas y Contenedores */
.ori-card {
  background: var(--ori-card-bg);
  border: 1px solid var(--ori-card-border);
  border-radius: 14px;
  box-shadow: 0 4px 20px -4px rgba(0, 0, 0, 0.15);
}

.ori-card:hover {
  border-color: rgba(56, 189, 248, 0.4);
}

/* Brillos y Acentos */
.glow-cyan {
  box-shadow: 0 0 25px -3px var(--ori-cyan-glow);
}

.glow-gold {
  box-shadow: 0 0 25px -3px var(--ori-gold-glow);
}

.text-cyan {
  color: var(--ori-cyan);
}

.text-gold {
  color: var(--ori-gold);
}

.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-online {
  background: rgba(16, 185, 129, 0.12);
  color: var(--ori-success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-degraded {
  background: rgba(245, 158, 11, 0.12);
  color: var(--ori-warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-stopped {
  background: rgba(239, 68, 68, 0.12);
  color: var(--ori-danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Pulsos animados */
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: pulse-ring 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-ring {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.2); }
}

/* Motor de Topología 2D SVG */
#topo-container {
  position: relative;
  height: 680px;
  min-height: 580px;
  width: 100%;
  background-image: 
    radial-gradient(circle at 1px 1px, var(--ori-card-border) 1px, transparent 0);
  background-size: 28px 28px;
  border-radius: 16px;
  overflow: hidden;
  cursor: grab;
  user-select: none;
}

#topo-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  min-width: 960px;
  min-height: 1050px;
  transform-origin: 0 0;
  will-change: transform;
}

#topo-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

.topo-line {
  fill: none;
  stroke: var(--ori-topo-line);
  stroke-width: 2.5px;
  stroke-dasharray: 6 3;
  animation: dash 35s linear infinite;
  opacity: 0.65;
  transition: opacity 0.3s ease, stroke-width 0.3s ease, stroke 0.3s ease;
  cursor: pointer;
}

.topo-line:hover, .topo-line.is-active {
  stroke: var(--ori-topo-line-active);
  stroke-width: 4px;
  opacity: 1;
  filter: drop-shadow(0 0 8px var(--ori-topo-line-glow));
}

@keyframes dash {
  to {
    stroke-dashoffset: -1000;
  }
}

/* Nodos interactivos en el lienzo */
.topo-node {
  position: absolute;
  z-index: 20;
  cursor: grab;
  user-select: none;
  touch-action: none;
  transition: transform 0.1s ease, box-shadow 0.2s ease, opacity 0.25s ease;
}

.topo-node:active {
  cursor: grabbing;
}

.topo-node.is-dimmed {
  opacity: 0.22;
  filter: grayscale(80%);
}

.topo-node.is-highlighted {
  opacity: 1;
  border-color: var(--ori-cyan) !important;
  box-shadow: 0 0 25px -2px var(--ori-cyan-glow);
}

/* Terminal de Logs Cyber */
.terminal-window {
  background: #06070a;
  color: #38bdf8;
  border: 1px solid #1e2538;
  border-radius: 12px;
  font-family: var(--ori-font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  max-height: 480px;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  white-space: pre-wrap;
  word-break: break-all;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.6);
}

[data-theme="light"] .terminal-window {
  background: #0f172a;
  color: #7dd3fc;
  border-color: #334155;
}

/* Barras de Scroll */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: var(--ori-bg-subtle);
}

::-webkit-scrollbar-thumb {
  background: var(--ori-card-border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--ori-text-dim);
}
