/* ==============================================
   PLG IMPACT SECTION - PREMIUM REDESIGN
   Matching managed-service-premium theme
   ============================================== */

/* ==============================================
   VARIABLES & THEME TOKENS
   ============================================== */

.plg-impact-section {
  --plg-accent: #059669;
  --plg-accent-light: #34d399;
  --plg-accent-dark: #047857;
  --plg-accent-glow: rgba(5, 150, 105, 0.15);
  --plg-gradient: linear-gradient(135deg, #059669 0%, #10b981 50%, #34d399 100%);
  --plg-gradient-soft: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  --plg-surface: #f0fdf4;
  --plg-card-bg: #ffffff;
  --plg-card-border: rgba(5, 150, 105, 0.15);
  --plg-text-primary: #064e3b;
  --plg-text-secondary: rgba(6, 78, 59, 0.7);
  --plg-serif: 'Playfair Display', Georgia, serif;
  --plg-sans: 'DM Sans', -apple-system, sans-serif;
}

/* ==============================================
   SECTION CONTAINER
   ============================================== */

.plg-impact-section {
  position: relative;
  padding: 7rem 1.5rem;
  max-width: 1280px;
  margin: 0 auto;
  overflow: hidden;
}

/* Premium gradient blob backgrounds */
.plg-impact-section::before {
  content: '';
  position: absolute;
  top: -150px;
  right: -100px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(52, 211, 153, 0.2) 0%, rgba(16, 185, 129, 0.08) 50%, transparent 70%);
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  animation: blobFloat 15s ease-in-out infinite;
}

.plg-impact-section::after {
  content: '';
  position: absolute;
  bottom: -100px;
  left: -80px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(5, 150, 105, 0.15) 0%, transparent 60%);
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
  animation: blobFloat 12s ease-in-out infinite reverse;
}

@keyframes blobFloat {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(30px, -20px) scale(1.05);
  }
  66% {
    transform: translate(-20px, 20px) scale(0.95);
  }
}

/* Background Noise Texture */
.plg-impact-noise {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.03'/%3E%3C/svg%3E");
  opacity: 0.5;
  mix-blend-mode: overlay;
  z-index: 0;
}

/* ==============================================
   SECTION HEADER - PREMIUM STYLING
   ============================================== */

.plg-impact-header {
  position: relative;
  z-index: 10;
  max-width: 900px;
  margin: 0 auto 5rem;
  text-align: center;
  animation: headerFadeIn 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes headerFadeIn {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.plg-impact-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  border: 2px solid transparent;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(250, 250, 252, 0.85)) padding-box,
    linear-gradient(180deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.03)) border-box;
  background-clip: padding-box, border-box;
  color: var(--color-muted);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 2rem;
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    inset 0 -1px 0 rgba(0, 0, 0, 0.02);
  animation: badgePop 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

