/* Environmental Impact Counter CSS - Optimized */
:root {
  /* Vibrant Main Colors */
  --primary-green: #22c55e;
  --primary-blue: #0ea5e9;
  --primary-purple: #8b5cf6;
  --primary-amber: #f59e0b;
  
  /* Background Colors */
  --dark-bg: #0f172a;
  --card-green-bg: #052e16;
  --card-blue-bg: #0c4a6e;
  --card-purple-bg: #4c1d95;
  --card-amber-bg: #78350f;
  
  /* Text Colors */
  --text-white: #ffffff;
  --text-light: #e2e8f0;
  --text-muted: #94a3b8;
  
  /* Effects - Consolidated */
  --glow-effect: 0 0 15px;
  --glow-green: var(--glow-effect) rgba(34, 197, 94, 0.5);
  --glow-blue: var(--glow-effect) rgba(14, 165, 233, 0.5);
  --glow-purple: var(--glow-effect) rgba(139, 92, 246, 0.5);
  --glow-amber: var(--glow-effect) rgba(245, 158, 11, 0.5);
}

/* Main container */
.eco-counter-container {
  max-width: 1000px;
  margin: 0 auto;
  font-family: 'Inter', 'SF Pro Display', system-ui, sans-serif;
  background-color: var(--dark-bg);
  color: var(--text-white);
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  position: relative;
}

/* Animated gradient background with grid overlay */
.eco-counter-container::before,
.eco-counter-container::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
}

.eco-counter-container::before {
  background: 
    radial-gradient(circle at 10% 10%, rgba(34, 197, 94, 0.05), transparent 30%),
    radial-gradient(circle at 90% 90%, rgba(14, 165, 233, 0.05), transparent 30%),
    radial-gradient(circle at 90% 10%, rgba(139, 92, 246, 0.03), transparent 30%),
    radial-gradient(circle at 10% 90%, rgba(245, 158, 11, 0.03), transparent 30%);
}

.eco-counter-container::after {
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 20px 20px;
}

.eco-counter-content {
  position: relative;
  z-index: 1;
}

/* Header Section */
.eco-counter-header {
  text-align: center;
  margin-bottom: 25px;
}

.eco-counter-logo {
  width: 60px;
  height: 60px;
  margin: 0 auto 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--primary-green);
  position: relative;
}

.eco-counter-logo::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: var(--primary-green);
  opacity: 0.15;
  z-index: -1;
  animation: pulse 2s infinite;
}

.eco-counter-logo img {
  width: 34px;
  height: auto;
  filter: brightness(0) invert(1);
}

.eco-counter-title {
  margin: 30px auto 35px;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.eco-counter-date,
.eco-counter-statement {
  font-size: 20px;
  font-weight: 400;
  color: var(--text-white);
  letter-spacing: 0.3px;
}

.eco-counter-statement strong {
  color: var(--primary-green);
  font-weight: 500;
}

/* Main Counter */
.eco-counter-main {
  text-align: center;
  margin: 25px 0 30px;
  padding: 25px 20px;
  position: relative;
}

.eco-counter-value {
  font-size: 96px;
  font-weight: 700;
  line-height: 1;
  margin: 0;
  padding: 10px 0;
  display: flex;
  justify-content: center;
  letter-spacing: -0.02em;
  background: linear-gradient(to bottom, white, rgba(220, 255, 240, 0.9));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 20px rgba(34, 197, 94, 0.25);
}

.eco-counter-value .digit {
  position: relative;
  display: inline-block;
}

.eco-counter-digits {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  height: 114px;
}

.eco-counter-label {
  margin-top: 22px;
  font-size: 16px;
  color: var(--primary-green);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 3px;
  opacity: 0.9;
  padding-bottom: 20px;
}

/* Progress Bar Styling */
.eco-counter-progress-container {
  margin: 30px auto 40px;
  max-width: 620px;
  text-align: center;
  position: relative;
}

.eco-counter-progress-bar {
  height: 14px;
  background-color: rgba(255, 255, 255, 0.15);
  border-radius: 7px;
  overflow: hidden;
  position: relative;
  margin-bottom: 10px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.eco-counter-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary-green), var(--primary-blue), var(--primary-purple));
  border-radius: 6px;
  position: relative;
  transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 15px rgba(34, 197, 94, 0.6);
}

/* Milestone markers */
.eco-counter-milestone-markers {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 14px;
  pointer-events: none;
  z-index: 2;
}

.eco-counter-milestone {
  position: absolute;
  top: 0;
  height: 100%;
  width: 3px;
  background-color: rgba(255, 255, 255, 0.5);
  border-radius: 1px;
}

.eco-counter-milestone-1 { left: 20%; }
.eco-counter-milestone-2 { left: 40%; }
.eco-counter-milestone-3 { left: 60%; }
.eco-counter-milestone-4 { left: 80%; }

/* Progress label styling */
.eco-counter-progress-labels {
  font-size: 14px;
  color: var(--text-light);
  text-align: center;
  margin-top: 8px;
}

.eco-counter-progress-current,
.eco-counter-progress-text,
.eco-counter-progress-goal,
.eco-counter-progress-sheets {
  font-weight: 500;
  opacity: 0.9;
  font-size: 14px;
}

.eco-counter-progress-current {
  color: var(--primary-green);
  animation: pulse-text 2s infinite ease-in-out;
}

.eco-counter-progress-text {
  margin: 0 3px;
}

.eco-counter-progress-separator {
  margin: 0 3px;
  opacity: 0.9;
}

