/* Стили для визуализации частицы */

/* Контейнер для 3D частицы */
.particle-container {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--color-background-dark) 0%, var(--color-background) 100%);
}

/* Канвас для рендеринга */
.particle-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Сообщение о поддержке WebGL */
.webgl-message {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: var(--color-text);
  padding: 20px;
  max-width: 80%;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 8px;
}

/* Текст типа частицы */
.particle-type-indicator {
  position: absolute;
  top: 16px;
  left: 16px;
  background-color: rgba(0, 0, 0, 0.5);
  color: var(--color-text-light);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 10;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.particle-type-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Цвета для различных типов частиц */
.particle-type-icon.electron {
  background: radial-gradient(circle, #00B4D8 10%, #0077B6 100%);
}

.particle-type-icon.muon {
  background: radial-gradient(circle, #8A2BE2 10%, #4B0082 100%);
}

.particle-type-icon.neutrino {
  background: radial-gradient(circle, #88D498 10%, #1A936F 100%);
}

.particle-type-icon.up-quark {
  background: radial-gradient(circle, #FF5A5F 10%, #C41E3A 100%);
}

.particle-type-icon.down-quark {
  background: radial-gradient(circle, #43AA8B 10%, #277559 100%);
}

.particle-type-icon.strange-quark {
  background: radial-gradient(circle, #9381FF 10%, #5E3AEE 100%);
}

.particle-type-icon.photon {
  background: radial-gradient(circle, #FFBF00 10%, #E09F3E 100%);
}

/* Индикатор загрузки */
.particle-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.particle-loader-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-left-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.particle-loader-text {
  font-size: 14px;
  color: var(--color-text-light);
}

/* Элементы управления частицей */
.particle-controls {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 10;
}

.control-btn {
  background: rgba(30, 60, 90, 0.7);
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.control-btn:hover {
  background: rgba(40, 80, 120, 0.9);
  transform: scale(1.1);
}

.control-btn:active {
  transform: scale(0.95);
}

/* Стили для панели информации о частице */
.particle-info {
  padding: 20px;
  background: rgba(20, 30, 40, 0.8);
  border-radius: 8px;
  margin-top: 20px;
  color: white;
}

.particle-name {
  font-size: 24px;
  margin-bottom: 10px;
  font-weight: 600;
}

.particle-description {
  margin-bottom: 20px;
  line-height: 1.5;
}

.particle-params {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 15px;
}

.param-item {
  background: rgba(30, 60, 90, 0.5);
  padding: 10px;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
}

.param-name {
  font-size: 12px;
  text-transform: uppercase;
  margin-bottom: 5px;
  opacity: 0.8;
}

.param-value {
  font-size: 18px;
  font-weight: 600;
}

/* Анимация появления частицы */
.particle-appear {
  animation: particleAppear 1s ease-out forwards;
}

@keyframes particleAppear {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Эффект взаимодействия */
.particle-interaction {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 5;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.particle-interaction.active {
  opacity: 1;
}

/* Стили для информационной панели о характеристиках */
.particle-info-panel {
  position: absolute;
  bottom: 16px;
  left: 16px;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--color-text-light);
  padding: 12px;
  border-radius: 8px;
  font-size: 13px;
  max-width: 260px;
  z-index: 10;
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform: translateY(100%);
  opacity: 0;
}

.particle-info-panel.visible {
  transform: translateY(0);
  opacity: 1;
}

.particle-info-title {
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.particle-info-close {
  background: none;
  border: none;
  color: var(--color-text-light);
  cursor: pointer;
  padding: 0;
  font-size: 16px;
}

.particle-info-items {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.particle-info-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.particle-info-label {
  font-size: 11px;
  opacity: 0.7;
}

.particle-info-value {
  font-weight: 500;
}

#particle-container {
  width: 100%;
  height: 400px; /* было 500px — минус 20% по прямой правке владельца */
  position: relative;
  background-color: #000;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(66, 66, 66, 0.1);
}

canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Улучшенная адаптивность для частиц */
@media (max-width: 768px) {
  #particle-container {
    height: 320px; /* было 400px — минус 20% */
  }
  
  .particle-info {
    padding: 10px;
  }
  
  .param-container {
    margin-bottom: 8px;
  }
  
  .param-name {
    font-size: 10px;
  }
  
  .param-value {
    font-size: 14px;
  }
  
  .param-scale {
    height: 6px;
  }
  
  .info-section {
    padding: 10px;
  }
  
  .info-header {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  #particle-container {
    height: 256px; /* было 320px — минус 20% */
  }
  
  .particle-details {
    padding: 8px 12px;
  }
  
  .particle-info {
    padding: 8px;
  }
  
  .param-container {
    margin-bottom: 6px;
  }
  
  .param-scale {
    width: 100px;
    height: 5px;
  }
  
  .value-text {
    font-size: 12px;
    min-width: 30px;
  }
  
  .info-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    padding-bottom: 5px;
  }
  
  .info-tab {
    padding: 6px 10px;
    font-size: 12px;
  }
  
  /* Улучшаем касания на мобильных устройствах */
  .info-tab, .param-container, .btn-particle-info {
    padding: 8px 12px;
  }
} 