@keyframes badgePop {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.plg-impact-title {
  font-family: var(--plg-serif);
  font-size: clamp(2.75rem, 6vw, 4.5rem);
  font-weight: 500;
  color: var(--plg-text-primary);
  line-height: 1.1;
  margin-bottom: 1.75rem;
  letter-spacing: -0.02em;
  animation: titleReveal 1s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

@keyframes titleReveal {
  from {
    opacity: 0;
    transform: translateY(40px);
    filter: blur(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

.plg-impact-title-italic {
  font-style: italic;
  font-weight: 400;
  background: var(--plg-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.plg-impact-subtitle {
  font-family: var(--plg-sans);
  font-size: 1.25rem;
  color: var(--plg-text-secondary);
  font-weight: 400;
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.75;
  animation: subtitleFade 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.5s both;
}

@keyframes subtitleFade {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==============================================
   DATA GRID
   ============================================== */

.plg-impact-grid {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .plg-impact-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 1.75rem;
  }
}

/* ==============================================
   PREMIUM CARDS
   ============================================== */

.plg-impact-card {
  position: relative;
  padding: 1.75rem;
  border-radius: 1.5rem;
  background: var(--plg-card-bg);
  border: 1px solid var(--plg-card-border);
  box-shadow: 0 8px 32px rgba(5, 150, 105, 0.08);
  backdrop-filter: blur(12px);
  overflow: hidden;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Gradient top border on hover */
.plg-impact-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--plg-gradient);
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Glow effect on hover */
.plg-impact-card::after {
  content: '';
  position: absolute;
  inset: -4px;
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.3) 0%, rgba(5, 150, 105, 0.15) 100%);
  border-radius: 1.75rem;
  filter: blur(20px);
  opacity: 0;
  z-index: -1;
  transition: opacity 0.4s ease;
}

.plg-impact-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (hover: hover) {
  .plg-impact-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 25px 50px rgba(5, 150, 105, 0.18);
    border-color: rgba(5, 150, 105, 0.3);
  }
}

@media (hover: hover) {
  .plg-impact-card:hover::before {
    opacity: 1;
  }
}

@media (hover: hover) {
  .plg-impact-card:hover::after {
    opacity: 0.5;
  }
}

/* Hero Cards (Large) */
.plg-impact-card--hero {
  grid-column: span 1;
}

@media (min-width: 768px) {
  .plg-impact-card--hero {
    grid-column: span 2;
  }
}

/* Card Header */
.plg-impact-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}

.plg-impact-card-icon {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  background: var(--plg-gradient-soft);
  color: var(--plg-accent);
  transition: all 0.3s ease;
}

@media (hover: hover) {
  .plg-impact-card:hover .plg-impact-card-icon {
    background: var(--plg-gradient);
    color: white;
    transform: scale(1.05);
  }
}

.plg-impact-card-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(5, 150, 105, 0.6);
  padding: 0.375rem 0.875rem;
  background: rgba(5, 150, 105, 0.08);
  border-radius: 999px;
}

/* Card Value */
.plg-impact-card-value {
  font-family: var(--plg-serif);
  font-size: clamp(3.25rem, 7vw, 4.5rem);
  font-weight: 500;
  color: var(--plg-text-primary);
  line-height: 1;
  letter-spacing: -0.02em;
  transition: all 0.3s ease;
}

@media (hover: hover) {
  .plg-impact-card:hover .plg-impact-card-value {
    background: var(--plg-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }
}

.plg-impact-card-metric {
  font-family: var(--plg-sans);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--plg-text-primary);
  margin-top: 0.5rem;
}

/* Card Description */
.plg-impact-card-desc {
  margin-top: 1rem;
  font-size: 0.875rem;
  color: var(--plg-text-secondary);
  line-height: 1.6;
}

/* ==============================================
   SECONDARY CARDS (Horizontal Layout)
   ============================================== */

.plg-impact-card--secondary {
  grid-column: span 1;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  background: linear-gradient(135deg, rgba(236, 253, 245, 0.6) 0%, rgba(255, 255, 255, 0.95) 100%);
  border-color: rgba(5, 150, 105, 0.2);
  padding: 2rem 2.25rem;
}

@media (min-width: 768px) {
  .plg-impact-card--secondary {
    grid-column: span 3;
    flex-direction: row;
    align-items: center;
  }
}

@media (hover: hover) {
  .plg-impact-card--secondary:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(236, 253, 245, 0.9) 100%);
  }
}

.plg-impact-card-main {
  flex: 1;
  text-align: center;
}

@media (min-width: 768px) {
  .plg-impact-card-main {
    text-align: left;
  }
}

.plg-impact-card-secondary-label {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(5, 150, 105, 0.6);
  padding: 0.375rem 0.875rem;
  background: rgba(5, 150, 105, 0.08);
  border-radius: 999px;
  margin-bottom: 0.75rem;
}

.plg-impact-card-secondary-value {
  font-family: var(--plg-serif);
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 500;
  color: var(--plg-text-primary);
  line-height: 1;
  letter-spacing: -0.02em;
}

.plg-impact-card-secondary-metric {
  font-family: var(--plg-sans);
  font-size: 1rem;
  font-weight: 600;
  color: var(--plg-text-primary);
  margin-top: 0.375rem;
}

.plg-impact-card-divider {
  display: none;
  width: 1px;
  height: 80px;
  background: linear-gradient(180deg, transparent, rgba(5, 150, 105, 0.25), transparent);
  margin: 0 2rem;
}

@media (min-width: 768px) {
  .plg-impact-card-divider {
    display: block;
  }
}

.plg-impact-card-aside {
  flex: 1;
  text-align: center;
}

@media (min-width: 768px) {
  .plg-impact-card-aside {
    text-align: left;
  }
}

.plg-impact-card-aside-text {
  font-size: 0.9375rem;
  color: var(--plg-text-secondary);
  line-height: 1.7;
}

/* ==============================================
   COUNTER ANIMATION
   ============================================== */

.plg-counter {
  display: inline-block;
}

/* ==============================================
   ICON SVGs
   ============================================== */

