/* =======================================================
   Medida Page — medida.css
   Estilos específicos para la demo de Arquitectura / API
   (complements style.css + crm.css)
   ======================================================= */

/* ── Architecture Demo Layout ── */
.arch-demo-container {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 40px;
  margin-top: 40px;
  align-items: center;
}

.arch-canvas {
  background: #090e17;
  border-radius: 20px;
  padding: 40px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  min-height: 500px;
  box-shadow: inset 0 0 50px rgba(0,0,0,0.5);
  border: 1px solid #1f2937;
  overflow: hidden;
}

/* Background grid */
.arch-canvas::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 20px 20px;
  z-index: 0;
}

.arch-nodes-group {
  display: flex;
  gap: 20px;
  z-index: 2;
  width: 100%;
  justify-content: center;
}

.arch-node {
  background: #111827;
  border: 1px solid #374151;
  border-radius: 12px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #d1d5db;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
  position: relative;
}

.arch-node i {
  font-size: 1.2rem;
  color: #9ca3af;
}

.arch-node.third-party i { color: #60a5fa; } /* blue */
.arch-node.internal i { color: #f87171; } /* red */
.arch-node.frontend i { color: #34d399; } /* green */

/* Pulsing effect for active nodes */
@keyframes pulseNode {
  0% { box-shadow: 0 0 0 0 rgba(123, 105, 255, 0.4); border-color: #7b69ff; }
  70% { box-shadow: 0 0 0 10px rgba(123, 105, 255, 0); border-color: #374151; }
  100% { box-shadow: 0 0 0 0 rgba(123, 105, 255, 0); border-color: #374151; }
}

.arch-node[data-status="active"] {
  animation: pulseNode 3s infinite;
}

.arch-node.delay-1 { animation-delay: 0.5s; }
.arch-node.delay-2 { animation-delay: 1s; }
.arch-node.delay-3 { animation-delay: 1.5s; }
.arch-node.delay-4 { animation-delay: 2s; }

/* ── Central Core (Middleware) ── */
.arch-core-hub {
  position: relative;
  z-index: 2;
  width: 180px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 40px 0;
}

.hub-center {
  background: linear-gradient(135deg, #7b69ff, #c43bff);
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-align: center;
  box-shadow: 0 0 30px rgba(123, 105, 255, 0.5);
  z-index: 3;
}

.hub-center i {
  font-size: 1.8rem;
  margin-bottom: 4px;
}

.hub-center strong {
  font-size: 0.8rem;
  line-height: 1.1;
}

.hub-center span {
  font-size: 0.55rem;
  opacity: 0.8;
  margin-top: 2px;
}

/* Radar Rings */
.hub-rings {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 100%; height: 100%;
  border-radius: 50%;
  border: 1px solid rgba(123, 105, 255, 0.3);
  z-index: 1;
  animation: expandRing 4s linear infinite;
}

.hub-rings::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 140%; height: 140%;
  border-radius: 50%;
  border: 1px dashed rgba(123, 105, 255, 0.15);
}

@keyframes expandRing {
  0% { transform: translate(-50%, -50%) scale(0.8); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(2); opacity: 0; }
}

/* Data Streams (Animated lines) */
.data-stream {
  position: absolute;
  background: linear-gradient(90deg, transparent, #7b69ff, transparent);
  height: 2px;
  width: 80px;
  z-index: 1;
  opacity: 0;
}

@keyframes flowStream {
  0% { transform: scaleX(0) translateX(-50px); opacity: 0; }
  50% { opacity: 1; }
  100% { transform: scaleX(1) translateX(50px); opacity: 0; }
}

.stream-top-left { top: -20px; left: -40px; transform: rotate(-45deg); animation: flowStream 2s infinite 0.2s; }
.stream-top-center { top: -40px; left: 50px; transform: rotate(-90deg); animation: flowStream 2s infinite 1.5s; }
.stream-top-right { top: -20px; right: -40px; transform: rotate(-135deg); animation: flowStream 2s infinite 0.8s; }
.stream-bottom-left { bottom: -20px; left: -40px; transform: rotate(45deg); animation: flowStream 2s infinite 1.1s; }
.stream-bottom-right { bottom: -20px; right: -40px; transform: rotate(135deg); animation: flowStream 2s infinite 0.5s; }


/* ── Info Panel ── */
.arch-info-panel {
  background: #fff;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
  border: 1px solid #ede9ff;
}

.arch-info-panel h3 {
  font-family: var(--font-headings);
  font-size: 1.4rem;
  margin-bottom: 12px;
  color: #0d0d12;
}

.arch-info-panel p {
  color: #666;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 20px;
}

.arch-features-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.arch-features-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.9rem;
  color: #333;
  line-height: 1.5;
}

.arch-features-list li i {
  color: #7b69ff;
  margin-top: 3px;
}

.arch-conclusion {
  background: #f5f3ff;
  border-left: 4px solid #7b69ff;
  padding: 12px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #4a3aff;
  border-radius: 0 8px 8px 0;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .arch-demo-container {
    grid-template-columns: 1fr;
  }
  .arch-nodes-group {
    flex-wrap: wrap;
  }
}
