/**
 * RankPress Visual System V3.0
 * Modern, Professional, Flat Design with Micro-Animations
 *
 * @package RankPressVisuals
 * @version 3.0.0
 *
 * V3 Features:
 * - Continuous micro-animations for enhanced engagement
 * - Timeline: flowing line + sequential number pulse
 * - Checklist: wiggle checkmarks + pulse badges
 * - Split: VS badge pulse + winner glow
 * - Icons: floating animation (focus, alert)
 * - Progress bars: shimmer effect
 * - Metrics: value pulse
 * - Trend: arrow bounce + point breathing
 * - Respects prefers-reduced-motion
 *
 * ISOLATION STRATEGY:
 * We use explicit property resets instead of "all: initial" to:
 * 1. Isolate visuals from theme CSS interference
 * 2. Allow animations to work properly
 * 3. Preserve animation, transition, transform properties
 */

/* ============================================
   CSS VARIABLES
   ============================================ */

.rp-visual {
  --rp-primary: #2563eb;
  --rp-primary-light: #3b82f6;
  --rp-primary-dark: #1d4ed8;
  --rp-success: #15803d;
  --rp-success-light: #16a34a;
  --rp-warning: #d97706;
  --rp-warning-light: #f59e0b;
  --rp-danger: #dc2626;
  --rp-danger-light: #ef4444;
  --rp-info: #2563eb;
  --rp-tip: #16a34a;
  --rp-text-primary: #0f172a;
  --rp-text-secondary: #475569;
  --rp-text-muted: #94a3b8;
  --rp-border: #e2e8f0;
  --rp-bg-subtle: #f8fafc;
  --rp-bg-white: #ffffff;
}

/* ============================================
   BASE VISUAL CONTAINER
   ============================================ */

.rp-visual {
  /* Reset properties explicitly (NOT all:initial - preserves animation) */
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  font: inherit !important;
  vertical-align: baseline !important;
  box-shadow: none !important;
  text-shadow: none !important;
  outline: none !important;
  list-style: none !important;
  text-decoration: none !important;
  float: none !important;
  clear: none !important;
  /* Now apply our styles */
  display: block !important;
  margin: 2rem auto !important;
  max-width: 100% !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  font-size: 16px !important;
  line-height: 1.5 !important;
  color: var(--rp-text-primary) !important;
  box-sizing: border-box !important;
  isolation: isolate !important;
  /* Text handling - prevent truncation */
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
  word-break: normal !important;
  white-space: normal !important;
  text-overflow: clip !important;
  hyphens: auto !important;
}

.rp-visual .rp-visual__container {
  all: initial !important;
  animation: unset !important;
  display: block !important;
  background: var(--rp-bg-white) !important;
  border: 1px solid var(--rp-border) !important;
  border-radius: 16px !important;
  padding: 1.75rem !important;
  font-family: inherit !important;
  font-size: inherit !important;
  line-height: inherit !important;
  color: inherit !important;
  box-sizing: border-box !important;
}

.rp-visual .rp-visual__caption {
  /* Visually hidden but accessible to screen readers */
  all: initial !important;
  animation: unset !important;
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ============================================
   LIST ISOLATION (block FontAwesome injection)
   Prevents theme/plugin icons from appearing on visual lists
   while allowing component-specific bullets to work
   ============================================ */

/* Reset all lists inside visuals */
.rp-visual ul,
.rp-visual ol,
.rp-visual li {
  all: initial !important;
  animation: unset !important;
  display: block !important;
  font-family: inherit !important;
  font-size: inherit !important;
  line-height: inherit !important;
  color: inherit !important;
  list-style: none !important;
  list-style-type: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Block ::marker pseudo-element - prevents native bullets */
.rp-visual li::marker {
  content: none !important;
  font-size: 0 !important;
  color: transparent !important;
}

/*
 * NUCLEAR OPTION: Remove ALL ::before/::after content on list items
 * This completely blocks FontAwesome icons (which use content: '\f00c')
 * Component-specific rules below will re-enable content where needed
 */
.rp-visual li::before,
.rp-visual li::after {
  content: none !important;
  display: none !important;
}

/*
 * RE-ENABLE ::before for Split component bullets
 * Higher specificity (0-2-1) overrides the block above (0-1-1)
 */
.rp-visual .rp-split__points li::before {
  content: '' !important;
  display: block !important;
  width: 6px !important;
  height: 6px !important;
  margin: 0.4rem 0 0 0 !important;
  background: var(--rp-primary) !important;
  border-radius: 50% !important;
  flex-shrink: 0 !important;
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes rp-fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes rp-slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes rp-slideRight {
  from { opacity: 0; transform: translateX(-16px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes rp-drawLine {
  to { stroke-dashoffset: 0; }
}

@keyframes rp-fillBar {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes rp-scaleIn {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

/* ============================================
   V2.2 REFINED MICRO-ANIMATIONS
   More subtle and elegant, professional feel
   ============================================ */

/* Pulse - subtle scale for badges and numbers */
@keyframes rp-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.08); opacity: 0.95; }
}

/* Floating - gentle up/down movement */
@keyframes rp-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* Glow pulse - soft glow for accents */
@keyframes rp-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
  50% { box-shadow: 0 0 12px 3px rgba(22, 163, 74, 0.3); }
}

/* Shimmer - moving highlight effect */
@keyframes rp-shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

/* Timeline flow - smooth gradient flow */
@keyframes rp-flowLine {
  0% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -24; }
}

/* Breathing - subtle opacity pulse */
@keyframes rp-breathe {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(1.02); }
}

/* Wiggle - subtle rotation for checkmarks */
@keyframes rp-wiggle {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(6deg); }
  40% { transform: rotate(-4deg); }
  60% { transform: rotate(3deg); }
  80% { transform: rotate(-2deg); }
}

/* Modern checkmark pulse - scale + glow effect */
@keyframes rp-checkPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.15);
  }
}

/* Sequential pulse - for timeline dots */
@keyframes rp-sequencePulse {
  0%, 20%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
  10% { transform: scale(1.15); box-shadow: 0 0 12px 4px rgba(37, 99, 235, 0.4); }
}

/* Icon bounce - smooth bounce effect */
@keyframes rp-bounce {
  0%, 100% { transform: translateY(0); }
  25% { transform: translateY(-6px); }
  50% { transform: translateY(0); }
  75% { transform: translateY(-3px); }
}

/* Checkmark draw animation */
@keyframes rp-checkDraw {
  0%, 50% { stroke-dashoffset: 24; }
  100% { stroke-dashoffset: 0; }
}

/* Shake - gentle attention-getting shake for alerts */
@keyframes rp-shake {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  15% { transform: translateX(-3px) rotate(-3deg); }
  30% { transform: translateX(3px) rotate(3deg); }
  45% { transform: translateX(-2px) rotate(-2deg); }
  60% { transform: translateX(2px) rotate(2deg); }
  75% { transform: translateX(-1px) rotate(-1deg); }
  90% { transform: translateX(1px) rotate(1deg); }
}