.eco-counter-progress-sheets {
  margin-left: 5px;
}

.eco-counter-description {
  font-size: 16px;
  line-height: 1.6;
  text-align: center;
  color: var(--text-muted);
  max-width: 700px;
  margin: 0 auto 40px;
}

/* Stats Grid */
.eco-counter-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

/* Base card styling */
.eco-counter-stat-card {
  padding: 30px;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

.eco-counter-stat-card:hover {
  transform: translateY(-5px);
}

.eco-counter-stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%);
  z-index: 0;
}

.eco-counter-stat-card > * {
  position: relative;
  z-index: 1;
}

.eco-counter-stat-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 15px;
  position: relative;
}

.eco-counter-stat-icon::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  opacity: 0.2;
  z-index: -1;
  animation: pulse-icon 2s infinite;
}

.eco-counter-stat-title {
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  margin: 0 0 10px;
  color: #e2e8f0 !important; /* Light gray-blue for better visibility */
  line-height: 1.3;
  opacity: 1 !important;
}

.eco-counter-stat-value {
  font-size: 44px;
  font-weight: 700;
  text-align: center;
  margin: 10px 0;
  line-height: 1;
  letter-spacing: -0.02em;
}

.eco-counter-stat-label {
  font-size: 14px;
  font-weight: 400;
  text-align: center;
  color: var(--text-muted);
  display: block;
  font-style: italic;
}

/* Card theme variations - simplified with variables */
.eco-counter-trees {
  background-color: var(--card-green-bg);
}
.eco-counter-trees:hover {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), var(--glow-green);
}
.eco-counter-trees .eco-counter-stat-icon {
  color: var(--primary-green);
}
.eco-counter-trees .eco-counter-stat-icon::after {
  background-color: var(--primary-green);
}
.eco-counter-trees .eco-counter-stat-value {
  color: var(--primary-green);
}

.eco-counter-water {
  background-color: var(--card-blue-bg);
}
.eco-counter-water:hover {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), var(--glow-blue);
}
.eco-counter-water .eco-counter-stat-icon {
  color: var(--primary-blue);
}
.eco-counter-water .eco-counter-stat-icon::after {
  background-color: var(--primary-blue);
}
.eco-counter-water .eco-counter-stat-value {
  color: var(--primary-blue);
}

.eco-counter-co2 {
  background-color: var(--card-purple-bg);
}
.eco-counter-co2:hover {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), var(--glow-purple);
}
.eco-counter-co2 .eco-counter-stat-icon {
  color: var(--primary-purple);
}
.eco-counter-co2 .eco-counter-stat-icon::after {
  background-color: var(--primary-purple);
}
.eco-counter-co2 .eco-counter-stat-value {
  color: var(--primary-purple);
}

.eco-counter-energy {
  background-color: var(--card-amber-bg);
}
.eco-counter-energy:hover {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), var(--glow-amber);
}
.eco-counter-energy .eco-counter-stat-icon {
  color: var(--primary-amber);
}
.eco-counter-energy .eco-counter-stat-icon::after {
  background-color: var(--primary-amber);
}
.eco-counter-energy .eco-counter-stat-value {
  color: var(--primary-amber);
}

/* Footer styling */
.eco-counter-footer {
  margin-top: 30px;
  text-align: center;
  width: 100%;
}

.eco-counter-footer p {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted) !important;
  opacity: 0.7;
  text-align: center !important;
  width: 100%;
  display: inline-block;
}

/* Particles and animation effects - simplified */
.eco-counter-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
}

.eco-particle {
  position: absolute;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.2);
  pointer-events: none;
}

/* Consolidated animations */
@keyframes pulse {
  0%, 100% {
    transform: scale(0.95);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
}

@keyframes pulse-icon {
  0%, 100% {
    transform: scale(1);
    opacity: 0.1;
  }
  50% {
    transform: scale(1.3);
    opacity: 0.2;
  }
}

@keyframes pulse-text {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

@keyframes milestone-pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

@keyframes celebration {
  0%, 100% { 
    background-position: 0% 50%;
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.7);
  }
  50% { 
    background-position: 100% 50%;
    box-shadow: 0 0 25px rgba(14, 165, 233, 0.7);
  }
}

.milestone-reached {
  animation: milestone-pulse 1.5s ease-out;
}

.goal-reached .eco-counter-progress-fill {
  background: linear-gradient(90deg, var(--primary-green), var(--primary-blue), var(--primary-purple), var(--primary-green));
  background-size: 300% 100%;
  animation: celebration 4s ease infinite;
}

@keyframes count-up {
  0% {
    transform: translateY(100%);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

.animate-in {
  animation: count-up 0.5s ease-out forwards;
}

@keyframes percentage-update {
  0% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.percentage-updated {
  animation: percentage-update 0.5s ease-out;
}

/* Responsive Styles - simplified */
@media (max-width: 768px) {
  .eco-counter-container {
    padding: 25px;
    border-radius: 12px;
  }
  
  .eco-counter-stats {
    grid-template-columns: 1fr;
  }
  
  .eco-counter-value {
    font-size: 68px;
  }
  
  .eco-counter-date,
  .eco-counter-statement {
    font-size: 18px;
  }
  
  .eco-counter-digits {
    height: 82px;
  }
  
  .eco-counter-stat-value {
    font-size: 36px;
  }
  
  .eco-counter-progress-container {
    max-width: 90%;
  }
  
  .eco-counter-progress-bar {
    height: 10px;
  }
  
  .eco-counter-progress-labels {
    font-size: 13px;
  }
}