/* Виртуальная лаборатория по биологии - Коленный рефлекс */

/* Анимации для рефлекторной дуги */
@keyframes pulse-signal {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
  100% {
    opacity: 0;
    transform: scale(1.5);
  }
}

@keyframes nerve-signal {
  0% {
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes knee-jerk {
  0% {
    transform: rotate(0deg);
  }
  30% {
    transform: rotate(-15deg);
  }
  60% {
    transform: rotate(-20deg);
  }
  100% {
    transform: rotate(0deg);
  }
}

.reflex-arc {
  position: relative;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}

.neuron-signal {
  position: absolute;
  width: 8px;
  height: 8px;
  background: #fbbf24;
  border-radius: 50%;
  box-shadow: 0 0 10px #fbbf24;
  opacity: 0;
}

.signal-active {
  animation: nerve-signal 2s ease-in-out;
}

.receptor {
  fill: #ef4444;
  stroke: #dc2626;
  stroke-width: 2;
}

.sensory-neuron {
  fill: #3b82f6;
  stroke: #2563eb;
  stroke-width: 2;
}

.interneuron {
  fill: #10b981;
  stroke: #059669;
  stroke-width: 2;
}

.motor-neuron {
  fill: #f59e0b;
  stroke: #d97706;
  stroke-width: 2;
}

.muscle {
  fill: #8b5cf6;
  stroke: #7c3aed;
  stroke-width: 2;
}

.spinal-cord {
  fill: #e5e7eb;
  stroke: #6b7280;
  stroke-width: 2;
}

/* Стили для эксперимента */
.knee-diagram {
  position: relative;
  transition: transform 0.5s ease-in-out;
}

.knee-jerk-animation {
  animation: knee-jerk 1.5s ease-in-out;
}

.hammer {
  cursor: pointer;
  transition: transform 0.2s ease-in-out;
}

.hammer:hover {
  transform: scale(1.1);
}

.reflex-test-area {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 2px dashed #0284c7;
  border-radius: 12px;
  padding: 2rem;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Стили для протокола */
.protocol-form {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  padding: 2rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #374151;
}

.form-input {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #d1d5db;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s ease-in-out;
}

.form-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

/* Стили для кнопок */
.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary {
  background: #3b82f6;
  color: white;
}

.btn-primary:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

.btn-success {
  background: #10b981;
  color: white;
}

.btn-success:hover {
  background: #059669;
  transform: translateY(-1px);
}

.btn-warning {
  background: #f59e0b;
  color: white;
}

.btn-warning:hover {
  background: #d97706;
  transform: translateY(-1px);
}

/* Адаптивный дизайн */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }
  
  .reflex-arc {
    max-width: 100%;
  }
  
  .protocol-form {
    padding: 1rem;
  }
}

/* Стили для результатов эксперимента */
.experiment-results {
  background: #f0fdf4;
  border: 2px solid #22c55e;
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 1rem;
}

.result-item {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
  gap: 0.5rem;
}

.result-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: white;
}

.result-success {
  background: #22c55e;
}

.result-warning {
  background: #f59e0b;
}

/* Стили для теоретического материала */
.theory-section {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.theory-title {
  color: #1e40af;
  border-bottom: 2px solid #3b82f6;
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.definition-box {
  background: #eff6ff;
  border-left: 4px solid #3b82f6;
  padding: 1rem;
  margin: 1rem 0;
  border-radius: 0 8px 8px 0;
}

.highlight {
  background: #fef3c7;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-weight: 600;
}

/* Стили для интерактивных элементов */
.interactive-element {
  cursor: pointer;
  transition: all 0.3s ease;
}

.interactive-element:hover {
  transform: scale(1.05);
  filter: brightness(1.1);
}

.pulse-animation {
  animation: pulse-signal 1.5s infinite;
}

/* Стили для модальных окон */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #6b7280;
}

.modal-close:hover {
  color: #374151;
}

/* Стили для прогресс-бара */
.progress-bar {
  width: 100%;
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
  margin: 1rem 0;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #10b981);
  transition: width 0.3s ease;
}

/* Анимация загрузки */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}