/* Particle Collision Specific Styles */

.main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

@media (max-width: 768px) {
  .main-grid {
    grid-template-columns: 1fr;
  }
}

.particle-types {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.particle-type {
  background: rgba(255,255,255,0.8);
  border: 2px solid #dee2e6;
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.particle-type:hover {
  border-color: #667eea;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.particle-type.active {
  border-color: #28a745;
  background: rgba(40, 167, 69, 0.1);
}

.particle-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 4px;
  font-size: 12px;
  font-weight: 600;
  color: white;
}

.particle-icon.electron {
  background: linear-gradient(135deg, #007bff, #0056b3);
}

.particle-icon.proton {
  background: linear-gradient(135deg, #dc3545, #c82333);
}

.particle-icon.neutron {
  background: linear-gradient(135deg, #6c757d, #545b62);
}

.particle-icon.photon {
  background: linear-gradient(135deg, #ffc107, #e0a800);
}

.particle-name {
  font-size: 11px;
  color: #2c3e50;
  font-weight: 500;
}

.range-slider {
  width: 100%;
  margin: 8px 0;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: #e9ecef;
  border-radius: 3px;
  outline: none;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.range-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.range-value {
  font-family: monospace;
  font-weight: 600;
  color: #2c3e50;
  font-size: 12px;
  float: right;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.stat-card {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 2px solid #dee2e6;
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #667eea, #764ba2);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
  border-color: #667eea;
}

.stat-card:hover::before {
  transform: scaleX(1);
}

.stat-value {
  font-size: 16px;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 4px;
  font-family: monospace;
}

.stat-label {
  font-size: 10px;
  color: #6c757d;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.energy-chart {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 8px;
  margin-top: 12px;
}

#energyCanvas {
  width: 100%;
  height: 80px;
  display: block;
}

.simulation-container {
  position: relative;
  background: #000;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 12px;
}

#particleCanvas {
  display: block;
  width: 100%;
  height: 400px;
  background: radial-gradient(circle at center, #001122 0%, #000000 100%);
}

.simulation-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 10;
}

.fps-counter {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.7);
  color: #00ff00;
  padding: 4px 8px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 11px;
}

.simulation-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.control-group input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
  accent-color: #667eea;
}

.control-group label {
  font-size: 11px;
  color: #495057;
  cursor: pointer;
  user-select: none;
}

.collision-log {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 12px;
  min-height: 150px;
  max-height: 200px;
  overflow-y: auto;
  font-family: monospace;
  font-size: 11px;
  line-height: 1.4;
}

.log-entry {
  padding: 4px 0;
  border-bottom: 1px dotted #dee2e6;
  color: #495057;
}

.log-entry:last-child {
  border-bottom: none;
}

.log-entry.collision {
  color: #dc3545;
  font-weight: 600;
}

.log-entry.creation {
  color: #28a745;
}

.log-entry.info {
  color: #17a2b8;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #6c757d;
  font-style: italic;
}

.empty-state svg {
  width: 48px;
  height: 48px;
  opacity: 0.3;
  margin-bottom: 12px;
}

.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

@media (max-width: 768px) {
  .particle-types {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .simulation-controls {
    grid-template-columns: 1fr;
  }
  
  .toolbar {
    justify-content: center;
  }
  
  #particleCanvas {
    height: 300px;
  }
}

/* 动画效果 */
.stat-card.updated {
  animation: highlight 0.5s ease-in-out;
}

@keyframes highlight {
  0% { background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%); }
  50% { background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%); }
  100% { background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%); }
}

.log-entry.new {
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.particle-type.selected {
  animation: pulse 0.5s ease-in-out;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* 滚动条样式 */
.collision-log::-webkit-scrollbar {
  width: 6px;
}

.collision-log::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.collision-log::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.collision-log::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}