/* =====================
   Count Visual Components
   Tally marks and composition bars
   ===================== */

/* Count Display Container */
.count-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm);
  min-width: 60px;
  text-align: center;
}

.count-display.empty {
  opacity: 0.5;
  color: var(--text-muted);
}

/* Count Number */
.count-number {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1;
}

/* Tally Marks System */
.tally-marks {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
  justify-content: center;
  min-height: 14px;
}

.tally-group {
  font-family: monospace;
  font-size: 12px;
  line-height: 1;
  color: var(--accent-glow);
  position: relative;
}

.tally-five {
  position: relative;
}

.tally-five::after {
  content: '';
  position: absolute;
  top: 50%;
  left: -1px;
  right: -1px;
  height: 1px;
  background: var(--accent-glow);
  transform: rotate(-15deg);
}

.tally-overflow {
  font-size: var(--font-size-xs);
  color: var(--warning);
  margin-left: var(--space-xs);
}

/* Composition Bar System */
.count-composition {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm);
  min-width: 80px;
  text-align: center;
}

.count-bar {
  width: 100%;
  height: 8px;
  background: var(--dark-bg-secondary);
  border-radius: var(--border-radius-sm);
  overflow: hidden;
  position: relative;
}

.count-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-cyan), var(--accent-glow));
  border-radius: var(--border-radius-sm);
  transition: width var(--transition-normal);
  position: relative;
}

.count-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: shimmer 2s infinite;
}

.count-percentage {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  font-weight: 500;
}

/* Light Theme Adjustments */
body.light-theme .count-number {
  color: var(--text);
}

body.light-theme .tally-group {
  color: var(--primary-blue);
}

body.light-theme .tally-five::after {
  background: var(--primary-blue);
}

body.light-theme .count-bar {
  background: var(--light-bg-secondary);
}

body.light-theme .count-bar-fill {
  background: linear-gradient(90deg, var(--primary-blue), var(--accent-light));
}

body.light-theme .count-percentage {
  color: var(--text-secondary);
}

/* Animations */
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Responsive Design */
@media (max-width: 768px) {
  .count-display,
  .count-composition {
    min-width: 50px;
    padding: var(--space-xs);
  }
  
  .count-number {
    font-size: var(--font-size-xs);
  }
  
  .tally-marks {
    min-height: 12px;
  }
  
  .tally-group {
    font-size: 10px;
  }
}
