/* ═══════════════════════════════════════════════
   AVANCCE — data-dashboard.css
   Seção "Dashboard e Análise de Dados"
   Cards glass com tilt 3D + fundo de partículas
   ═══════════════════════════════════════════════ */

.dashboards {
  position: relative;
  z-index: 2;
  background: var(--surface-base);
  scroll-margin-top: var(--nav-offset);
  overflow: hidden;
  isolation: isolate;
}

/* Canvas de partículas (Three.js, lazy) — puramente decorativo */
.dd-particles {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s ease;
}
.dd-particles.is-on { opacity: 1; }

/* Glow ambiente atrás dos cards (fallback visual se o 3D não carregar) */
.dashboards::before {
  content: '';
  position: absolute;
  top: 20%;
  right: -10%;
  width: 60%;
  height: 70%;
  background: radial-gradient(ellipse 60% 50% at 60% 45%,
    rgba(124, 58, 237, 0.14) 0%,
    rgba(76, 29, 149, 0.06) 50%,
    transparent 78%);
  filter: blur(30px);
  pointer-events: none;
  z-index: 0;
}

.dashboards .container {
  position: relative;
  z-index: 1;
}
.dd-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(48px, 6vw, 80px);
  align-items: center;
}

/* ── Coluna de conteúdo ───────────────────────── */
.dd-content .section-title {
  text-align: left;
  margin-bottom: 16px;
  font-size: clamp(22px, 3.15vw, 36px);
}
.dd-sub {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 28px;
  max-width: 480px;
}
.dd-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 0;
  list-style: none;
  padding: 0;
}
.dd-list li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.dd-list .check-icon [data-lucide],
.dd-list .check-icon svg {
  width: 20px;
  height: 20px;
  color: var(--accent-hot);
  flex-shrink: 0;
  margin-top: 2px;
}

/* ── Cluster de cards ─────────────────────────── */
.dd-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(14px, 1.8vw, 20px);
  perspective: 1200px;
}
.dd-card {
  position: relative;
  padding: 22px 20px;
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(150, 70, 240, 0.09) 0%, rgba(19, 2, 40, 0.6) 100%);
  border: 1px solid var(--border-accent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow:
    0 4px 32px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: box-shadow 0.35s ease, border-color 0.35s ease;
  overflow: hidden;
}
.dd-card::after {
  /* reflexo interno sutil */
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg,
    transparent 30%,
    rgba(196, 181, 253, 0.06) 46%,
    rgba(196, 181, 253, 0.1) 50%,
    rgba(196, 181, 253, 0.06) 54%,
    transparent 70%);
  pointer-events: none;
}
.dd-card:hover {
  border-color: rgba(139, 92, 246, 0.6);
  box-shadow:
    0 8px 44px rgba(124, 58, 237, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.dd-card-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
}
.dd-card-head [data-lucide],
.dd-card-head svg {
  width: 16px;
  height: 16px;
  color: var(--accent-hot);
  flex-shrink: 0;
}
.dd-card-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.dd-card-value {
  font-family: var(--font-heading);
  font-size: clamp(26px, 2.4vw, 34px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}
.dd-card-value .dd-unit {
  font-size: 0.55em;
  font-weight: 700;
  color: var(--accent-soft);
  margin-left: 2px;
}
.dd-card-note {
  font-size: 11.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}
.dd-card-note [data-lucide],
.dd-card-note svg {
  width: 13px;
  height: 13px;
  color: #34d399;
}

/* Gráfico de linha (SVG) */
.dd-linechart {
  display: block;
  width: 100%;
  height: 64px;
  margin-top: 12px;
}
.dd-linechart .dd-line {
  fill: none;
  stroke: url(#ddLineGrad);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.dd-linechart .dd-area {
  fill: url(#ddAreaGrad);
  opacity: 0;
  transition: opacity 0.9s ease 0.55s;
}
.dashboards.dd-inview .dd-linechart .dd-area { opacity: 1; }

/* Gráfico de barras */
.dd-bars {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  height: 64px;
  margin-top: 12px;
}
.dd-bar {
  flex: 1;
  border-radius: 4px 4px 2px 2px;
  background: linear-gradient(180deg, var(--accent-hot) 0%, rgba(124, 58, 237, 0.35) 100%);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.7s cubic-bezier(0.34, 1.3, 0.4, 1);
}
.dd-bar--hot {
  background: linear-gradient(180deg, var(--brand-burnt-orange) 0%, rgba(193, 95, 51, 0.35) 100%);
}
.dashboards.dd-inview .dd-bar { transform: scaleY(1); }
.dashboards.dd-inview .dd-bar:nth-child(2) { transition-delay: 0.08s; }
.dashboards.dd-inview .dd-bar:nth-child(3) { transition-delay: 0.16s; }
.dashboards.dd-inview .dd-bar:nth-child(4) { transition-delay: 0.24s; }
.dashboards.dd-inview .dd-bar:nth-child(5) { transition-delay: 0.32s; }
.dashboards.dd-inview .dd-bar:nth-child(6) { transition-delay: 0.40s; }
.dashboards.dd-inview .dd-bar:nth-child(7) { transition-delay: 0.48s; }

/* Indicador radial (percentual) */
.dd-radial {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 6px;
}
.dd-radial svg {
  width: 96px;
  height: 96px;
  transform: rotate(-90deg);
}
.dd-radial .dd-radial-bg {
  fill: none;
  stroke: rgba(139, 92, 246, 0.15);
  stroke-width: 8;
}
.dd-radial .dd-radial-fg {
  fill: none;
  stroke: url(#ddRadialGrad);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.4s cubic-bezier(0.4, 0, 0.2, 1) 0.25s;
}
.dd-radial-value {
  position: absolute;
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

/* Barra de progresso simples (card contador) */
.dd-meter {
  height: 6px;
  border-radius: 99px;
  background: rgba(139, 92, 246, 0.15);
  margin-top: 16px;
  overflow: hidden;
}
.dd-meter-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent) 0%, var(--brand-burnt-orange) 100%);
  transition: width 1.3s cubic-bezier(0.4, 0, 0.2, 1) 0.3s;
}
.dashboards.dd-inview .dd-meter-fill { width: 82%; }

/* ── Responsivo ───────────────────────────────── */
@media (max-width: 960px) {
  .dd-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 44px;
  }
  .dd-content { text-align: left; }
}
@media (max-width: 480px) {
  .dd-cards { grid-template-columns: 1fr; }
}

/* ── Reduced motion ───────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .dd-particles { display: none; }
  .dd-card { transition: none; }
  .dd-bar,
  .dd-radial .dd-radial-fg,
  .dd-meter-fill,
  .dd-linechart .dd-area {
    transition: none !important;
  }
  .dd-bar { transform: scaleY(1); }
}
