/**
 * @file
 * Styles for EGR Counter component.
 */

/* Counter grid layout */
.egr-counter {
  display: grid;
  gap: 2rem;
  margin: 2rem 0;
  text-align: center;
}

/* Column layouts */
.egr-counter--cols-auto {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.egr-counter--cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.egr-counter--cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.egr-counter--cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

.egr-counter--cols-5 {
  grid-template-columns: repeat(5, 1fr);
}

/* Responsive adjustments */
@media (max-width: 1400px) {
  .egr-counter--cols-5 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 992px) {
  .egr-counter--cols-5,
  .egr-counter--cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .egr-counter--cols-5,
  .egr-counter--cols-4,
  .egr-counter--cols-3,
  .egr-counter--cols-2 {
    grid-template-columns: 1fr;
  }
}

/* Counter item styling */
.egr-counter__item {
  padding: 2rem 1rem;
}

/* Icon styling */
.egr-counter__icon {
  font-size: 3rem;
  color: #00c24e;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: center;
}

.egr-counter__icon i {
  display: inline-block;
}

/* Number wrapper for alignment */
.egr-counter__number-wrapper {
  display: flex;
  align-items: baseline;
  justify-content: center;
  margin-bottom: 1rem;
}

/* Number styling */
.egr-counter__number {
  font-size: 3.5rem;
  font-weight: 700;
  color: #18453B;
  line-height: 1;
  display: inline-block;
  min-width: 1ch;
  transition: none; /* Disable CSS transitions during JS animation */
}

/* Animation state */
.egr-counter.counted .egr-counter__number {
  /* Animation complete state if needed */
}

/* Ensure numbers are visible during animation */
.egr-counter__number:empty::before {
  content: "0";
}

/* Prefix and suffix styling */
.egr-counter__prefix,
.egr-counter__suffix {
  font-size: 2.5rem;
  font-weight: 700;
  color: #18453B;
  line-height: 1;
}

.egr-counter__prefix {
  margin-right: 0.25rem;
}

.egr-counter__suffix {
  margin-left: 0.25rem;
}

/* Label styling */
.egr-counter__label {
  font-size: 1.125rem;
  color: #2c3e50;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: relative;
  padding-top: 1rem;
}

/* Green underline for label */
.egr-counter__label:before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 4px;
  background-color: #00c24e;
}

/* Background wrapper */
.egr-counter-bg-wrapper {
  width: 100%;
  padding: 0;
  margin: 0;
}

/* When background color is applied */
.egr-counter-bg-wrapper[style*="background-color"] {
  padding: 4rem 0;
}

/* Edge to edge layout */
.egr-counter-edge-to-edge {
  width: 100%;
  max-width: 100%;
  padding: 0 2rem;
  margin: 0;
}

/* Container-based layouts already have Bootstrap styling */
.container .egr-counter,
.container-fluid .egr-counter {
  margin: 3rem 0;
}

/* Enhanced styling when background is present */
.egr-counter-bg-wrapper[style*="background-color"] .egr-counter__number,
.egr-counter-bg-wrapper[style*="background-color"] .egr-counter__prefix,
.egr-counter-bg-wrapper[style*="background-color"] .egr-counter__suffix {
  color: #ffffff;
}

.egr-counter-bg-wrapper[style*="background-color"] .egr-counter__label {
  color: #ffffff;
  opacity: 0.9;
}

.egr-counter-bg-wrapper[style*="background-color"] .egr-counter__icon {
  color: #ffffff;
  opacity: 0.8;
}

/* Custom text color overrides */
.egr-counter__item[style*="color"] .egr-counter__number,
.egr-counter__item[style*="color"] .egr-counter__prefix,
.egr-counter__item[style*="color"] .egr-counter__suffix,
.egr-counter__item[style*="color"] .egr-counter__label,
.egr-counter__item[style*="color"] .egr-counter__icon {
  color: inherit !important;
  opacity: 1;
}