
/* Factoring Diagram */
.factoring-diagram {
  position: relative;
  width: 100%;
  max-width: 500px;
  height: 500px;
  margin: 0 auto;
}

/* Center Node - ARRIBA */
.diagram-center {
  position: absolute;
  top: 8%;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 120px;
  background: linear-gradient(135deg, var(--purple-light), var(--purple-medium));
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 15px 40px rgba(139, 92, 246, 0.4);
  z-index: 10;
  animation: pulse-center 2s ease-in-out infinite;
}

@keyframes pulse-center {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.05); }
}

.center-icon {
  width: 55px;
  height: 55px;
  margin-bottom: 8px;
}

.center-icon svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.center-coin {
  position: absolute;
  top: -15px;
  right: -15px;
  width: 40px;
  height: 40px;
  background: #FFD700;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.5);
  animation: coin-bounce 1.5s ease-in-out infinite;
}

@keyframes coin-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.center-coin::before {
  content: '$';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #8B5CF6;
  font-weight: bold;
  font-size: 1.2rem;
}

.diagram-center span {
  color: white;
  font-weight: 600;
  font-size: 0.95rem;
  text-align: center;
}

/* Diagram Nodes - Base */
.diagram-node {
  position: absolute;
  width: 90px;
  height: 90px;
  background: white;
  border: 3px solid var(--purple-light);
  border-radius: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 25px rgba(139, 92, 246, 0.2);
  transition: all 0.3s ease;
  cursor: pointer;
  z-index: 8;
}

.diagram-node:hover {
  transform: scale(1.1);
  border-color: var(--purple-medium);
  box-shadow: 0 15px 35px rgba(139, 92, 246, 0.35);
}

/* Diagram Nodes - Base */
.diagram-node-A {
  position: absolute;
  width: 100px;
  height: 100px;
  background: white;
  border: 3px solid var(--purple-light);
  border-radius: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 25px rgba(139, 92, 246, 0.2);
  transition: all 0.3s ease;
  cursor: pointer;
  z-index: 8;
}

.diagram-node-A:hover {
  transform: scale(1.1);
  border-color: var(--purple-medium);
  box-shadow: 0 15px 35px rgba(139, 92, 246, 0.35);
}

.node-icon {
  width: 35px;
  height: 35px;
  color: var(--purple-medium);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.node-icon i {
  font-size: 32px;
}

.node-icon-A {
  width: 35px;
  height: 35px;
  color: var(--purple-medium);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.node-icon-A i {
  font-size: 32px;
}

.diagram-node span {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--purple-dark);
  text-align: center;
}

.diagram-node-A span {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--purple-dark);
  text-align: center;
}

/* Proveedor y Pagador - Estilo especial como Ifactoring */
.node-proveedor,
.node-pagador {
  width: 100px;
  height: 100px;
  background: linear-gradient(135deg, var(--purple-light), var(--purple-medium));
  border: none;
  border-radius: 20px;
  box-shadow: 0 15px 40px rgba(139, 92, 246, 0.4);
}

.node-proveedor:hover,
.node-pagador:hover {
  box-shadow: 0 20px 50px rgba(139, 92, 246, 0.5);
}

.node-proveedor .node-icon,
.node-pagador .node-icon {
  width: 45px;
  height: 45px;
  color: white;
}

.node-proveedor .node-icon svg,
.node-pagador .node-icon svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

.node-proveedor span,
.node-pagador span {
  color: white;
  font-size: 0.85rem;
}

/* Node Positions - Coordenadas exactas */
.node-liquidez {
  top: 30%;
  left: 8%;
}

.node-recaudo {
  top: 30%;
  right: 8%;
}

.node-proveedor {
  top: 62%;
  left: 10%;
}

.node-pagador {
  top: 62%;
  right: 10%;
}

.node-facturacion {
  bottom: 5%;
  left: 50%;
  transform: translateX(-50%);
}


/* Node Positions - Coordenadas exactas */
.node-cesion {
  top: 30%;
  left: -12%; /* A la izquierda del todo */
}

.node-liquidez {
  top: 30%;
  left: 8%;
}

.node-recaudo {
  top: 30%;
  right: 8%;
}

.node-proveedor {
  top: 62%;
  left: 10%;
}

.node-pagador {
  top: 62%;
  right: 10%;
}

.node-facturacion {
  bottom: 5%;
  left: 50%;
  transform: translateX(-50%);
}

/* Animated Arrows */
/* Animated Arrows */
.diagram-arrows {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

.arrow {
  fill: none;
  stroke: var(--purple-medium);
  stroke-width: 3;
  stroke-linecap: round;
  opacity: 0.85;
  stroke-dasharray: 8, 4;
  animation: dash 2.5s linear infinite;
}

/* Flechas inversas con color diferente */
.arrow-reverse {
  stroke: #10B981; /* Verde para diferenciar */
  opacity: 0.8;
}

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

.arrowhead {
  fill: var(--purple-medium);
  opacity: 0.85;
  animation: arrow-pulse 2s ease-in-out infinite;
}

/* Puntas de flechas inversas */
.arrowhead-4,
.arrowhead-5,
.arrowhead-6 {
  fill: #10B981; /* Verde */
  opacity: 0.8;
}

@keyframes arrow-pulse {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; }
}

/* Delays para flechas originales */
.arrow-1 { animation-delay: 0s; }
.arrow-2 { animation-delay: 0.8s; }
.arrow-3 { animation-delay: 1.6s; }

.arrowhead-1 { animation-delay: 0s; }
.arrowhead-2 { animation-delay: 0.8s; }
.arrowhead-3 { animation-delay: 1.6s; }

/* Delays para flechas inversas */
.arrow-4 { animation-delay: 0.4s; }
.arrow-5 { animation-delay: 1.2s; }
.arrow-6 { animation-delay: 2s; }

.arrowhead-4 { animation-delay: 0.4s; }
.arrowhead-5 { animation-delay: 1.2s; }
.arrowhead-6 { animation-delay: 2s; }