/* StatsPanel Styles */

.stats-panel {
  padding: 1rem; /* Reduced from 1.5rem */
  background: var(--secondary-bg);
  border-right: 1px solid var(--border-color);
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden; /* Prevent horizontal overflow */
  display: flex;
  flex-direction: column;
  gap: 1.2rem; /* Reduced from 2rem */
  box-sizing: border-box;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.panel-title {
  color: var(--primary-text);
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.live-text {
  color: var(--success-text);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem; /* Reduced from 1rem */
}

.stat-card {
  background: var(--primary-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.8rem; /* Reduced from 1rem */
  display: flex;
  align-items: center;
  gap: 0.8rem; /* Reduced from 1rem */
  transition: all 0.3s ease;
  cursor: pointer;
  box-sizing: border-box;
}

.stat-card:hover {
  border-color: var(--primary-text);
  box-shadow: 0 0 15px rgba(0, 255, 136, 0.1);
  transform: translateY(-2px);
}

.stat-icon {
  font-size: 1.3rem; /* Reduced from 1.5rem */
  min-width: 35px; /* Reduced from 40px */
  text-align: center;
}

.stat-content {
  flex: 1;
}

.stat-value {
  color: var(--primary-text);
  font-size: 1.5rem;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 0 10px var(--glow-color);
}

.stat-label {
  color: var(--secondary-text);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.2rem;
}

.stat-sublabel {
  color: var(--secondary-text);
  font-size: 0.7rem;
  opacity: 0.6;
  margin-top: 0.1rem;
}

.progress-section {
  background: var(--primary-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.progress-header h4 {
  color: var(--primary-text);
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.progress-value {
  font-size: 1.2rem;
  font-weight: 900;
  text-shadow: 0 0 10px currentColor;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--secondary-bg);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 1rem;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: var(--primary-text);
  transition: width 0.5s ease;
  box-shadow: 0 0 10px currentColor;
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: progress-shine 2s ease-in-out infinite;
}

.progress-milestones {
  position: relative;
  height: 20px;
}

.milestone {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
}

.milestone-marker {
  width: 3px;
  height: 12px;
  background: var(--border-color);
  position: absolute;
  top: 0;
}

.milestone-label {
  color: var(--secondary-text);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: absolute;
  top: 14px;
  transform: translateX(-50%);
  white-space: nowrap;
}

.efficiency-section {
  background: var(--primary-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
}

.efficiency-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.efficiency-header h4 {
  color: var(--primary-text);
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.efficiency-value {
  font-size: 1.2rem;
  font-weight: 900;
  text-shadow: 0 0 10px currentColor;
}

.efficiency-chart {
  height: 60px;
  display: flex;
  align-items: end;
  justify-content: center;
}

.efficiency-bars {
  display: flex;
  align-items: end;
  gap: 4px;
  height: 100%;
}

.efficiency-bar {
  width: 8px;
  border-radius: 4px 4px 0 0;
  animation: efficiency-pulse 2s ease-in-out infinite;
  transition: background-color 0.3s ease;
}

.real-time-section {
  background: var(--primary-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  flex: 1;
}

.real-time-section h4 {
  color: var(--primary-text);
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 1rem 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem;
  background: var(--secondary-bg);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  transition: all 0.3s ease;
  animation: activity-slide-in 0.5s ease-out;
}

.activity-item:hover {
  border-color: var(--primary-text);
  box-shadow: 0 0 10px rgba(0, 255, 136, 0.1);
}

.activity-icon {
  font-size: 1.2rem;
  min-width: 30px;
  text-align: center;
}

.activity-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.activity-type {
  color: var(--primary-text);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.activity-desc {
  color: var(--secondary-text);
  font-size: 0.8rem;
  opacity: 0.8;
}

.activity-time {
  color: var(--secondary-text);
  font-size: 0.7rem;
  opacity: 0.6;
  white-space: nowrap;
}

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

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

@keyframes activity-slide-in {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Responsive Design - Switch to single column earlier */
@media (max-width: 1400px) {
  .stats-grid {
    grid-template-columns: 1fr; /* Single column for narrow sidebars */
  }
  
  .stat-card {
    padding: 0.7rem;
  }
  
  .progress-section,
  .efficiency-section,
  .real-time-section {
    padding: 1rem;
  }
}

@media (max-width: 1024px) {
  .stats-panel {
    padding: 0.8rem;
    gap: 1rem;
  }
  
  .progress-section,
  .efficiency-section,
  .real-time-section {
    padding: 0.8rem;
  }
}

@media (max-width: 768px) {
  .stats-panel {
    padding: 1rem;
    gap: 1.5rem;
  }
  
  .panel-header {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }
  
  .stat-card {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
  
  .stat-icon {
    font-size: 2rem;
  }
  
  .activity-item {
    padding: 0.6rem;
    gap: 0.8rem;
  }
  
  .activity-text {
    gap: 0.1rem;
  }
}

@media (max-width: 480px) {
  .progress-header,
  .efficiency-header {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }
  
  .milestone-label {
    font-size: 0.6rem;
  }
  
  .activity-item {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
  
  .activity-text {
    align-items: center;
  }
}