/* ==========================================================
   demo.css — BLOCO DE DEMONSTRAÇÃO VISUAL (MANOLABS)
   Moldura Dark Glass com Visualizador Completo sem Cortes
   ========================================================== */

.demo-section {
  padding: 3rem 0 5rem;
  position: relative;
  z-index: 2;
}

/* Moldura Dark Glass */
.demo-frame {
  background: rgba(13, 13, 20, 0.94);
  border-radius: var(--radius-frame);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.75), 0 0 45px rgba(15, 92, 191, 0.15);
  position: relative;
  overflow: hidden;
  padding: 2.5rem 2.8rem;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

/* Micro-partículas discretas */
.demo-particles-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.demo-particle {
  position: absolute;
  border-radius: 50%;
  opacity: 0.5;
  filter: blur(1px);
  animation: floatParticle 8s ease-in-out infinite alternate;
}

.demo-particle.blue   { width: 4px; height: 4px; background: var(--color-blue); box-shadow: 0 0 10px var(--color-blue); top: 20%; left: 15%; animation-duration: 9s; }
.demo-particle.pink   { width: 3px; height: 3px; background: var(--color-pink); box-shadow: 0 0 10px var(--color-pink); top: 75%; left: 22%; animation-duration: 11s; }
.demo-particle.purple { width: 4px; height: 4px; background: var(--color-purple); box-shadow: 0 0 10px var(--color-purple); top: 35%; right: 18%; animation-duration: 10s; }
.demo-particle.green  { width: 3px; height: 3px; background: var(--color-green); box-shadow: 0 0 10px var(--color-green); top: 80%; right: 25%; animation-duration: 12s; }
.demo-particle.cyan   { width: 5px; height: 5px; background: var(--color-cyan); box-shadow: 0 0 12px var(--color-cyan); top: 15%; right: 40%; animation-duration: 8.5s; }

@keyframes floatParticle {
  0%   { transform: translate(0, 0) scale(1); opacity: 0.3; }
  50%  { transform: translate(15px, -20px) scale(1.3); opacity: 0.7; }
  100% { transform: translate(-10px, -40px) scale(0.9); opacity: 0.25; }
}

/* Grid Principal da Demonstração */
.demo-grid {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 2.5rem;
  align-items: stretch;
  position: relative;
  z-index: 2;
}

/* Coluna 1: Explicação dos 4 Pilares */
.demo-workflow-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.demo-workflow-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  justify-content: space-between;
}

.workflow-node-card {
  background: rgba(18, 22, 34, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.35rem;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  position: relative;
}

.workflow-node-card:hover {
  background: rgba(26, 32, 50, 0.92);
  border-color: rgba(0, 229, 255, 0.35);
  transform: translateX(6px);
}

.workflow-node-card.active {
  background: rgba(22, 28, 48, 0.98);
  border-color: var(--color-cyan);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55), 0 0 24px rgba(0, 229, 255, 0.18);
  transform: translateX(8px);
}

.workflow-node-card.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12%;
  bottom: 12%;
  width: 3.5px;
  background: var(--color-cyan);
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 12px var(--color-cyan);
}

.workflow-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  transition: all 0.3s ease;
}

