/* =========================================================
   Performance charts, animated SVG for midia de performance
   ========================================================= */

.charts-section {
  margin: 96px 0;
  padding: 48px 0;
  border-top: 1px solid rgba(255,255,255,0.08);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.charts-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
  margin-top: 48px;
}
.charts-grid .row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  grid-column: 1 / -1;
}
@media (max-width: 900px) {
  .charts-grid { grid-template-columns: 1fr; }
  .charts-grid .row-2 { grid-template-columns: 1fr; }
}

.chart-card {
  background: linear-gradient(180deg, rgba(10,10,31,0.7) 0%, rgba(5,4,15,0.7) 100%);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 20px;
  padding: 28px;
  position: relative;
  overflow: hidden;
}
.chart-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(229,52,139,0.5) 50%, transparent 100%);
}

.chart-card .head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}
.chart-card .title {
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  letter-spacing: -0.005em;
}
.chart-card .sub {
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  margin-top: 2px;
}
.chart-card .badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(34,197,94,0.12);
  border: 1px solid rgba(34,197,94,0.3);
  color: #6EE7A0;
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.chart-card .badge.neg { background: rgba(229,52,139,0.12); border-color: rgba(229,52,139,0.3); color: #FFB8D4; }

.chart-card .big-val {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 16px 0 8px;
}
.chart-card .big-val .n {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 52px;
  line-height: 1;
  letter-spacing: -0.03em;
  background: linear-gradient(180deg, #FFFFFF 0%, rgba(255,255,255,0.6) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.chart-card .big-val .u {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 22px;
  color: #E5348B;
  letter-spacing: -0.02em;
}
.chart-card .caption {
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  line-height: 1.5;
}

/* Sparkline ROAS card */
.chart-line-svg { width: 100%; height: 200px; display: block; margin-top: 16px; }
.chart-line-svg .grid line { stroke: rgba(255,255,255,0.05); stroke-width: 1; }
.chart-line-svg .axis-lbl { font-family: 'Montserrat', sans-serif; font-size: 10px; fill: rgba(255,255,255,0.4); }
.chart-line-svg .line-path {
  fill: none;
  stroke: url(#lineGrad);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 4px 20px rgba(229,52,139,0.4));
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: draw-line 2.4s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.3s;
}
@keyframes draw-line { to { stroke-dashoffset: 0; } }
.chart-line-svg .area-path {
  fill: url(#areaGrad);
  opacity: 0;
  animation: fade-in 1s ease-out forwards 1.6s;
}
@keyframes fade-in { to { opacity: 1; } }
.chart-line-svg .dot {
  fill: #FF4A9C;
  stroke: #0A0A1F;
  stroke-width: 2;
  opacity: 0;
  animation: dot-in 0.5s ease-out forwards;
  filter: drop-shadow(0 0 8px rgba(229,52,139,0.8));
}
@keyframes dot-in { to { opacity: 1; } }

/* Comparison bars */
.comp-bars { margin-top: 24px; display: flex; flex-direction: column; gap: 16px; }
.comp-bar { display: flex; flex-direction: column; gap: 6px; }
.comp-bar .lbl {
  display: flex;
  justify-content: space-between;
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  color: rgba(255,255,255,0.65);
}
.comp-bar .lbl .val {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  color: #FFFFFF;
  font-size: 13px;
}
.comp-bar .track {
  height: 10px;
  background: rgba(255,255,255,0.05);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.comp-bar .fill {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  border-radius: 999px;
  width: 0;
  animation: fill-bar 1.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.comp-bar .fill.muted { background: linear-gradient(90deg, rgba(255,255,255,0.15), rgba(255,255,255,0.3)); }
.comp-bar .fill.highlight {
  background: linear-gradient(90deg, #E5348B, #FF4A9C);
  box-shadow: 0 0 20px rgba(229,52,139,0.5);
}
@keyframes fill-bar { to { width: var(--w); } }

/* Donut / channel split */
.donut-wrap {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 24px;
  align-items: center;
  margin-top: 16px;
}
@media (max-width: 500px) { .donut-wrap { grid-template-columns: 1fr; } }
.donut-svg { width: 160px; height: 160px; }
.donut-svg circle { transition: stroke .3s ease; }
.donut-svg .bg { stroke: rgba(255,255,255,0.06); }
.donut-svg .seg {
  stroke-dasharray: 0 1000;
  transform-origin: center;
  animation: donut-grow 1.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes donut-grow { to { stroke-dasharray: var(--d) 1000; } }
.donut-center {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 24px;
  fill: #FFFFFF;
  letter-spacing: -0.02em;
}
.donut-legend { display: flex; flex-direction: column; gap: 10px; }
.donut-legend .item {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 10px;
  align-items: center;
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  color: rgba(255,255,255,0.75);
}
.donut-legend .item .swatch { width: 10px; height: 10px; border-radius: 3px; }
.donut-legend .item .v {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  color: #FFFFFF;
  font-size: 13px;
}

/* Big single KPI card with animated number */
.hero-kpi-card {
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  min-height: 320px;
  background:
    radial-gradient(ellipse 300px 200px at 20% 20%, rgba(229,52,139,0.18), transparent 60%),
    linear-gradient(180deg, rgba(10,10,31,0.7) 0%, rgba(5,4,15,0.7) 100%);
}
.hero-kpi-card .giant {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: clamp(72px, 10vw, 120px);
  line-height: 0.95;
  letter-spacing: -0.045em;
  background: linear-gradient(180deg, #FFFFFF 0%, #E5348B 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-kpi-card .giant .u {
  font-size: 0.5em;
  -webkit-text-fill-color: #E5348B;
}

/* Trend chips row */
.trend-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.trend-chips .chip-t {
  padding: 6px 12px;
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  color: rgba(255,255,255,0.75);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.trend-chips .chip-t .dot {
  width: 6px; height: 6px; border-radius: 999px;
  background: #6EE7A0;
}
.trend-chips .chip-t .dot.neg { background: #E5348B; }

/* Month-over-month bar chart */
.mom-chart {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  height: 180px;
  align-items: end;
  margin-top: 20px;
  padding-bottom: 28px;
  border-bottom: 1px dashed rgba(255,255,255,0.1);
}
.mom-chart .col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  height: 100%;
  justify-content: flex-end;
  position: relative;
}
.mom-chart .bar {
  width: 100%;
  background: linear-gradient(180deg, #FF4A9C 0%, #E5348B 100%);
  border-radius: 6px 6px 0 0;
  height: 0;
  animation: bar-rise 1.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  box-shadow: 0 -4px 20px rgba(229,52,139,0.3);
  position: relative;
}
.mom-chart .bar.muted {
  background: linear-gradient(180deg, rgba(255,255,255,0.15), rgba(255,255,255,0.05));
  box-shadow: none;
}
.mom-chart .bar .val {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 11px;
  color: #FFFFFF;
  white-space: nowrap;
  opacity: 0;
  animation: fade-in 0.4s ease-out forwards 1.3s;
}
@keyframes bar-rise { to { height: var(--h); } }
.mom-chart .lbl {
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  color: rgba(255,255,255,0.5);
  position: absolute;
  bottom: -20px;
  letter-spacing: 0.04em;
}
