/* ==========================================================================
   NexoFisc — Estilos das Demonstrações Interativas
   Versão: 1.0.0 (PR 3.1)
   ========================================================================== */

/* Container Principal dos Demos */
.demos-wrapper {
  background: var(--color-brand-surface);
  color: #FFFFFF;
  border-radius: var(--radius-2xl);
  padding: var(--space-6);
  border: 1px solid #1E293B;
  box-shadow: var(--shadow-xl);
}

@media (min-width: 768px) {
  .demos-wrapper { padding: var(--space-8); }
}

.demo-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-8);
  border-bottom: 1px solid #1E293B;
  padding-bottom: var(--space-4);
}

.demo-tab-btn {
  padding: 8px 18px;
  background: #1E293B;
  color: #94A3B8;
  font-size: 0.8125rem;
  font-weight: 700;
  border: 1px solid #334155;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.demo-tab-btn:hover {
  color: #FFFFFF;
  background: #334155;
}

.demo-tab-btn.active {
  background: var(--color-brand-primary);
  color: #FFFFFF;
  border-color: var(--color-brand-primary);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.demo-view {
  display: none;
}

.demo-view.active {
  display: block;
}

/* -------------------------------------------------------------------------
   Demonstração 1: Varejo / Checkout com Carrinho e Emissão NFC-e 65
   ------------------------------------------------------------------------- */
.retail-checkout-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

@media (min-width: 992px) {
  .retail-checkout-grid { grid-template-columns: 1.2fr 0.8fr; }
}

.cart-items-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin: var(--space-4) 0;
}

.cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #1E293B;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid #334155;
}

.cart-item-info strong {
  display: block;
  font-size: 0.875rem;
  color: #FFFFFF;
}

.cart-item-info span {
  font-size: 0.75rem;
  color: #94A3B8;
  font-family: var(--font-family-mono);
}

.cart-item-price {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #38BDF8;
}

.receipt-box {
  background: #020617;
  border: 1px dashed #334155;
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  font-family: var(--font-family-mono);
  font-size: 0.75rem;
  color: #CBD5E1;
  line-height: 1.6;
}

.receipt-header {
  text-align: center;
  border-bottom: 1px dashed #334155;
  padding-bottom: var(--space-3);
  margin-bottom: var(--space-3);
}

.receipt-header h4 {
  color: #FFFFFF;
  font-size: 0.875rem;
}

.receipt-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px dashed #334155;
}

/* -------------------------------------------------------------------------
   Demonstração 2: Transporte de Cargas com Caminhão Animado (CT-e 57)
   ------------------------------------------------------------------------- */
.truck-track-wrapper {
  background: #020617;
  border: 1px solid #1E293B;
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
  position: relative;
  overflow: hidden;
}

.track-line {
  position: relative;
  height: 6px;
  background: #1E293B;
  border-radius: var(--radius-full);
  margin: 40px 20px 30px;
}

.track-progress {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2563EB, #10B981);
  border-radius: var(--radius-full);
  transition: width 1.5s ease-in-out;
}

.track-node {
  position: absolute;
  top: -12px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #0F172A;
  border: 3px solid #2563EB;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  font-weight: 800;
  color: #FFFFFF;
}

.track-node.start { left: 0%; }
.track-node.end { right: 0%; border-color: #10B981; }

.animated-truck {
  position: absolute;
  top: -34px;
  left: 0%;
  font-size: 28px;
  transform: translateX(-50%);
  transition: left 1.5s ease-in-out;
  filter: drop-shadow(0 2px 8px rgba(37, 99, 235, 0.4));
}

.cte-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
  margin-top: var(--space-4);
}

@media (min-width: 640px) {
  .cte-metrics { grid-template-columns: repeat(4, 1fr); }
}

.metric-pill {
  background: #1E293B;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid #334155;
}

.metric-pill span {
  display: block;
  font-size: 0.6875rem;
  color: #94A3B8;
  text-transform: uppercase;
}

.metric-pill strong {
  font-size: 0.875rem;
  color: #FFFFFF;
  font-family: var(--font-family-mono);
}

/* -------------------------------------------------------------------------
   Demonstração 3: Prestação de Serviços (NFS-e Sefin Nacional)
   ------------------------------------------------------------------------- */
.services-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

@media (min-width: 992px) {
  .services-card-grid { grid-template-columns: 1fr 1fr; }
}

.tax-retention-box {
  background: #020617;
  border: 1px solid #1E293B;
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  font-size: 0.8125rem;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.tax-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid #1E293B;
}

.tax-row.total {
  border-bottom: none;
  font-weight: 700;
  font-size: 0.9375rem;
  color: #10B981;
}

/* -------------------------------------------------------------------------
   Demonstração 4: Integração ERP e Resposta Síncrona da SEFAZ
   ------------------------------------------------------------------------- */
.erp-sync-flow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #020617;
  padding: var(--space-6);
  border-radius: var(--radius-xl);
  border: 1px solid #1E293B;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.sync-node {
  text-align: center;
  flex: 1;
  min-width: 140px;
}

.sync-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  background: #1E293B;
  color: #38BDF8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: var(--space-2);
  border: 1px solid #334155;
}

.sync-line {
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, #334155, #2563EB, #334155);
  position: relative;
  min-width: 40px;
}

.sync-pulse {
  position: absolute;
  top: -4px;
  left: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #60A5FA;
  box-shadow: 0 0 10px #60A5FA;
  animation: movePulse 2s infinite ease-in-out;
}

@keyframes movePulse {
  0% { left: 0%; opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}
