/* ==========================================================================
   Term Cards with Progress
   Prefix: all-tex__
   Relies on existing .section .container base styles
   ========================================================================== */

.section .container.all-tex__container {
  padding-bottom: 0;
}
/* Section title */
.all-tex__section-title {
  margin: 0 0 1.5rem;
  padding-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  border-bottom: 1px solid color-mix(in oklch, var(--primary) 20%, transparent);
}

/* Grid */
.all-tex__grid {
  display: flex;
  gap: 1rem;
  flex-direction: column;
}

@media (min-width: 640px) {
  .all-tex__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .all-tex__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1280px) {
  .all-tex__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Card */
.all-tex__card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: calc(var(--radius) + 0.25rem);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--card-foreground);
  padding: 1rem;
  text-decoration: none;
  transition:
    box-shadow 180ms ease,
    border-color 180ms ease,
    transform 180ms ease;
}
@media (min-width: 768px) {
  .all-tex__card {
    padding: 1.25rem;
  }
}

.all-tex__card:hover {
  border-color: color-mix(in oklch, var(--primary) 50%, transparent);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.all-tex__card:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 3px;
}

/* Top row */
.all-tex__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.all-tex__top-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

/* .all-tex__code {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.004em;
  text-transform: uppercase;
  color: var(--foreground);
} */
/* Name */
.all-tex__name {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--foreground);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: color 150ms ease;
}

.all-tex__card:hover .all-tex__name {
  color: var(--primary);
}

/* Arrow */
.all-tex__arrow {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--muted-foreground);
  opacity: 0;
  transform: translateX(0);
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    color 180ms ease;
}

.all-tex__card:hover .all-tex__arrow {
  opacity: 1;
  transform: translateX(0.25rem);
  color: var(--primary);
}

/* Bottom */
.all-tex__bottom {
  margin-top: 0.625rem;
  padding-top: 0.625rem;
  border-top: 1px solid var(--border);
}
@media (min-width: 768px) {
  .all-tex__bottom {
    padding-top: 1rem;
    margin-top: 1rem;
  }
}

/* Stats */
.all-tex__stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.all-tex__count {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--foreground);
}

.all-tex__label {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

/* Progress */
.all-tex__progress {
  margin-top: 0.75rem;
  height: 0.375rem;
  width: 100%;
  border-radius: 999px;
  background: var(--muted);
  overflow: hidden;
}

.all-tex__progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--primary);
  transition: width 200ms ease;
}

/* ==========================================================================
   Popular Categories Section (Tailwind -> plain CSS)
   Prefix: popular-tex__
   Relies on existing .section .container base styles
   ========================================================================== */

/* wrapper: mt-16 pt-8 border-t */
.popular-tex__wrap {
  margin-top: 4rem; /* mt-16 */
  padding-top: 2rem; /* pt-8 */
  border-top: 1px solid var(--border);
}

/* Section title */
.popular-tex__title {
  margin: 0 0 1.5rem; /* mb-6 */
  font-size: 1.25rem; /* text-xl */
  font-weight: 600;
  color: var(--foreground);
}

/* Grid layout */
.popular-tex__grid {
  display: flex;
  gap: 1rem;
  flex-direction: column;
}

@media (min-width: 640px) {
  .popular-tex__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .popular-tex__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Category card */
.popular-tex__card {
  position: relative;
  overflow: hidden;
  border-radius: calc(var(--radius) + 0.25rem);
  border: 1px solid var(--border);
  padding: 1rem;
  text-decoration: none;

  background: linear-gradient(
    135deg,
    color-mix(in oklch, var(--primary) 10%, transparent),
    color-mix(in oklch, var(--primary) 5%, transparent)
  );

  transition:
    box-shadow 200ms ease,
    border-color 200ms ease,
    transform 200ms ease;
}
@media (min-width: 768px) {
  .popular-tex__card {
    padding: 1.25rem;
  }
}

.popular-tex__card:hover {
  border-color: color-mix(in oklch, var(--primary) 50%, transparent);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.popular-tex__card:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 3px;
}

/* Inner content */
.popular-tex__card-inner {
  position: relative;
  z-index: 1;
}

/* Category name */
.popular-tex__name {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--foreground);
  transition: color 150ms ease;
}

.popular-tex__card:hover .popular-tex__name {
  color: var(--primary);
}

/* Count */
.popular-tex__count {
  margin: 0.5rem 0 0;
  font-size: 1.875rem; /* text-3xl */
  line-height: 1.1;
  font-weight: 700;
  color: var(--primary);
}

/* Caption */
.popular-tex__caption {
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

/* Arrow icon */
.popular-tex__arrow {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  width: 1.25rem;
  height: 1.25rem;
  color: var(--primary);

  opacity: 0;
  transform: translateX(0);
  transition:
    opacity 200ms ease,
    transform 200ms ease;
}

.popular-tex__card:hover .popular-tex__arrow {
  opacity: 1;
  transform: translateX(0.25rem);
}