/* V2.2 NEW: Subtle icon attention */
@keyframes rp-attention {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* V2.2 NEW: Progress bar fill with easing */
@keyframes rp-progressFill {
  0% { transform: scaleX(0); opacity: 0.7; }
  60% { opacity: 1; }
  100% { transform: scaleX(1); opacity: 1; }
}

/* ============================================
   TEMPLATE: DATA TREND CURVE
   ============================================ */

.rp-visual[data-template="data-trend-curve"] .rp-visual__container {
  background: linear-gradient(135deg, #eff6ff 0%, var(--rp-bg-white) 100%) !important;
  --rp-trend-color: var(--rp-primary);
}

.rp-visual[data-template="data-trend-curve"][data-direction="down"] .rp-visual__container {
  background: linear-gradient(135deg, #fef2f2 0%, var(--rp-bg-white) 100%) !important;
  --rp-trend-color: var(--rp-danger);
}

.rp-visual .rp-trend__header {
  all: initial !important;
  animation: unset !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin: 0 0 1rem 0 !important;
  font-family: inherit !important;
  box-sizing: border-box !important;
}

.rp-visual .rp-trend__metric {
  all: initial !important;
  animation: unset !important;
  display: block !important;
  font-family: inherit !important;
  font-size: 0.875rem !important;
  font-weight: 600 !important;
  color: var(--rp-text-secondary) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
}

.rp-visual .rp-trend__delta {
  all: initial !important;
  animation: unset !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.25rem !important;
  padding: 0.25rem 0.75rem !important;
  background: var(--rp-success) !important;
  color: white !important;
  border-radius: 999px !important;
  font-family: inherit !important;
  font-size: 0.75rem !important;
  font-weight: 700 !important;
}

.rp-visual .rp-trend__delta[data-direction="down"] {
  background: var(--rp-danger) !important;
}

.rp-visual .rp-trend__arrow {
  /* Explicit resets instead of all:initial - allows animation */
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  font: inherit !important;
  color: inherit !important;
  text-decoration: none !important;
  box-shadow: none !important;
  outline: none !important;
  /* Element styles */
  display: block !important;
  width: 12px !important;
  height: 12px !important;
}

.rp-visual .rp-trend__delta[data-direction="down"] .rp-trend__arrow {
  transform: rotate(180deg) !important;
}

/* V3: Trend arrow bounce animation */
.rp-visual.is-visible .rp-trend__arrow {
  animation: rp-bounce 2s ease-in-out infinite !important;
}
.rp-visual.is-visible .rp-trend__delta[data-direction="down"] .rp-trend__arrow {
  animation: rp-bounce 2s ease-in-out infinite reverse !important;
}

.rp-visual .rp-trend__chart {
  all: initial !important;
  animation: unset !important;
  display: block !important;
  position: relative !important;
  box-sizing: border-box !important;
}

.rp-visual .rp-trend__svg {
  all: initial !important;
  animation: unset !important;
  display: block !important;
  width: 100% !important;
  height: 160px !important;
}

.rp-visual .rp-trend__grid line {
  stroke: var(--rp-border) !important;
  stroke-width: 1 !important;
  opacity: 0.5 !important;
}

.rp-visual .rp-trend__context-line {
  stroke: var(--rp-text-muted) !important;
  stroke-width: 2 !important;
  stroke-dasharray: 6 4 !important;
  opacity: 0.4 !important;
}

.rp-visual .rp-trend__area {
  /* Visible by default, hidden only when JS enabled */
}

.rp-visual .rp-trend__curve {
  /* stroke-dasharray/offset applied only when JS enabled */
}

.rp-visual .rp-trend__point {
  fill: var(--rp-trend-color) !important;
}

/* V3: Trend points pulse animation */
.rp-visual.is-visible .rp-trend__point {
  animation: rp-breathe 2s ease-in-out infinite !important;
}
.rp-visual.is-visible .rp-trend__point--start {
  animation-delay: 0s !important;
}
.rp-visual.is-visible .rp-trend__point--end {
  animation-delay: 1s !important;
}

.rp-visual .rp-trend__labels {
  all: initial !important;
  animation: unset !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: flex-end !important;
  margin: 1rem 0 0 0 !important;
  padding: 1rem 0 0 0 !important;
  border-top: 1px solid var(--rp-border) !important;
  font-family: inherit !important;
  box-sizing: border-box !important;
}

.rp-visual .rp-trend__label {
  all: initial !important;
  animation: unset !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 0.25rem !important;
  font-family: inherit !important;
}

.rp-visual .rp-trend__label--start { align-items: flex-start !important; }
.rp-visual .rp-trend__label--end { align-items: flex-end !important; }

.rp-visual .rp-trend__label-value {
  all: initial !important;
  animation: unset !important;
  display: block !important;
  font-family: inherit !important;
  font-size: 1.5rem !important;
  font-weight: 800 !important;
  color: var(--rp-primary) !important;
}

.rp-visual .rp-trend__label-text {
  all: initial !important;
  animation: unset !important;
  display: block !important;
  font-family: inherit !important;
  font-size: 0.75rem !important;
  color: var(--rp-text-muted) !important;
}

/* ============================================
   TEMPLATE: DATA BAR CHART
   ============================================ */

.rp-visual[data-template="data-bar-chart"] .rp-visual__container {
  background: linear-gradient(135deg, #f8fafc 0%, var(--rp-bg-white) 100%) !important;
}

.rp-visual .rp-bars__title {
  all: initial !important;
  animation: unset !important;
  display: block !important;
  font-family: inherit !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  color: var(--rp-text-primary) !important;
  margin: 0 0 1.25rem 0 !important;
}

.rp-visual .rp-bars__list {
  all: initial !important;
  animation: unset !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 1rem !important;
  font-family: inherit !important;
}

.rp-visual .rp-bars__item {
  all: initial !important;
  animation: unset !important;
  display: block !important;
  font-family: inherit !important;
}

/* Hide items based on count */
.rp-visual[data-count="2"] .rp-bars__item[data-index="3"],
.rp-visual[data-count="2"] .rp-bars__item[data-index="4"],
.rp-visual[data-count="3"] .rp-bars__item[data-index="4"] {
  display: none !important;
}

.rp-visual .rp-bars__row {
  all: initial !important;
  animation: unset !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin: 0 0 0.5rem 0 !important;
  font-family: inherit !important;
}

.rp-visual .rp-bars__label {
  all: initial !important;
  animation: unset !important;
  display: block !important;
  font-family: inherit !important;
  font-size: 0.875rem !important;
  font-weight: 600 !important;
  color: var(--rp-text-primary) !important;
}

.rp-visual .rp-bars__value {
  all: initial !important;
  animation: unset !important;
  display: inline !important;
  font-family: inherit !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  color: var(--rp-primary) !important;
}

.rp-visual .rp-bars__unit {
  all: initial !important;
  animation: unset !important;
  display: inline !important;
  font-family: inherit !important;
  font-size: 0.75rem !important;
  font-weight: 400 !important;
  color: var(--rp-text-muted) !important;
  margin: 0 0 0 0.25rem !important;
}

.rp-visual .rp-bars__track {
  all: initial !important;
  animation: unset !important;
  display: block !important;
  height: 28px !important;
  background: var(--rp-bg-subtle) !important;
  border-radius: 6px !important;
  overflow: hidden !important;
}

.rp-visual .rp-bars__fill {
  /* Explicit resets instead of all:initial - allows animation */
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  font: inherit !important;
  color: inherit !important;
  text-decoration: none !important;
  box-shadow: none !important;
  outline: none !important;
  /* Element styles */
  display: block !important;
  height: 100% !important;
  background: linear-gradient(90deg, var(--rp-primary), var(--rp-primary-light)) !important;
  border-radius: 6px !important;
  transform-origin: left !important;
  width: calc(var(--bar-percent, 50) * 1%) !important;
  position: relative !important;
  overflow: hidden !important;
}

/* V3: Shimmer effect on progress bars */
.rp-visual.is-visible .rp-bars__fill::after {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 100%
  ) !important;
  background-size: 200% 100% !important;
  animation: rp-shimmer 3s ease-in-out infinite !important;
}

/* ============================================
   TEMPLATE: METRIC HIGHLIGHT
   ============================================ */

.rp-visual[data-template="metric-highlight"] .rp-visual__container {
  text-align: center !important;
}

.rp-visual[data-template="metric-highlight"][data-level="success"] .rp-visual__container {
  background: linear-gradient(135deg, #f0fdf4 0%, var(--rp-bg-white) 100%) !important;
  --rp-metric-color: var(--rp-success);
}

.rp-visual[data-template="metric-highlight"][data-level="warning"] .rp-visual__container {
  background: linear-gradient(135deg, #fffbeb 0%, var(--rp-bg-white) 100%) !important;
  --rp-metric-color: var(--rp-warning);
}

.rp-visual[data-template="metric-highlight"][data-level="danger"] .rp-visual__container {
  background: linear-gradient(135deg, #fef2f2 0%, var(--rp-bg-white) 100%) !important;
  --rp-metric-color: var(--rp-danger);
}

.rp-visual .rp-metric__gauge {
  all: initial !important;
  animation: unset !important;
  display: block !important;
  width: 180px !important;
  margin: 0 auto 1rem auto !important;
  position: relative !important;
}

.rp-visual .rp-metric__svg {
  all: initial !important;
  animation: unset !important;
  display: block !important;
  width: 100% !important;
  height: auto !important;
}

.rp-visual .rp-metric__track {
  stroke: var(--rp-border) !important;
}

.rp-visual .rp-metric__arc {
  /* stroke-dasharray/offset applied only when JS enabled */
}

.rp-visual .rp-metric__score {
  all: initial !important;
  animation: unset !important;
  display: flex !important;
  align-items: baseline !important;
  justify-content: center !important;
  gap: 0.125rem !important;
  margin: -2rem 0 0 0 !important;
  font-family: inherit !important;
}

/* Base state: animation enabled via FORCE ANIMATIONS section */
.rp-visual .rp-metric__value {
  /* Explicit resets instead of all:initial - allows animation */
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  text-decoration: none !important;
  box-shadow: none !important;
  outline: none !important;
  /* Element styles */
  display: inline !important;
  font-family: inherit !important;
  font-size: 2.5rem !important;
  font-weight: 800 !important;
  color: var(--rp-metric-color, var(--rp-primary)) !important;
}

/* V3: Visible state with pulse animation */
.rp-visual.is-visible .rp-metric__value {
  animation: rp-pulse 3s ease-in-out infinite !important;
}

.rp-visual .rp-metric__max {
  all: initial !important;
  animation: unset !important;
  display: inline !important;
  font-family: inherit !important;
  font-size: 1rem !important;
  font-weight: 400 !important;
  color: var(--rp-text-muted) !important;
}

.rp-visual .rp-metric__info {
  all: initial !important;
  animation: unset !important;
  display: block !important;
  margin: 1rem 0 0 0 !important;
  font-family: inherit !important;
}

.rp-visual .rp-metric__label {
  all: initial !important;
  animation: unset !important;
  display: block !important;
  font-family: inherit !important;
  font-size: 0.9375rem !important;
  font-weight: 600 !important;
  color: var(--rp-text-secondary) !important;
  margin: 0 0 0.5rem 0 !important;
}

.rp-visual .rp-metric__badge {
  all: initial !important;
  animation: unset !important;
  display: inline-block !important;
  padding: 0.25rem 0.75rem !important;
  background: var(--rp-metric-color, var(--rp-success)) !important;
  color: white !important;
  border-radius: 999px !important;
  font-family: inherit !important;
  font-size: 0.8125rem !important;
  font-weight: 700 !important;
}

.rp-visual .rp-metric__context {
  all: initial !important;
  animation: unset !important;
  display: flex !important;
  justify-content: center !important;
  gap: 1.5rem !important;
  margin: 1rem 0 0 0 !important;
  padding: 0.75rem 0 0 0 !important;
  border-top: 1px solid var(--rp-border) !important;
  font-family: inherit !important;
}

.rp-visual .rp-metric__percentile,
.rp-visual .rp-metric__comparison {
  all: initial !important;
  animation: unset !important;
  display: block !important;
  font-family: inherit !important;
  font-size: 0.75rem !important;
  color: var(--rp-text-muted) !important;
}

.rp-visual .rp-metric__percentile:empty,
.rp-visual .rp-metric__comparison:empty {
  display: none !important;
}

/* ============================================
   TEMPLATE: PROCESS TIMELINE
   ============================================ */

.rp-visual[data-template="process-timeline"] .rp-visual__container {
  background: linear-gradient(159deg, #f6f4f4 0%, #eae2e2 100%) !important;
}

.rp-visual .rp-timeline__header {
  all: initial !important;
  animation: unset !important;
  display: block !important;
  font-family: inherit !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  color: var(--rp-text-primary) !important;
  margin: 0 0 1.25rem 0 !important;
  text-align: center !important;
}

.rp-visual .rp-timeline__header:empty {
  display: none !important;
}

/* Timeline Track - Connecting Line */
.rp-visual .rp-timeline__track {
  all: initial !important;
  animation: unset !important;
  display: block !important;
  position: relative !important;
  width: 100% !important;
  height: 4px !important;
  margin: 1.5rem 0 !important;
}

.rp-visual .rp-timeline__svg {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
}

.rp-visual .rp-timeline__line {
  stroke: var(--rp-border) !important;
  stroke-width: 2 !important;
  stroke-linecap: round !important;
}

.rp-visual .rp-timeline__progress {
  stroke: var(--rp-primary) !important;
  stroke-width: 3 !important;
  stroke-linecap: round !important;
  stroke-dasharray: 8 4 !important;
  stroke-dashoffset: 0 !important;
}

/* V3: Continuous flowing line animation */
.rp-visual.is-visible .rp-timeline__progress {
  animation: rp-flowLine 1.5s linear infinite !important;
}

.rp-visual .rp-timeline__steps {
  all: initial !important;
  animation: unset !important;
  display: grid !important;
  gap: 1rem !important;
  font-family: inherit !important;
}

/* Dynamic grid based on step count */
.rp-visual[data-count="2"] .rp-timeline__steps { grid-template-columns: repeat(2, 1fr) !important; }
.rp-visual[data-count="3"] .rp-timeline__steps { grid-template-columns: repeat(3, 1fr) !important; }
.rp-visual[data-count="4"] .rp-timeline__steps { grid-template-columns: repeat(4, 1fr) !important; }
.rp-visual[data-count="5"] .rp-timeline__steps { grid-template-columns: repeat(5, 1fr) !important; }
.rp-visual[data-count="6"] .rp-timeline__steps { grid-template-columns: repeat(6, 1fr) !important; }

/* Hide steps based on count */
.rp-visual[data-count="2"] .rp-timeline__step[data-step="3"],
.rp-visual[data-count="2"] .rp-timeline__step[data-step="4"],
.rp-visual[data-count="2"] .rp-timeline__step[data-step="5"],
.rp-visual[data-count="2"] .rp-timeline__step[data-step="6"],
.rp-visual[data-count="3"] .rp-timeline__step[data-step="4"],
.rp-visual[data-count="3"] .rp-timeline__step[data-step="5"],
.rp-visual[data-count="3"] .rp-timeline__step[data-step="6"],
.rp-visual[data-count="4"] .rp-timeline__step[data-step="5"],
.rp-visual[data-count="4"] .rp-timeline__step[data-step="6"],
.rp-visual[data-count="5"] .rp-timeline__step[data-step="6"] {
  display: none !important;
}

.rp-visual .rp-timeline__step {
  all: initial !important;
  animation: unset !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
  padding: 1rem 0.5rem !important;
  background: var(--rp-bg-white) !important;
  border: 1px solid var(--rp-border) !important;
  border-radius: 8px !important;
  font-family: inherit !important;
  box-sizing: border-box !important;
  min-width: 0 !important;
  overflow: visible !important;
}

.rp-visual .rp-timeline__number {
  /* Explicit resets instead of all:initial - allows animation */
  padding: 0 !important;
  border: 0 !important;
  text-decoration: none !important;
  box-shadow: none !important;
  outline: none !important;
  /* Element styles */
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 40px !important;
  height: 40px !important;
  margin: 0 0 0.75rem 0 !important;
  background: linear-gradient(135deg, var(--rp-primary), var(--rp-primary-dark)) !important;
  color: white !important;
  border-radius: 50% !important;
  font-family: inherit !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  position: relative !important;
  box-sizing: border-box !important;
}

/* V3: Sequential pulse animation for timeline numbers */
.rp-visual.is-visible .rp-timeline__step[data-step="1"] .rp-timeline__number {
  animation: rp-sequencePulse 4s ease-in-out infinite !important;
  animation-delay: 0s !important;
}
.rp-visual.is-visible .rp-timeline__step[data-step="2"] .rp-timeline__number {
  animation: rp-sequencePulse 4s ease-in-out infinite !important;
  animation-delay: 0.6s !important;
}
.rp-visual.is-visible .rp-timeline__step[data-step="3"] .rp-timeline__number {
  animation: rp-sequencePulse 4s ease-in-out infinite !important;
  animation-delay: 1.2s !important;
}
.rp-visual.is-visible .rp-timeline__step[data-step="4"] .rp-timeline__number {
  animation: rp-sequencePulse 4s ease-in-out infinite !important;
  animation-delay: 1.8s !important;
}
.rp-visual.is-visible .rp-timeline__step[data-step="5"] .rp-timeline__number {
  animation: rp-sequencePulse 4s ease-in-out infinite !important;
  animation-delay: 2.4s !important;
}
.rp-visual.is-visible .rp-timeline__step[data-step="6"] .rp-timeline__number {
  animation: rp-sequencePulse 4s ease-in-out infinite !important;
  animation-delay: 3s !important;
}

.rp-visual .rp-timeline__step--final .rp-timeline__number {
  background: linear-gradient(135deg, var(--rp-success), var(--rp-success-light)) !important;
}

.rp-visual .rp-timeline__check {
  all: initial !important;
  animation: unset !important;
  display: none !important;
  position: absolute !important;
  top: -4px !important;
  right: -4px !important;
  width: 16px !important;
  height: 16px !important;
  background: white !important;
  border-radius: 50% !important;
  color: var(--rp-success) !important;
}

.rp-visual .rp-timeline__step--final .rp-timeline__check {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.rp-visual .rp-timeline__content {
  all: initial !important;
  animation: unset !important;
  display: block !important;
  font-family: inherit !important;
}

.rp-visual .rp-timeline__title {
  all: initial !important;
  animation: unset !important;
  display: block !important;
  font-family: inherit !important;
  font-size: 0.875rem !important;
  font-weight: 700 !important;
  color: var(--rp-text-primary) !important;
  margin: 0 0 0.25rem 0 !important;
  white-space: normal !important;
  overflow: visible !important;
  word-wrap: break-word !important;
  min-width: 0 !important;
}

.rp-visual .rp-timeline__desc {
  all: initial !important;
  animation: unset !important;
  display: block !important;
  font-family: inherit !important;
  font-size: 0.75rem !important;
  color: var(--rp-text-secondary) !important;
  line-height: 1.4 !important;
  white-space: normal !important;
  overflow: visible !important;
  word-wrap: break-word !important;
  min-width: 0 !important;
}

/* Timeline responsive rules moved to main RESPONSIVE section */

/* ============================================
   TEMPLATE: COMPARISON SPLIT
   ============================================ */

.rp-visual[data-template="comparison-split"] .rp-visual__container {
  background: linear-gradient(135deg, #faf5ff 0%, var(--rp-bg-white) 100%) !important;
}

.rp-visual .rp-split__title {
  all: initial !important;
  animation: unset !important;
  display: block !important;
  font-family: inherit !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  color: var(--rp-text-primary) !important;
  text-align: center !important;
  margin: 0 0 1.25rem 0 !important;
}

.rp-visual .rp-split__content {
  all: initial !important;
  animation: unset !important;
  display: grid !important;
  grid-template-columns: 1fr auto 1fr !important;
  gap: 1rem !important;
  font-family: inherit !important;
}

.rp-visual .rp-split__side {
  all: initial !important;
  animation: unset !important;
  display: block !important;
  padding: 1rem !important;
  background: var(--rp-bg-white) !important;
  border: 1px solid var(--rp-border) !important;
  border-radius: 8px !important;
  font-family: inherit !important;
  box-sizing: border-box !important;
}

.rp-visual .rp-split__header {
  all: initial !important;
  animation: unset !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin: 0 0 0.75rem 0 !important;
  font-family: inherit !important;
}

.rp-visual .rp-split__label {
  all: initial !important;
  animation: unset !important;
  display: block !important;
  font-family: inherit !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  color: var(--rp-text-primary) !important;
}

.rp-visual .rp-split__score {
  all: initial !important;
  animation: unset !important;
  display: block !important;
  font-family: inherit !important;
  font-size: 0.875rem !important;
  font-weight: 600 !important;
  color: var(--rp-primary) !important;
}

.rp-visual .rp-split__score:empty {
  display: none !important;
}

.rp-visual .rp-split__points {
  all: initial !important;
  animation: unset !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 0.5rem !important;
  font-family: inherit !important;
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.rp-visual .rp-split__points li {
  all: initial !important;
  animation: unset !important;
  display: flex !important;
  align-items: flex-start !important;
  gap: 0.5rem !important;
  font-family: inherit !important;
  font-size: 0.875rem !important;
  color: var(--rp-text-secondary) !important;
  line-height: 1.4 !important;
}

.rp-visual .rp-split__points li::before {
  content: '' !important;
  display: block !important;
  width: 6px !important;
  height: 6px !important;
  margin: 0.4rem 0 0 0 !important;
  background: var(--rp-primary) !important;
  border-radius: 50% !important;
  flex-shrink: 0 !important;
}

.rp-visual .rp-split__badge {
  /* Explicit resets instead of all:initial - allows animation */
  border: 0 !important;
  text-decoration: none !important;
  box-shadow: none !important;
  outline: none !important;
  /* Element styles */
  display: none !important;
  margin: 0.75rem 0 0 0 !important;
  padding: 0.25rem 0.5rem !important;
  background: var(--rp-success) !important;
  color: white !important;
  font-family: inherit !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  border-radius: 4px !important;
  text-align: center !important;
}

/* Winner highlighting */
.rp-visual[data-winner="left"] .rp-split__side--left,
.rp-visual[data-winner="right"] .rp-split__side--right {
  border-color: var(--rp-success) !important;
  background: linear-gradient(135deg, #f0fdf4 0%, var(--rp-bg-white) 100%) !important;
}

.rp-visual[data-winner="left"] .rp-split__side--left .rp-split__badge,
.rp-visual[data-winner="right"] .rp-split__side--right .rp-split__badge {
  display: block !important;
}

/* V3: Winner badge glow animation */
.rp-visual.is-visible[data-winner="left"] .rp-split__side--left .rp-split__badge,
.rp-visual.is-visible[data-winner="right"] .rp-split__side--right .rp-split__badge {
  animation: rp-glow 2s ease-in-out infinite !important;
}

.rp-visual[data-winner="left"] .rp-split__side--left .rp-split__points li::before,
.rp-visual[data-winner="right"] .rp-split__side--right .rp-split__points li::before {
  background: var(--rp-success) !important;
}

.rp-visual .rp-split__divider {
  all: initial !important;
  animation: unset !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.rp-visual .rp-split__vs {
  /* Explicit resets instead of all:initial - allows animation */
  margin: 0 !important;
  padding: 0 !important;
  text-decoration: none !important;
  box-shadow: none !important;
  outline: none !important;
  /* Element styles */
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 36px !important;
  height: 36px !important;
  background: var(--rp-bg-subtle) !important;
  border: 1px solid var(--rp-border) !important;
  border-radius: 50% !important;
  font-family: inherit !important;
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  color: var(--rp-text-muted) !important;
}

/* V3: VS badge pulse animation */
.rp-visual.is-visible .rp-split__vs {
  animation: rp-pulse 2.5s ease-in-out infinite !important;
}

/* Split responsive rules moved to main RESPONSIVE section */

/* ============================================
   TEMPLATE: CONCEPT FOCUS
   ============================================ */

.rp-visual[data-template="concept-focus"] .rp-visual__container {
  display: grid !important;
  grid-template-columns: 60px 1fr !important;
  gap: 1rem !important;
  align-items: start !important;
  border-left: 4px solid var(--rp-primary) !important;
  background: linear-gradient(135deg, #eff6ff 0%, var(--rp-bg-white) 100%) !important;
  position: relative !important;
}

.rp-visual .rp-focus__icon {
  /* Explicit resets instead of all:initial - allows animation */
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  text-decoration: none !important;
  box-shadow: none !important;
  outline: none !important;
  /* Element styles */
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 60px !important;
  height: 60px !important;
  background: linear-gradient(135deg, var(--rp-primary), var(--rp-primary-dark)) !important;
  border-radius: 12px !important;
  color: white !important;
  box-sizing: border-box !important;
}

/* V3: Floating icon animation */
.rp-visual.is-visible .rp-focus__icon {
  animation: rp-float 3s ease-in-out infinite !important;
}

.rp-visual .rp-focus__icon svg {
  display: none !important;
  width: 28px !important;
  height: 28px !important;
  fill: currentColor !important;
}

/* Show icon based on variant */
.rp-visual[data-variant="quote"] .rp-focus__icon svg.rp-focus__icon-quote,
.rp-visual[data-variant="definition"] .rp-focus__icon svg.rp-focus__icon-definition,
.rp-visual[data-variant="insight"] .rp-focus__icon svg.rp-focus__icon-insight {
  display: block !important;
}

.rp-visual .rp-focus__content {
  all: initial !important;
  animation: unset !important;
  display: block !important;
  font-family: inherit !important;
}

.rp-visual .rp-focus__title {
  all: initial !important;
  animation: unset !important;
  display: block !important;
  font-family: inherit !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  color: var(--rp-text-primary) !important;
  margin: 0 0 0.5rem 0 !important;
}

.rp-visual .rp-focus__text {
  all: initial !important;
  animation: unset !important;
  display: block !important;
  font-family: inherit !important;
  font-size: 0.9375rem !important;
  color: var(--rp-text-secondary) !important;
  line-height: 1.6 !important;
}

.rp-visual .rp-focus__source {
  all: initial !important;
  animation: unset !important;
  display: block !important;
  margin: 0.75rem 0 0 0 !important;
  font-family: inherit !important;
  font-size: 0.8125rem !important;
  font-style: italic !important;
  color: var(--rp-text-muted) !important;
}

.rp-visual .rp-focus__source:empty {
  display: none !important;
}

/* Quote marks (for quote variant) */
.rp-visual .rp-focus__quote-mark {
  all: initial !important;
  animation: unset !important;
  display: none !important;
  position: absolute !important;
  width: 48px !important;
  height: 48px !important;
  color: var(--rp-primary) !important;
  opacity: 0.1 !important;
}

.rp-visual[data-variant="quote"] .rp-focus__quote-mark {
  display: block !important;
}

.rp-visual .rp-focus__quote-mark--open {
  top: 0.5rem !important;
  left: 4.5rem !important;
}

.rp-visual .rp-focus__quote-mark--close {
  bottom: 0.5rem !important;
  right: 0.5rem !important;
}

.rp-visual[data-variant="quote"] .rp-focus__text {
  font-style: italic !important;
}

.rp-visual[data-variant="definition"] .rp-focus__title {
  font-size: 1.125rem !important;
  color: var(--rp-primary) !important;
}

/* Concept Focus responsive rules moved to main RESPONSIVE section */

/* ============================================
   TEMPLATE: ALERT SHIELD
   ============================================ */

.rp-visual[data-template="alert-shield"] .rp-visual__container {
  display: grid !important;
  grid-template-columns: 56px 1fr !important;
  gap: 1rem !important;
  align-items: start !important;
  border-left: 4px solid var(--rp-danger) !important;
  background: linear-gradient(135deg, #fef2f2 0%, var(--rp-bg-white) 100%) !important;
}

.rp-visual .rp-alert__icon {
  /* Explicit resets instead of all:initial - allows animation */
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  text-decoration: none !important;
  box-shadow: none !important;
  outline: none !important;
  /* Element styles */
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 56px !important;
  height: 56px !important;
  background: var(--rp-danger) !important;
  border-radius: 12px !important;
  color: white !important;
  box-sizing: border-box !important;
}

/* V3: Floating icon animation for alerts - uses data-animate for reliability */
.rp-visual[data-animate="true"] .rp-alert__icon {
  animation: rp-shake 0.8s ease-in-out infinite !important;
}

.rp-visual .rp-alert__icon svg {
  display: none !important;
  width: 28px !important;
  height: 28px !important;
  fill: currentColor !important;
}

/* Show icon based on type */
.rp-visual[data-type="danger"] .rp-alert__icon svg.rp-alert__icon-danger,
.rp-visual[data-type="warning"] .rp-alert__icon svg.rp-alert__icon-warning,
.rp-visual[data-type="info"] .rp-alert__icon svg.rp-alert__icon-info,
.rp-visual[data-type="tip"] .rp-alert__icon svg.rp-alert__icon-tip {
  display: block !important;
}

/* Type-specific colors */
.rp-visual[data-type="warning"] .rp-visual__container {
  border-left-color: var(--rp-warning) !important;
  background: linear-gradient(135deg, #fffbeb 0%, var(--rp-bg-white) 100%) !important;
}
.rp-visual[data-type="warning"] .rp-alert__icon { background: var(--rp-warning) !important; }
.rp-visual[data-type="warning"] .rp-alert__title { color: var(--rp-warning) !important; }

.rp-visual[data-type="info"] .rp-visual__container {
  border-left-color: var(--rp-info) !important;
  background: linear-gradient(135deg, #eff6ff 0%, var(--rp-bg-white) 100%) !important;
}
.rp-visual[data-type="info"] .rp-alert__icon { background: var(--rp-info) !important; }
.rp-visual[data-type="info"] .rp-alert__title { color: var(--rp-info) !important; }

.rp-visual[data-type="tip"] .rp-visual__container {
  border-left-color: var(--rp-tip) !important;
  background: linear-gradient(135deg, #f0fdf4 0%, var(--rp-bg-white) 100%) !important;
}
.rp-visual[data-type="tip"] .rp-alert__icon { background: var(--rp-tip) !important; }
.rp-visual[data-type="tip"] .rp-alert__title { color: var(--rp-tip) !important; }

.rp-visual .rp-alert__content {
  all: initial !important;
  animation: unset !important;
  display: block !important;
  font-family: inherit !important;
}

.rp-visual .rp-alert__title {
  all: initial !important;
  animation: unset !important;
  display: block !important;
  font-family: inherit !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  color: var(--rp-danger) !important;
  margin: 0 0 0.5rem 0 !important;
  white-space: normal !important;
  overflow: visible !important;
  word-wrap: break-word !important;
}

.rp-visual .rp-alert__message {
  all: initial !important;
  animation: unset !important;
  display: block !important;
  font-family: inherit !important;
  font-size: 0.9375rem !important;
  font-weight: 500 !important;
  color: var(--rp-text-primary) !important;
  line-height: 1.5 !important;
  white-space: normal !important;
  overflow: visible !important;
  word-wrap: break-word !important;
}

.rp-visual .rp-alert__details {
  all: initial !important;
  animation: unset !important;
  display: block !important;
  margin: 0.5rem 0 0 0 !important;
  font-family: inherit !important;
  font-size: 0.8125rem !important;
  color: var(--rp-text-secondary) !important;
  line-height: 1.5 !important;
}

.rp-visual .rp-alert__details:empty {
  display: none !important;
}

/* Alert Shield responsive rules moved to main RESPONSIVE section */

/* ============================================
   TEMPLATE: SUCCESS CHECKLIST
   ============================================ */

.rp-visual[data-template="success-checklist"] .rp-visual__container {
  background: linear-gradient(182deg, #e7ffefc4 0%, #ffffff 100%) !important;
}

.rp-visual .rp-checklist__header {
  all: initial !important;
  animation: unset !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin: 0 0 1rem 0 !important;
  font-family: inherit !important;
}

.rp-visual .rp-checklist__title {
  all: initial !important;
  animation: unset !important;
  display: block !important;
  font-family: inherit !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  color: var(--rp-text-primary) !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  word-wrap: break-word !important;
}

.rp-visual .rp-checklist__count {
  /* Explicit resets instead of all:initial - allows animation */
  margin: 0 !important;
  border: 0 !important;
  text-decoration: none !important;
  box-shadow: none !important;
  outline: none !important;
  /* Element styles */
  display: inline-block !important;
  padding: 0.25rem 0.5rem !important;
  background: var(--rp-success) !important;
  color: white !important;
  border-radius: 999px !important;
  font-family: inherit !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
}

/* V3: Pulse animation on count badge */
.rp-visual.is-visible .rp-checklist__count {
  animation: rp-pulse 2.5s ease-in-out infinite !important;
}

.rp-visual .rp-checklist__list {
  all: initial !important;
  animation: unset !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 0.75rem !important;
  font-family: inherit !important;
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.rp-visual .rp-checklist__item {
  all: initial !important;
  animation: unset !important;
  display: flex !important;
  align-items: flex-start !important;
  gap: 0.5rem !important;
  font-family: inherit !important;
  font-size: 0.9375rem !important;
  color: var(--rp-text-primary) !important;
  line-height: 1.5 !important;
  min-width: 0 !important;
  overflow: visible !important;
}

/* Hide items based on count */
.rp-visual[data-count="3"] .rp-checklist__item[data-index="4"],
.rp-visual[data-count="3"] .rp-checklist__item[data-index="5"],
.rp-visual[data-count="3"] .rp-checklist__item[data-index="6"],
.rp-visual[data-count="4"] .rp-checklist__item[data-index="5"],
.rp-visual[data-count="4"] .rp-checklist__item[data-index="6"],
.rp-visual[data-count="5"] .rp-checklist__item[data-index="6"] {
  display: none !important;
}

.rp-visual .rp-checklist__marker {
  all: initial !important;
  animation: unset !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 24px !important;
  height: 24px !important;
  flex-shrink: 0 !important;
}

.rp-visual .rp-checklist__check {
  /* Explicit resets instead of all:initial - allows animation */
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  text-decoration: none !important;
  outline: none !important;
  /* Element styles - modern circular badge */
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 24px !important;
  height: 24px !important;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%) !important;
  border-radius: 50% !important;
  color: #ffffff !important;
  box-shadow: 0 2px 4px rgba(34, 197, 94, 0.3) !important;
}

/* V4: Modern pulse animation for checkmarks */
.rp-visual.is-visible .rp-checklist__item[data-index="1"] .rp-checklist__check {
  animation: rp-checkPulse 2.5s ease-in-out infinite !important;
  animation-delay: 0s !important;
}
.rp-visual.is-visible .rp-checklist__item[data-index="2"] .rp-checklist__check {
  animation: rp-checkPulse 2.5s ease-in-out infinite !important;
  animation-delay: 0.4s !important;
}
.rp-visual.is-visible .rp-checklist__item[data-index="3"] .rp-checklist__check {
  animation: rp-checkPulse 2.5s ease-in-out infinite !important;
  animation-delay: 0.8s !important;
}
.rp-visual.is-visible .rp-checklist__item[data-index="4"] .rp-checklist__check {
  animation: rp-checkPulse 2.5s ease-in-out infinite !important;
  animation-delay: 1.2s !important;
}
.rp-visual.is-visible .rp-checklist__item[data-index="5"] .rp-checklist__check {
  animation: rp-checkPulse 2.5s ease-in-out infinite !important;
  animation-delay: 1.6s !important;
}
.rp-visual.is-visible .rp-checklist__item[data-index="6"] .rp-checklist__check {
  animation: rp-checkPulse 2.5s ease-in-out infinite !important;
  animation-delay: 2s !important;
}

.rp-visual .rp-checklist__check svg {
  display: block !important;
  width: 12px !important;
  height: 12px !important;
}

.rp-visual .rp-checklist__number {
  all: initial !important;
  animation: unset !important;
  display: none !important;
  font-family: inherit !important;
  font-size: 0.875rem !important;
  font-weight: 700 !important;
  color: var(--rp-success) !important;
}

/* Numbered style */
.rp-visual[data-style="numbered"] .rp-checklist__check {
  display: none !important;
}

.rp-visual[data-style="numbered"] .rp-checklist__number {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 24px !important;
  height: 24px !important;
  background: var(--rp-success) !important;
  color: white !important;
  border-radius: 50% !important;
}

/* V3: Sequential pulse for numbered checklist badges */
.rp-visual[data-style="numbered"].is-visible .rp-checklist__item[data-index="1"] .rp-checklist__number {
  animation: rp-sequencePulse 4s ease-in-out infinite !important;
  animation-delay: 0s !important;
}
.rp-visual[data-style="numbered"].is-visible .rp-checklist__item[data-index="2"] .rp-checklist__number {
  animation: rp-sequencePulse 4s ease-in-out infinite !important;
  animation-delay: 0.6s !important;
}
.rp-visual[data-style="numbered"].is-visible .rp-checklist__item[data-index="3"] .rp-checklist__number {
  animation: rp-sequencePulse 4s ease-in-out infinite !important;
  animation-delay: 1.2s !important;
}
.rp-visual[data-style="numbered"].is-visible .rp-checklist__item[data-index="4"] .rp-checklist__number {
  animation: rp-sequencePulse 4s ease-in-out infinite !important;
  animation-delay: 1.8s !important;
}
.rp-visual[data-style="numbered"].is-visible .rp-checklist__item[data-index="5"] .rp-checklist__number {
  animation: rp-sequencePulse 4s ease-in-out infinite !important;
  animation-delay: 2.4s !important;
}
.rp-visual[data-style="numbered"].is-visible .rp-checklist__item[data-index="6"] .rp-checklist__number {
  animation: rp-sequencePulse 4s ease-in-out infinite !important;
  animation-delay: 3s !important;
}

.rp-visual .rp-checklist__text {
  all: initial !important;
  animation: unset !important;
  display: block !important;
  font-family: inherit !important;
  color: inherit !important;
  white-space: normal !important;
  overflow: visible !important;
  word-wrap: break-word !important;
  line-height: 1.5 !important;
  min-width: 0 !important;
}

/* ============================================
   JS-ENABLED INITIAL STATES (hidden for animation)
   Only hide elements when JavaScript is active
   Fallback: content visible without JS (SEO friendly)
   ============================================ */

/* Hide elements only when JS is enabled - they will animate in */
.rp-js-enabled .rp-visual:not(.is-visible) .rp-trend__delta {
  opacity: 0 !important;
  transform: scale(0.8) !important;
}

.rp-js-enabled .rp-visual:not(.is-visible) .rp-trend__area {
  opacity: 0 !important;
}

.rp-js-enabled .rp-visual:not(.is-visible) .rp-trend__curve {
  stroke-dasharray: 1000 !important;
  stroke-dashoffset: 1000 !important;
}

.rp-js-enabled .rp-visual:not(.is-visible) .rp-trend__point {
  opacity: 0 !important;
  transform: scale(0.8) !important;
}

.rp-js-enabled .rp-visual:not(.is-visible) .rp-bars__item {
  opacity: 0 !important;
  transform: translateY(16px) !important;
}

.rp-js-enabled .rp-visual:not(.is-visible) .rp-bars__fill {
  transform: scaleX(0) !important;
}

.rp-js-enabled .rp-visual:not(.is-visible) .rp-metric__arc {
  stroke-dasharray: 251 !important;
  stroke-dashoffset: 251 !important;
}

.rp-js-enabled .rp-visual:not(.is-visible) .rp-timeline__step {
  opacity: 0 !important;
  transform: translateY(16px) !important;
}

.rp-js-enabled .rp-visual:not(.is-visible) .rp-split__side {
  opacity: 0 !important;
  transform: translateY(16px) !important;
}

.rp-js-enabled .rp-visual:not(.is-visible) .rp-focus__content {
  opacity: 0 !important;
  transform: translateX(-16px) !important;
}

.rp-js-enabled .rp-visual:not(.is-visible) .rp-alert__icon {
  opacity: 0 !important;
  transform: scale(0.8) !important;
}

.rp-js-enabled .rp-visual:not(.is-visible) .rp-alert__content {
  opacity: 0 !important;
  transform: translateX(-16px) !important;
}

.rp-js-enabled .rp-visual:not(.is-visible) .rp-checklist__item {
  opacity: 0 !important;
  transform: translateX(-16px) !important;
}

.rp-js-enabled .rp-visual:not(.is-visible) .rp-checklist__check path {
  stroke-dasharray: 24 !important;
  stroke-dashoffset: 24 !important;
}

/* ============================================
   ANIMATION TRIGGERS (only when visible)
   ============================================ */

/* Enable animations when visible */
.rp-visual.is-visible .rp-trend__delta {
  animation: rp-scaleIn 0.4s ease-out 0.5s both !important;
}

.rp-visual.is-visible .rp-trend__area {
  animation: rp-fadeIn 0.8s ease-out 1s forwards !important;
}

.rp-visual.is-visible .rp-trend__curve {
  animation: rp-drawLine 1.5s ease-out 0.3s forwards !important;
}

.rp-visual.is-visible .rp-trend__point {
  animation: rp-scaleIn 0.3s ease-out forwards !important;
}

.rp-visual.is-visible .rp-trend__point--start { animation-delay: 0.3s !important; }
.rp-visual.is-visible .rp-trend__point--end { animation-delay: 1.5s !important; }

.rp-visual.is-visible .rp-bars__item {
  animation: rp-slideUp 0.5s ease-out both !important;
}

.rp-visual.is-visible .rp-bars__item[data-index="1"] { animation-delay: 0.1s !important; }
.rp-visual.is-visible .rp-bars__item[data-index="2"] { animation-delay: 0.2s !important; }
.rp-visual.is-visible .rp-bars__item[data-index="3"] { animation-delay: 0.3s !important; }
.rp-visual.is-visible .rp-bars__item[data-index="4"] { animation-delay: 0.4s !important; }

.rp-visual.is-visible .rp-bars__fill {
  animation: rp-fillBar 0.8s ease-out forwards !important;
}

.rp-visual.is-visible .rp-bars__item[data-index="1"] .rp-bars__fill { animation-delay: 0.3s !important; }
.rp-visual.is-visible .rp-bars__item[data-index="2"] .rp-bars__fill { animation-delay: 0.5s !important; }
.rp-visual.is-visible .rp-bars__item[data-index="3"] .rp-bars__fill { animation-delay: 0.7s !important; }
.rp-visual.is-visible .rp-bars__item[data-index="4"] .rp-bars__fill { animation-delay: 0.9s !important; }

.rp-visual.is-visible .rp-metric__arc {
  animation: rp-drawLine 1.5s ease-out 0.3s forwards !important;
}

.rp-visual.is-visible .rp-timeline__step {
  animation: rp-slideUp 0.5s ease-out both !important;
}

.rp-visual.is-visible .rp-timeline__step[data-step="1"] { animation-delay: 0.1s !important; }
.rp-visual.is-visible .rp-timeline__step[data-step="2"] { animation-delay: 0.2s !important; }
.rp-visual.is-visible .rp-timeline__step[data-step="3"] { animation-delay: 0.3s !important; }
.rp-visual.is-visible .rp-timeline__step[data-step="4"] { animation-delay: 0.4s !important; }
.rp-visual.is-visible .rp-timeline__step[data-step="5"] { animation-delay: 0.5s !important; }
.rp-visual.is-visible .rp-timeline__step[data-step="6"] { animation-delay: 0.6s !important; }

.rp-visual.is-visible .rp-split__side {
  animation: rp-slideUp 0.5s ease-out both !important;
}

.rp-visual.is-visible .rp-split__side--left { animation-delay: 0.1s !important; }
.rp-visual.is-visible .rp-split__side--right { animation-delay: 0.2s !important; }

.rp-visual.is-visible .rp-focus__content {
  animation: rp-slideRight 0.5s ease-out 0.2s both !important;
}

.rp-visual.is-visible .rp-alert__icon {
  animation: rp-shake 0.8s ease-in-out infinite !important;
}

.rp-visual.is-visible .rp-alert__content {
  animation: rp-slideRight 0.5s ease-out 0.2s both !important;
}

.rp-visual.is-visible .rp-checklist__item {
  animation: rp-slideRight 0.4s ease-out both !important;
}

.rp-visual.is-visible .rp-checklist__item[data-index="1"] { animation-delay: 0.05s !important; }
.rp-visual.is-visible .rp-checklist__item[data-index="2"] { animation-delay: 0.1s !important; }
.rp-visual.is-visible .rp-checklist__item[data-index="3"] { animation-delay: 0.15s !important; }
.rp-visual.is-visible .rp-checklist__item[data-index="4"] { animation-delay: 0.2s !important; }
.rp-visual.is-visible .rp-checklist__item[data-index="5"] { animation-delay: 0.25s !important; }
.rp-visual.is-visible .rp-checklist__item[data-index="6"] { animation-delay: 0.3s !important; }

.rp-visual.is-visible .rp-checklist__check path {
  animation: rp-drawLine 0.4s ease-out forwards !important;
}

.rp-visual.is-visible .rp-checklist__item[data-index="1"] .rp-checklist__check path { animation-delay: 0.15s !important; }
.rp-visual.is-visible .rp-checklist__item[data-index="2"] .rp-checklist__check path { animation-delay: 0.2s !important; }
.rp-visual.is-visible .rp-checklist__item[data-index="3"] .rp-checklist__check path { animation-delay: 0.25s !important; }
.rp-visual.is-visible .rp-checklist__item[data-index="4"] .rp-checklist__check path { animation-delay: 0.3s !important; }
.rp-visual.is-visible .rp-checklist__item[data-index="5"] .rp-checklist__check path { animation-delay: 0.35s !important; }
.rp-visual.is-visible .rp-checklist__item[data-index="6"] .rp-checklist__check path { animation-delay: 0.4s !important; }

/* ============================================
   RESPONSIVE - TABLET (max 768px)
   ============================================ */

@media (max-width: 768px) {
  .rp-visual {
    margin: 1.5rem 0.5rem !important;
    max-width: 100% !important;
    font-size: 15px !important;
  }

  .rp-visual .rp-visual__container {
    padding: 1.25rem !important;
    border-radius: 10px !important;
  }

  /* Timeline: 4+ columns become 2 */
  .rp-visual[data-count="4"] .rp-timeline__steps,
  .rp-visual[data-count="5"] .rp-timeline__steps,
  .rp-visual[data-count="6"] .rp-timeline__steps {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Split comparison */
  .rp-visual .rp-split__content {
    gap: 0.75rem !important;
  }

  /* Trend chart */
  .rp-visual .rp-trend__svg {
    height: 140px !important;
  }

  .rp-visual .rp-trend__label-value {
    font-size: 1.25rem !important;
  }

  /* Metric gauge */
  .rp-visual .rp-metric__gauge {
    width: 160px !important;
  }

  .rp-visual .rp-metric__value {
    font-size: 2rem !important;
  }
}

/* ============================================
   RESPONSIVE - MOBILE (max 640px)
   ============================================ */

@media (max-width: 640px) {
  .rp-visual {
    margin: 1rem 0.25rem !important;
    font-size: 14px !important;
  }

  .rp-visual .rp-visual__container {
    padding: 1rem !important;
    border-radius: 8px !important;
  }

  /* Disable hover effects on touch */
  .rp-visual .rp-visual__container:hover {
    transform: none !important;
    box-shadow: none !important;
  }

  /* ---- TIMELINE MOBILE ---- */
  /* Hide horizontal track on mobile (vertical layout) */
  .rp-visual .rp-timeline__track {
    display: none !important;
  }

  /* All timelines become single column on mobile */
  .rp-visual .rp-timeline__steps {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }

  /* Timeline step: vertical card layout (icon above text) */
  .rp-visual .rp-timeline__step {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    padding: 1rem !important;
    gap: 0.5rem !important;
  }

  .rp-visual .rp-timeline__number {
    width: 36px !important;
    height: 36px !important;
    font-size: 0.875rem !important;
    margin: 0 0 0.5rem 0 !important;
  }

  .rp-visual .rp-timeline__title {
    font-size: 0.8125rem !important;
  }

  .rp-visual .rp-timeline__desc {
    font-size: 0.6875rem !important;
  }

  /* ---- COMPARISON SPLIT MOBILE ---- */
  .rp-visual .rp-split__content {
    grid-template-columns: 1fr !important;
    gap: 0.5rem !important;
  }

  .rp-visual .rp-split__divider {
    padding: 0.5rem 0 !important;
  }

  .rp-visual .rp-split__vs {
    width: 32px !important;
    height: 32px !important;
  }

  .rp-visual .rp-split__side {
    padding: 0.875rem !important;
  }

  .rp-visual .rp-split__label {
    font-size: 0.9375rem !important;
  }

  .rp-visual .rp-split__points li {
    font-size: 0.8125rem !important;
  }

  /* ---- CONCEPT FOCUS MOBILE ---- */
  .rp-visual[data-template="concept-focus"] .rp-visual__container {
    grid-template-columns: 1fr !important;
    text-align: center !important;
    gap: 0.75rem !important;
  }

  .rp-visual .rp-focus__icon {
    margin: 0 auto !important;
    width: 48px !important;
    height: 48px !important;
  }

  .rp-visual .rp-focus__icon svg {
    width: 24px !important;
    height: 24px !important;
  }

  .rp-visual .rp-focus__title {
    font-size: 0.9375rem !important;
  }

  .rp-visual .rp-focus__text {
    font-size: 0.875rem !important;
  }

  .rp-visual .rp-focus__quote-mark {
    display: none !important;
  }

  /* ---- ALERT SHIELD MOBILE ---- */
  .rp-visual[data-template="alert-shield"] .rp-visual__container {
    grid-template-columns: 1fr !important;
    text-align: center !important;
    gap: 0.75rem !important;
  }

  .rp-visual .rp-alert__icon {
    margin: 0 auto !important;
    width: 44px !important;
    height: 44px !important;
  }

  .rp-visual .rp-alert__icon svg {
    width: 22px !important;
    height: 22px !important;
  }

  .rp-visual .rp-alert__title {
    font-size: 0.9375rem !important;
  }

  .rp-visual .rp-alert__message {
    font-size: 0.875rem !important;
  }

  .rp-visual .rp-alert__details {
    font-size: 0.75rem !important;
  }

  /* ---- TREND CHART MOBILE ---- */
  .rp-visual .rp-trend__header {
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
  }

  .rp-visual .rp-trend__metric {
    font-size: 0.75rem !important;
  }

  .rp-visual .rp-trend__delta {
    font-size: 0.6875rem !important;
    padding: 0.2rem 0.5rem !important;
  }

  .rp-visual .rp-trend__svg {
    height: 120px !important;
  }

  .rp-visual .rp-trend__label-value {
    font-size: 1.125rem !important;
  }

  .rp-visual .rp-trend__label-text {
    font-size: 0.6875rem !important;
  }

  /* ---- BAR CHART MOBILE ---- */
  .rp-visual .rp-bars__title {
    font-size: 0.9375rem !important;
  }

  .rp-visual .rp-bars__row {
    flex-wrap: wrap !important;
    gap: 0.25rem !important;
  }

  .rp-visual .rp-bars__label {
    font-size: 0.8125rem !important;
    flex: 1 1 100% !important;
  }

  .rp-visual .rp-bars__value {
    font-size: 0.875rem !important;
  }

  .rp-visual .rp-bars__unit {
    font-size: 0.6875rem !important;
  }

  .rp-visual .rp-bars__track {
    height: 24px !important;
  }

  /* ---- METRIC HIGHLIGHT MOBILE ---- */
  .rp-visual .rp-metric__gauge {
    width: 140px !important;
  }

  .rp-visual .rp-metric__value {
    font-size: 1.75rem !important;
  }

  .rp-visual .rp-metric__max {
    font-size: 0.875rem !important;
  }

  .rp-visual .rp-metric__label {
    font-size: 0.875rem !important;
  }

  .rp-visual .rp-metric__badge {
    font-size: 0.75rem !important;
    padding: 0.2rem 0.5rem !important;
  }

  .rp-visual .rp-metric__context {
    flex-direction: column !important;
    gap: 0.5rem !important;
  }

  /* ---- CHECKLIST MOBILE ---- */
  .rp-visual .rp-checklist__header {
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
  }

  .rp-visual .rp-checklist__title {
    font-size: 0.9375rem !important;
    flex: 1 1 100% !important;
  }

  .rp-visual .rp-checklist__count {
    font-size: 0.6875rem !important;
  }

  .rp-visual .rp-checklist__item {
    font-size: 0.875rem !important;
    gap: 0.5rem !important;
  }

  .rp-visual .rp-checklist__marker {
    width: 20px !important;
    height: 20px !important;
  }

  .rp-visual .rp-checklist__check {
    width: 20px !important;
    height: 20px !important;
  }

  .rp-visual .rp-checklist__check svg {
    width: 10px !important;
    height: 10px !important;
  }
}

/* ============================================
   RESPONSIVE - SMALL MOBILE (max 400px)
   ============================================ */

@media (max-width: 400px) {
  .rp-visual {
    margin: 0.75rem 0 !important;
    font-size: 13px !important;
  }

  .rp-visual .rp-visual__container {
    padding: 0.875rem !important;
    border-radius: 6px !important;
  }

  /* Timeline: even more compact */
  .rp-visual .rp-timeline__step {
    padding: 0.75rem !important;
  }

  .rp-visual .rp-timeline__number {
    width: 32px !important;
    height: 32px !important;
    font-size: 0.8125rem !important;
  }

  .rp-visual .rp-timeline__title {
    font-size: 0.75rem !important;
  }

  .rp-visual .rp-timeline__desc {
    font-size: 0.625rem !important;
    line-height: 1.3 !important;
  }

  /* Split: tighter */
  .rp-visual .rp-split__side {
    padding: 0.75rem !important;
  }

  .rp-visual .rp-split__label {
    font-size: 0.875rem !important;
  }

  .rp-visual .rp-split__points li {
    font-size: 0.75rem !important;
  }

  /* Focus/Alert: smaller icons */
  .rp-visual .rp-focus__icon,
  .rp-visual .rp-alert__icon {
    width: 40px !important;
    height: 40px !important;
  }

  .rp-visual .rp-focus__icon svg,
  .rp-visual .rp-alert__icon svg {
    width: 20px !important;
    height: 20px !important;
  }

  /* Trend: stack everything */
  .rp-visual .rp-trend__header {
    flex-direction: column !important;
    align-items: flex-start !important;
  }

  .rp-visual .rp-trend__svg {
    height: 100px !important;
  }

  /* Metric: smaller */
  .rp-visual .rp-metric__gauge {
    width: 120px !important;
  }

  .rp-visual .rp-metric__value {
    font-size: 1.5rem !important;
  }

  .rp-visual .rp-metric__score {
    margin: -1.5rem 0 0 0 !important;
  }

  /* Bars: full width labels */
  .rp-visual .rp-bars__list {
    gap: 0.75rem !important;
  }

  .rp-visual .rp-bars__track {
    height: 20px !important;
  }

  /* Checklist */
  .rp-visual .rp-checklist__list {
    gap: 0.5rem !important;
  }

  .rp-visual .rp-checklist__item {
    font-size: 0.8125rem !important;
  }
}

/* ============================================
   TEXT OVERFLOW PREVENTION V2.1 (all screens)
   Prevent text from being cut off visually
   ============================================ */

.rp-visual,
.rp-visual * {
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
  word-break: normal !important; /* V2.1: normal instead of break-word to avoid mid-word breaks */
}

/* V2.1: Allow all text containers to wrap properly */
.rp-visual .rp-timeline__content,
.rp-visual .rp-timeline__title,
.rp-visual .rp-timeline__desc,
.rp-visual .rp-split__side,
.rp-visual .rp-split__label,
.rp-visual .rp-split__points li,
.rp-visual .rp-focus__content,
.rp-visual .rp-focus__title,
.rp-visual .rp-focus__text,
.rp-visual .rp-alert__content,
.rp-visual .rp-alert__title,
.rp-visual .rp-alert__message,
.rp-visual .rp-alert__details,
.rp-visual .rp-checklist__title,
.rp-visual .rp-checklist__text,
.rp-visual .rp-bars__label,
.rp-visual .rp-bars__title,
.rp-visual .rp-trend__metric {
  max-width: 100% !important;
  overflow: visible !important;       /* V2.1: visible instead of hidden */
  text-overflow: clip !important;     /* V2.1: no ellipsis */
  white-space: normal !important;     /* V2.1: allow wrapping */
  hyphens: auto !important;
  -webkit-hyphens: auto !important;
}

/* V2.1: Comparison split points - ensure proper display */
.rp-visual .rp-split__points li {
  display: flex !important;
  align-items: flex-start !important;
  line-height: 1.4 !important;
  padding: 0.25rem 0 !important;
}

/* V2.1: Bar chart labels - stack on mobile */
.rp-visual .rp-bars__row {
  flex-wrap: wrap !important;
}

@media (max-width: 640px) {
  .rp-visual .rp-bars__label {
    flex: 1 1 100% !important;
    margin-bottom: 0.25rem !important;
  }

  /* V3 Reduced slide distance to prevent overflow */
  .rp-visual .rp-slide-in[data-side="left"]:not([data-animated]) {
    transform: translateX(-15px) !important;
  }

  .rp-visual .rp-slide-in[data-side="right"]:not([data-animated]) {
    transform: translateX(15px) !important;
  }
}

/* ============================================
   REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  .rp-visual,
  .rp-visual * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================
   PRINT
   ============================================ */

@media print {
  .rp-visual {
    page-break-inside: avoid !important;
    margin: 0.5rem 0 !important;
  }

  .rp-visual .rp-visual__container {
    border: 1px solid #000 !important;
    box-shadow: none !important;
    background: #fff !important;
  }

  .rp-visual,
  .rp-visual * {
    animation: none !important;
  }
}

/* ============================================
   NO-JS FALLBACK - Animations sans JavaScript
   Si le JS ne charge pas, les animations jouent quand même
   ============================================ */

html:not(.rp-js-enabled) .rp-visual .rp-trend__arrow {
  animation: rp-bounce 2s ease-in-out infinite !important;
}

html:not(.rp-js-enabled) .rp-visual .rp-trend__delta[data-direction="down"] .rp-trend__arrow {
  animation: rp-bounce 2s ease-in-out infinite reverse !important;
}

html:not(.rp-js-enabled) .rp-visual .rp-trend__point {
  animation: rp-breathe 2s ease-in-out infinite !important;
}

html:not(.rp-js-enabled) .rp-visual .rp-bars__fill::after {
  animation: rp-shimmer 3s ease-in-out infinite !important;
}

html:not(.rp-js-enabled) .rp-visual .rp-metric__value {
  animation: rp-pulse 3s ease-in-out infinite !important;
}

html:not(.rp-js-enabled) .rp-visual .rp-timeline__progress {
  animation: rp-flowLine 1.5s linear infinite !important;
}

html:not(.rp-js-enabled) .rp-visual .rp-timeline__step .rp-timeline__number {
  animation: rp-sequencePulse 4s ease-in-out infinite !important;
}

html:not(.rp-js-enabled) .rp-visual .rp-split__vs {
  animation: rp-pulse 2.5s ease-in-out infinite !important;
}

html:not(.rp-js-enabled) .rp-visual[data-winner="left"] .rp-split__side--left .rp-split__badge,
html:not(.rp-js-enabled) .rp-visual[data-winner="right"] .rp-split__side--right .rp-split__badge {
  animation: rp-glow 2s ease-in-out infinite !important;
}

html:not(.rp-js-enabled) .rp-visual .rp-focus__icon {
  animation: rp-float 3s ease-in-out infinite !important;
}

html:not(.rp-js-enabled) .rp-visual .rp-alert__icon {
  animation: rp-float 3s ease-in-out infinite !important;
}

html:not(.rp-js-enabled) .rp-visual .rp-checklist__count {
  animation: rp-pulse 2.5s ease-in-out infinite !important;
}

html:not(.rp-js-enabled) .rp-visual .rp-checklist__item .rp-checklist__check {
  animation: rp-checkPulse 2.5s ease-in-out infinite !important;
}

/* ============================================
   FORCE ANIMATIONS - Highest priority override
   Uses data-animate attribute which is always present in HTML
   Specificity: 0-4-0 (doubled .rp-visual) to override isolation resets
   ============================================ */

.rp-visual.rp-visual[data-animate="true"] .rp-trend__arrow {
  animation: rp-bounce 2s ease-in-out infinite !important;
}

.rp-visual.rp-visual[data-animate="true"] .rp-trend__point {
  animation: rp-breathe 2s ease-in-out infinite !important;
}

.rp-visual.rp-visual[data-animate="true"] .rp-bars__fill::after {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.4) 50%, transparent 100%) !important;
  background-size: 200% 100% !important;
  animation: rp-shimmer 2s ease-in-out infinite !important;
}

.rp-visual.rp-visual[data-animate="true"] .rp-metric__value {
  animation: rp-pulse 2s ease-in-out infinite !important;
}

.rp-visual.rp-visual[data-animate="true"] .rp-timeline__progress {
  animation: rp-flowLine 1.5s linear infinite !important;
}

.rp-visual.rp-visual[data-animate="true"] .rp-timeline__number {
  animation: rp-sequencePulse 3s ease-in-out infinite !important;
}

.rp-visual.rp-visual[data-animate="true"] .rp-split__vs {
  animation: rp-pulse 2s ease-in-out infinite !important;
}

.rp-visual.rp-visual[data-animate="true"][data-winner] .rp-split__badge {
  animation: rp-glow 2s ease-in-out infinite !important;
}

.rp-visual.rp-visual[data-animate="true"] .rp-focus__icon {
  animation: rp-float 2s ease-in-out infinite !important;
}

.rp-visual.rp-visual[data-animate="true"] .rp-alert__icon {
  animation: rp-shake 0.8s ease-in-out infinite !important;
}

.rp-visual.rp-visual[data-animate="true"] .rp-checklist__count {
  animation: rp-pulse 2s ease-in-out infinite !important;
}

.rp-visual.rp-visual[data-animate="true"] .rp-checklist__check {
  animation: rp-checkPulse 2.5s ease-in-out infinite !important;
}

/* ============================================
   V3 ANIMATIONS - Scroll-Triggered Animations
   ============================================ */

/* Elements waiting for count-up animation */
.rp-visual .rp-count-up:not([data-animated]) {
  /* Start at 0, JS will handle the actual counting */
}

/* Bars waiting for animation */
.rp-visual .rp-bar-animate:not([data-animated]) {
  width: 0 !important;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.rp-visual .rp-bar-animate[data-animated] {
  /* Final state set by JS via inline style */
}

/* SVG paths waiting for draw animation */
.rp-visual .rp-svg-draw:not([data-animated]) {
  stroke-dashoffset: var(--path-length, 1000);
  stroke-dasharray: var(--path-length, 1000);
}

.rp-visual .rp-svg-draw[data-animated] {
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Items waiting for sequential reveal */
.rp-visual .rp-reveal-sequential:not([data-animated]) {
  opacity: 0;
  transform: translateY(20px);
}

.rp-visual .rp-reveal-sequential[data-animated] {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.4s ease-out, transform 0.4s ease-out !important;
}

/* Panels waiting for slide-in */
.rp-visual .rp-slide-in[data-side="left"]:not([data-animated]) {
  opacity: 0;
  transform: translateX(-30px);
}

.rp-visual .rp-slide-in[data-side="right"]:not([data-animated]) {
  opacity: 0;
  transform: translateX(30px);
}

.rp-visual .rp-slide-in[data-animated] {
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.5s ease-out, transform 0.5s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Fade-in animation */
.rp-visual .rp-fade-in:not([data-animated]) {
  opacity: 0;
  transform: scale(0.98);
}

.rp-visual .rp-fade-in[data-animated] {
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out !important;
}

/* ============================================
   TOOLTIPS - Modern, Clean Design
   ============================================ */

/* Tooltip container */
.rp-visual [data-tooltip] {
  position: relative;
  cursor: help;
}

/* Tooltip bubble */
.rp-visual .rp-tooltip {
  position: absolute;
  background: #1e293b;
  color: white;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.4;
  max-width: 250px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  pointer-events: none;
}

/* Tooltip arrow */
.rp-visual .rp-tooltip::after {
  content: '';
  position: absolute;
  border: 6px solid transparent;
}

/* Tooltip above */
.rp-visual .rp-tooltip--top {
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(5px);
}

.rp-visual .rp-tooltip--top::after {
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-top-color: #1e293b;
}

/* Tooltip below */
.rp-visual .rp-tooltip--bottom {
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(-5px);
}

.rp-visual .rp-tooltip--bottom::after {
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-bottom-color: #1e293b;
}

/* Tooltip visible state */
.rp-visual [data-tooltip]:hover .rp-tooltip,
.rp-visual [data-tooltip]:focus .rp-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Interactive elements highlight on hover */
.rp-visual .rp-interactive {
  transition: background-color 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.rp-visual .rp-interactive:hover {
  background-color: rgba(37, 99, 235, 0.05);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* V3 GPU Acceleration for smooth mobile animations */
.rp-visual .rp-slide-in,
.rp-visual .rp-fade-in,
.rp-visual .rp-reveal-sequential,
.rp-visual .rp-bar-animate,
.rp-visual .rp-svg-draw {
  will-change: transform, opacity !important;
  backface-visibility: hidden !important;
  -webkit-backface-visibility: hidden !important;
}

/* ============================================
   V3 REDUCED MOTION SUPPORT
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  .rp-count-up,
  .rp-bar-animate,
  .rp-svg-draw,
  .rp-reveal-sequential,
  .rp-slide-in,
  .rp-fade-in {
    transition: none !important;
    animation: none !important;
  }

  .rp-reveal-sequential:not([data-animated]),
  .rp-slide-in:not([data-animated]),
  .rp-fade-in:not([data-animated]) {
    opacity: 1;
    transform: none;
  }
}
