/**
 * Học Tập Xanh visitor counter v1.0.4
 * DESIGN BY: HÀ THÚC NGUYÊN DŨNG
 */

.htx-counter {
  --htx-counter-blue: #1675e7;
  --htx-counter-blue-dark: #0c5ed2;
  --htx-counter-navy: #0b2d63;
  --htx-counter-muted: #6e86a3;
  --htx-counter-border: #d6e6f7;
  box-sizing: border-box;
  container-type: inline-size;
  width: 100%;
  overflow: hidden;
  padding: 18px;
  color: var(--htx-counter-navy);
  background: #ffffff;
  border: 1px solid var(--htx-counter-border);
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(20, 72, 124, 0.08);
  font-family: inherit;
}

.htx-counter *,
.htx-counter *::before,
.htx-counter *::after {
  box-sizing: border-box;
}

.htx-counter__header {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 15px;
}

.htx-counter__brand-icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(145deg, #2589f5, #0759d1);
  border-radius: 14px;
  box-shadow: 0 7px 16px rgba(16, 106, 219, 0.22);
}

.htx-counter__brand-icon svg {
  width: 35px;
  height: 35px;
  fill: none;
  stroke: currentColor;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.htx-counter__heading {
  min-width: 0;
}

.htx-counter__heading h3 {
  margin: 0;
  color: var(--htx-counter-navy);
  font-size: 18px;
  font-size: clamp(17px, 5cqi, 22px);
  font-weight: 750;
  line-height: 1.2;
}

.htx-counter__heading p {
  overflow: hidden;
  margin: 4px 0 0;
  color: var(--htx-counter-muted);
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.htx-counter__online {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 7px 10px;
  color: #087e59;
  background: #e7f9f1;
  border: 1px solid #bcebd9;
  border-radius: 999px;
  white-space: nowrap;
}

.htx-counter__online > span {
  width: 9px;
  height: 9px;
  background: #11b77d;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(17, 183, 125, 0.15);
}

.htx-counter__online strong,
.htx-counter__online small {
  font-size: 12px;
  line-height: 1;
}

.htx-counter__online small {
  font-weight: 650;
}

.htx-counter__total {
  position: relative;
  display: flex;
  min-height: 98px;
  overflow: hidden;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  color: #ffffff;
  background: linear-gradient(135deg, #2486f1, #0c5ed2);
  border-radius: 17px;
  isolation: isolate;
}

.htx-counter__total::before,
.htx-counter__total::after {
  position: absolute;
  z-index: -1;
  width: 150px;
  height: 150px;
  content: '';
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}

.htx-counter__total::before {
  top: -93px;
  right: -30px;
}

.htx-counter__total::after {
  right: 38px;
  bottom: -118px;
}

.htx-counter__total > div {
  position: relative;
  z-index: 2;
  min-width: 0;
}

.htx-counter__total span {
  display: block;
  color: #dcecff;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.htx-counter__total strong {
  display: block;
  margin: 5px 0 3px;
  color: #ffffff;
  font-size: 38px;
  font-size: clamp(34px, 12cqi, 52px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.htx-counter__total small {
  display: block;
  color: #deedff;
  font-size: 11px;
  line-height: 1.35;
}

.htx-counter__total small.is-up {
  color: #d8ffec;
}

.htx-counter__total small.is-down {
  color: #ffe1e6;
}

.htx-counter__chart {
  position: relative;
  z-index: 1;
  width: min(43%, 220px);
  min-width: 105px;
  height: auto;
  margin-left: 8px;
  overflow: visible;
}

.htx-counter__chart .area {
  fill: rgba(255, 255, 255, 0.15);
}

.htx-counter__chart .line {
  fill: none;
  stroke: #b7ddff;
  stroke-width: 5;
  stroke-linecap: round;
}

.htx-counter__chart circle {
  fill: #ffffff;
}

.htx-counter__stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  overflow: hidden;
  margin-top: 11px;
  background: #f8fbff;
  border: 1px solid #d8e7f6;
  border-radius: 12px;
}

.htx-counter__stat {
  display: grid;
  min-width: 0;
  min-height: 48px;
  padding: 7px 11px;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  border: 0;
  border-radius: 0;
}

.htx-counter__stat + .htx-counter__stat {
  border-top: 1px solid #d8e7f6;
}

.htx-counter__stat.is-blue {
  background: #f5faff;
}

.htx-counter__stat.is-purple {
  background: #fbf9ff;
}

.htx-counter__stat.is-green {
  background: #f4fcf8;
}

.htx-counter__stat-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
}

.htx-counter__stat.is-blue .htx-counter__stat-icon {
  color: #1573dc;
  background: #d9ecff;
}

.htx-counter__stat.is-purple .htx-counter__stat-icon {
  color: #7451df;
  background: #e8e1ff;
}

.htx-counter__stat.is-green .htx-counter__stat-icon {
  color: #0ba873;
  background: #d5f5e9;
}

.htx-counter__stat-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.htx-counter__stat small {
  overflow: hidden;
  align-self: center;
  color: var(--htx-counter-muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.htx-counter__stat strong {
  justify-self: end;
  color: var(--htx-counter-navy);
  font-size: 18px;
  font-size: clamp(17px, 5cqi, 22px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.025em;
}

.htx-counter__privacy {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 9px 0 0;
  padding: 8px 10px;
  color: #476887;
  background: #f6f9fc;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
}

.htx-counter__privacy svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: #0da874;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.htx-counter__credit {
  margin: 11px 4px 0;
  color: #3d6995;
  font-size: 10px;
  font-weight: 750;
  line-height: 1.35;
  text-align: center;
  letter-spacing: 0.025em;
}

@container (max-width: 390px) {
  .htx-counter {
    padding: 14px;
  }

  .htx-counter__header {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .htx-counter__brand-icon {
    width: 48px;
    height: 48px;
  }

  .htx-counter__online {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .htx-counter__total {
    min-height: 98px;
    padding: 13px 16px;
  }

  .htx-counter__chart {
    width: 40%;
    min-width: 90px;
  }

  .htx-counter__stat {
    min-height: 46px;
    padding: 7px 9px;
    grid-template-columns: 28px minmax(0, 1fr) auto;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .htx-counter__online > span {
    animation: htx-counter-pulse 2.4s ease-out infinite;
  }
}

@keyframes htx-counter-pulse {
  0%, 45% { box-shadow: 0 0 0 4px rgba(17, 183, 125, 0.15); }
  75%, 100% { box-shadow: 0 0 0 8px rgba(17, 183, 125, 0); }
}
