/* Webiness — Web Analytics: componente quadrato "Cruscotto dati" */

.wa-data-animation {
  --wa-ink: #0d1628;
  --wa-line: #d8dfeb;
  --wa-white: #ffffff;
  --wa-brand: #cc0090;
  --wa-brand-light: #ffe8f8;
  --wa-shadow: 0 22px 50px rgba(13, 22, 40, .12);
  position: relative;
  isolation: isolate;
  width: 100%;
  min-width: 0;
  max-width: 440px;
  min-height: 440px;
  margin-inline: auto;
  overflow: hidden;
  border: 1px solid #dfe5ef;
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 62%, rgba(204, 0, 144, .09), transparent 30%),
    linear-gradient(rgba(13, 22, 40, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(13, 22, 40, .035) 1px, transparent 1px),
    var(--wa-white);
  background-size: auto, 24px 24px, 24px 24px, auto;
  box-shadow: var(--wa-shadow);
  color: var(--wa-ink);
  font-family: Nunito, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.wa-data-animation *,
.wa-data-animation *::before,
.wa-data-animation *::after { box-sizing: border-box; }

.wa-data-animation::after {
  position: absolute;
  z-index: -1;
  right: -110px;
  bottom: -150px;
  width: 310px;
  height: 310px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(204, 0, 144, .14), rgba(204, 0, 144, 0) 68%);
  content: "";
}

/* ── barra superiore ── */
.wa-board-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 54px;
  padding: 0 20px;
  border-bottom: 1px solid var(--wa-line);
  background: rgba(255, 255, 255, .82);
  color: var(--wa-ink);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .075em;
  text-transform: uppercase;
}

.wa-board-name { display: flex; align-items: center; gap: 9px; }

.wa-board-name::before {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--wa-brand);
  box-shadow: 0 0 0 5px var(--wa-brand-light);
  content: "";
}

.wa-active {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #16835c;
}

.wa-active i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #25aa78;
  animation: wa-blink 1.7s ease-in-out infinite;
}

/* ── corpo del cruscotto ── */
.wa-stage {
  display: flex;
  height: 330px;
  flex-direction: column;
  gap: 12px;
  padding: 18px 20px 14px;
}

/* domande a cui rispondono i dati */
.wa-questions {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.wa-q {
  padding: 9px 10px 10px;
  border: 1px solid var(--wa-line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 8px 18px rgba(13, 22, 40, .055);
}

.wa-q strong {
  display: block;
  color: #46536a;
  font-size: .72rem;
  font-weight: 800;
  line-height: 1.15;
}

.wa-q small {
  display: block;
  margin-top: 3px;
  color: #7d8799;
  font-size: .58rem;
  font-weight: 700;
  line-height: 1.25;
}

.wa-q:nth-child(1) { animation: wa-focus 6s linear infinite; }
.wa-q:nth-child(2) { animation: wa-focus 6s 2s linear infinite; }
.wa-q:nth-child(3) { animation: wa-focus 6s 4s linear infinite; }

/* grafico */
.wa-chart {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  padding: 16px 14px 26px;
  border: 1px solid var(--wa-line);
  border-radius: 12px;
  background:
    repeating-linear-gradient(to top, transparent 0 24%, rgba(13, 22, 40, .05) 24%, transparent calc(24% + 1px)),
    var(--wa-white);
}

.wa-bars {
  position: absolute;
  top: 16px;
  right: 14px;
  bottom: 26px;
  left: 14px;
  display: flex;
  align-items: flex-end;
  gap: 7px;
}

.wa-bar {
  flex: 1 1 0;
  border-radius: 4px 4px 2px 2px;
  background: linear-gradient(180deg, rgba(204, 0, 144, .55), rgba(204, 0, 144, .92));
  transform-origin: bottom center;
  animation:
    wa-bar-in .9s cubic-bezier(.2, .7, .3, 1) both,
    wa-bar-live 6s linear infinite;
}

.wa-bar:nth-child(1) { height: 34%; animation-delay: 0s, 0s; }
.wa-bar:nth-child(2) { height: 52%; animation-delay: .07s, .75s; }
.wa-bar:nth-child(3) { height: 41%; animation-delay: .14s, 1.5s; }
.wa-bar:nth-child(4) { height: 63%; animation-delay: .21s, 2.25s; }
.wa-bar:nth-child(5) { height: 55%; animation-delay: .28s, 3s; }
.wa-bar:nth-child(6) { height: 78%; animation-delay: .35s, 3.75s; }
.wa-bar:nth-child(7) { height: 70%; animation-delay: .42s, 4.5s; }
.wa-bar:nth-child(8) { height: 92%; animation-delay: .49s, 5.25s; }

.wa-target {
  position: absolute;
  top: 30%;
  right: 14px;
  left: 14px;
  border-top: 1px dashed rgba(204, 0, 144, .55);
}

.wa-target span {
  position: absolute;
  top: -8px;
  right: 0;
  padding: 1px 6px;
  border-radius: 20px;
  background: var(--wa-brand-light);
  color: var(--wa-brand);
  font-size: .53rem;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.wa-axis {
  position: absolute;
  right: 14px;
  bottom: 8px;
  left: 14px;
  display: flex;
  justify-content: space-between;
  color: #97a2b3;
  font-size: .56rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

/* ── barra inferiore ── */
.wa-foot {
  display: flex;
  height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 21px;
  border-top: 1px solid var(--wa-line);
}

.wa-status {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #16835c;
  font-size: .64rem;
  font-weight: 800;
}

.wa-status::before {
  display: grid;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: #e7f8f0;
  content: "✓";
  font-size: .65rem;
}

.wa-metric {
  color: #7d8799;
  font-size: .61rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.wa-metric b {
  color: var(--wa-brand);
  font-size: .72rem;
  font-weight: 900;
}

.wa-data-animation:not(.is-visible) .wa-bar,
.wa-data-animation:not(.is-visible) .wa-q,
.wa-data-animation:not(.is-visible) .wa-active i { animation-play-state: paused; }

@keyframes wa-blink { 50% { opacity: .3; transform: scale(.78); } }
@keyframes wa-bar-in {
  from { opacity: .3; transform: scaleY(.06); }
  to { opacity: 1; transform: scaleY(1); }
}
@keyframes wa-bar-live {
  0%, 8% { box-shadow: 0 -4px 15px rgba(204, 0, 144, .5); }
  20%, 100% { box-shadow: 0 0 0 rgba(204, 0, 144, 0); }
}
@keyframes wa-focus {
  0%, 19% {
    border-color: #f1b8dd;
    background: #fffafd;
    box-shadow: 0 10px 22px rgba(204, 0, 144, .16);
  }
  27%, 100% {
    border-color: var(--wa-line);
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 8px 18px rgba(13, 22, 40, .055);
  }
}

@media (max-width: 560px) {
  .wa-data-animation { min-height: 430px; }
  .wa-stage { padding-inline: 14px; }
  .wa-q { padding: 8px; }
  .wa-q strong { font-size: .64rem; }
  .wa-q small { font-size: .53rem; }
  .wa-bars { gap: 5px; }
  .wa-foot { padding-inline: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .wa-data-animation *,
  .wa-data-animation *::before,
  .wa-data-animation *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