.workflow-icon-wrap.blue   { color: var(--color-cyan); background: rgba(15, 92, 191, 0.2); border: 1px solid rgba(0, 229, 255, 0.25); }
.workflow-icon-wrap.pink   { color: #F207A0; background: rgba(242, 7, 160, 0.15); border: 1px solid rgba(242, 7, 160, 0.3); }
.workflow-icon-wrap.purple { color: #A855F7; background: rgba(168, 85, 247, 0.15); border: 1px solid rgba(168, 85, 247, 0.3); }
.workflow-icon-wrap.green  { color: #10B981; background: rgba(16, 185, 129, 0.15); border: 1px solid rgba(16, 185, 129, 0.3); }

.workflow-text-content {
  flex: 1;
}

.workflow-title {
  font-family: var(--font-sans);
  font-size: 0.96rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.workflow-desc {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

.workflow-time {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-tertiary);
  white-space: nowrap;
  padding-left: 8px;
  margin-top: 2px;
}

.workflow-node-card.active .workflow-time {
  color: var(--color-cyan);
  font-weight: 600;
}

/* ---------------------------------------------------------
   COLUNA 2: SOBREPOSIÇÕES 3D COM ANIMAÇÃO AUTOMÁTICA
   --------------------------------------------------------- */
.demo-deck-col {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 480px;
  perspective: 1400px;
  width: 100%;
}

.isometric-deck-stage {
  position: relative;
  width: 100%;
  max-width: 420px;
  height: 420px;
  transform-style: preserve-3d;
  margin-right: 30px;
}

.deck-card {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: rgba(12, 16, 26, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.75), 0 0 25px rgba(0, 229, 255, 0.08);
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1), 
              opacity 0.7s ease, 
              filter 0.7s ease,
              box-shadow 0.7s ease, 
              border-color 0.7s ease,
              z-index 0.7s step-start;
  cursor: pointer;
  user-select: none;
}

.deck-card-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(8, 11, 18, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
}

.deck-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.deck-card-badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-cyan);
  box-shadow: 0 0 8px var(--color-cyan);
}

.deck-card-media {
  position: relative;
  width: 100%;
  height: 250px;
  background: radial-gradient(circle at center, rgba(20, 26, 45, 0.85) 0%, rgba(5, 7, 14, 0.98) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  overflow: hidden;
}

.deck-card-media img {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.deck-card-footer {
  padding: 10px 16px;
  background: rgba(8, 11, 18, 0.95);
  font-size: 0.8rem;
  color: var(--text-tertiary);
  font-family: var(--font-sans);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.deck-card-footer span.tag {
  color: var(--color-cyan);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
}

/* POSICIONAMENTO DINÂMICO BASEADO EM OFFSET COM INCLINAÇÃO 3D */
/* Card Ativo na Frente */
.deck-card[data-offset="0"] {
  transform: rotateX(2deg) rotateY(-4deg) rotateZ(0.5deg) translate3d(0, 0, 80px) scale(1);
  z-index: 10;
  opacity: 1;
  filter: brightness(1);
  border-color: rgba(0, 229, 255, 0.45);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.9), 0 0 35px rgba(0, 229, 255, 0.22);
  pointer-events: auto;
}

/* 2º Card (Atrás, Inclinado) */
.deck-card[data-offset="1"] {
  transform: rotateX(10deg) rotateY(-18deg) rotateZ(4deg) translate3d(36px, 18px, -25px) scale(0.94);
  z-index: 7;
  opacity: 0.86;
  filter: brightness(0.88);
  pointer-events: auto;
}

/* 3º Card (Mais Atrás, Inclinado) */
.deck-card[data-offset="2"] {
  transform: rotateX(13deg) rotateY(-22deg) rotateZ(6deg) translate3d(72px, 36px, -70px) scale(0.88);
  z-index: 5;
  opacity: 0.68;
  filter: brightness(0.74);
  pointer-events: auto;
}

/* 4º Card (Base mais profunda, Inclinada) */
.deck-card[data-offset="3"] {
  transform: rotateX(16deg) rotateY(-26deg) rotateZ(8deg) translate3d(108px, 54px, -115px) scale(0.82);
  z-index: 3;
  opacity: 0.48;
  filter: brightness(0.6);
  pointer-events: auto;
}

.deck-card:hover:not([data-offset="0"]) {
  opacity: 0.95;
  filter: brightness(0.95);
  border-color: rgba(255, 255, 255, 0.35);
}

/* Responsividade */
@media (max-width: 992px) {
  .demo-grid {
    grid-template-columns: 1fr;
    gap: 2.2rem;
  }

  .demo-frame {
    padding: 2rem 1.5rem;
  }

  .demo-deck-col {
    min-height: 400px;
  }

  .isometric-deck-stage {
    max-width: 380px;
    height: 380px;
  }

  .deck-card-media {
    height: 210px;
  }
}

@media (max-width: 576px) {
  .workflow-node-card {
    padding: 0.9rem 1rem;
    gap: 12px;
  }

  .workflow-icon-wrap {
    width: 36px;
    height: 36px;
  }

  .isometric-deck-stage {
    max-width: 320px;
    height: 340px;
  }

  .deck-card-media {
    height: 180px;
  }
}