.plg-icon {
  width: 1.375rem;
  height: 1.375rem;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

/* ==============================================
   STAGGERED ANIMATION DELAYS
   ============================================== */

.plg-impact-card:nth-child(1) { transition-delay: 0s; }
.plg-impact-card:nth-child(2) { transition-delay: 0.1s; }
.plg-impact-card:nth-child(3) { transition-delay: 0.2s; }
.plg-impact-card:nth-child(4) { transition-delay: 0.3s; }
.plg-impact-card:nth-child(5) { transition-delay: 0.4s; }

/* ==============================================
   RESPONSIVE ADJUSTMENTS
   ============================================== */

@media (max-width: 767px) {
  .plg-impact-section {
    padding: 5rem 1rem;
  }

  .plg-impact-header {
    margin-bottom: 3.5rem;
  }

  .plg-impact-card {
    padding: 1.75rem;
  }

  .plg-impact-card-header {
    margin-bottom: 1.5rem;
  }

  .plg-impact-card--secondary {
    padding: 1.75rem;
  }
}

/* ==============================================
   DARK MODE SUPPORT
   ============================================== */

[data-theme="dark"] .plg-impact-section {
  --plg-surface: #0a0f0d;
  --plg-card-bg: rgba(255, 255, 255, 0.04);
  --plg-card-border: rgba(255, 255, 255, 0.1);
  --plg-text-primary: #ffffff;
  --plg-text-secondary: rgba(255, 255, 255, 0.7);
  --plg-accent: #34d399;
  --plg-accent-dark: #a7f3d0;
  background: var(--plg-surface) !important;
}

[data-theme="dark"] .plg-impact-section::before {
  background: radial-gradient(circle, rgba(52, 211, 153, 0.12) 0%, rgba(16, 185, 129, 0.04) 50%, transparent 70%);
}

[data-theme="dark"] .plg-impact-section::after {
  background: radial-gradient(circle, rgba(5, 150, 105, 0.08) 0%, transparent 60%);
}

[data-theme="dark"] .plg-impact-badge {
  border: 2px solid transparent;
  background:
    linear-gradient(180deg, rgba(15, 20, 35, 0.9), rgba(10, 14, 25, 0.95)) padding-box,
    linear-gradient(180deg, rgba(140, 182, 255, 0.3), rgba(140, 182, 255, 0.1)) border-box;
  background-clip: padding-box, border-box;
  color: rgba(196, 215, 255, 0.9);
  box-shadow:
    0 2px 8px rgba(0, 15, 40, 0.3),
    inset 0 1px 0 rgba(140, 182, 255, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .plg-impact-title {
  color: var(--plg-text-primary);
}

[data-theme="dark"] .plg-impact-title-italic {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

[data-theme="dark"] .plg-impact-card {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}

@media (hover: hover) {
  [data-theme="dark"] .plg-impact-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(52, 211, 153, 0.3);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
  }
}

[data-theme="dark"] .plg-impact-card-icon {
  background: rgba(52, 211, 153, 0.15);
  color: var(--plg-accent);
}

@media (hover: hover) {
  [data-theme="dark"] .plg-impact-card:hover .plg-impact-card-icon {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    color: #0a0f0d;
  }
}

[data-theme="dark"] .plg-impact-card-label {
  background: rgba(52, 211, 153, 0.15);
  color: var(--plg-accent);
}

[data-theme="dark"] .plg-impact-card-value {
  color: var(--plg-text-primary);
}

@media (hover: hover) {
  [data-theme="dark"] .plg-impact-card:hover .plg-impact-card-value {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }
}

[data-theme="dark"] .plg-impact-card-metric {
  color: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .plg-impact-card-desc {
  color: var(--plg-text-secondary);
}

[data-theme="dark"] .plg-impact-card--secondary {
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
  border-color: rgba(52, 211, 153, 0.15);
}

@media (hover: hover) {
  [data-theme="dark"] .plg-impact-card--secondary:hover {
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.1) 0%, rgba(255, 255, 255, 0.04) 100%);
  }
}

[data-theme="dark"] .plg-impact-card-secondary-label {
  background: rgba(52, 211, 153, 0.15);
  color: var(--plg-accent);
}

[data-theme="dark"] .plg-impact-card-divider {
  background: linear-gradient(180deg, transparent, rgba(52, 211, 153, 0.25), transparent);
}

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

@media (prefers-reduced-motion: reduce) {
  .plg-impact-section::before,
  .plg-impact-section::after {
    animation: none;
  }

  .plg-impact-card {
    opacity: 1;
    transform: none;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
  }

  .plg-impact-header,
  .plg-impact-badge,
  .plg-impact-title,
  .plg-impact-subtitle {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .plg-counter {
    animation: none;
  }
}
