/* Дополнительные стили для виртуальной лаборатории */

:root {
  --primary-purple: #7c3aed;
  --light-purple: #a855f7;
  --dark-purple: #5b21b6;
  --bg-gradient: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 50%, #ede9fe 100%);
  
  /* Для совместимости со старыми стилями */
  --primary-blue: #7c3aed;
  --light-blue: #a855f7;
  --dark-blue: #5b21b6;
}

body {
  background: var(--bg-gradient);
  min-height: 100vh;
}

/* Анимации для растения */
.plant-base {
  transition: all 0.3s ease-in-out;
}

.leaf {
  transition: all 0.5s ease-in-out;
  animation: gentle-sway 4s ease-in-out infinite;
}

@keyframes gentle-sway {
  0%, 100% { transform: rotate(-2deg); }
  50% { transform: rotate(2deg); }
}

.leaf:nth-child(1) {
  animation-delay: 0s;
}

.leaf:nth-child(2) {
  animation-delay: 0.5s;
}

.leaf:nth-child(3) {
  animation-delay: 1s;
}

/* Эффекты освещения */
#light-rays {
  background: linear-gradient(180deg, 
    rgba(255, 255, 0, 0.3) 0%, 
    rgba(255, 255, 0, 0.1) 50%, 
    transparent 100%);
  transition: opacity 1s ease-in-out;
}

/* Анимации пузырьков */
@keyframes bubble-rise {
  0% {
    transform: translateY(0) scale(1);
    opacity: 0.7;
  }
  50% {
    transform: translateY(-30px) scale(1.2);
    opacity: 0.5;
  }
  100% {
    transform: translateY(-60px) scale(0.8);
    opacity: 0;
  }
}

@keyframes fall {
  from {
    transform: translateY(-10px);
    opacity: 1;
  }
  to {
    transform: translateY(50px);
    opacity: 0;
  }
}

/* Стили для экспериментальной панели */
.experiment-panel {
  animation: slideInUp 0.5s ease-out;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Интерактивные кнопки */
button {
  transition: all 0.2s ease-in-out;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

button:active {
  transform: translateY(0);
}

/* Прогресс бар */
#progress-bar {
  transition: width 0.3s ease-in-out;
  background: linear-gradient(90deg, var(--primary-green), var(--light-green));
}

/* Карточки результатов */
.bg-green-50 {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 1px solid #bbf7d0;
}

.bg-blue-50 {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 1px solid #93c5fd;
}

.bg-yellow-50 {
  background: linear-gradient(135deg, #fefce8 0%, #fef3c7 100%);
  border: 1px solid #fde047;
}

/* Стили для протокола */
.protocol-document {
  background: white;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.protocol-document:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

/* Анимация появления результатов */
#experiment-results {
  animation: fadeInScale 0.5s ease-out;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Стили для индикатора температуры */
#temperature-indicator {
  background: linear-gradient(to top, 
    #3b82f6 0%, 
    #10b981 30%, 
    #f59e0b 60%, 
    #ef4444 90%);
  border: 2px solid white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Молекулы CO2 */
.co2-molecule {
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(5px, -5px) rotate(120deg); }
  66% { transform: translate(-3px, 3px) rotate(240deg); }
}

/* Капли воды */
.water-drop {
  animation: drop 2s ease-in infinite;
}

@keyframes drop {
  0% { transform: translateY(-10px); opacity: 0; }
  50% { opacity: 1; }
  100% { transform: translateY(60px); opacity: 0; }
}

/* Responsive стили */
@media (max-width: 768px) {
  .grid-cols-2 {
    grid-template-columns: 1fr;
  }
  
  .lg\\:grid-cols-3 {
    grid-template-columns: 1fr;
  }
  
  .text-3xl {
    font-size: 1.5rem;
  }
  
  .p-6 {
    padding: 1rem;
  }
}

/* Печатные стили */
@media print {
  .no-print {
    display: none !important;
  }
  
  .protocol-document {
    box-shadow: none;
    border: 1px solid #ccc;
  }
  
  body {
    background: white;
  }
  
  .bg-gradient-to-br {
    background: white !important;
  }
}

/* Доступность */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Фокус для клавиатурной навигации */
button:focus,
input:focus,
select:focus {
  outline: 2px solid var(--primary-blue);
  outline-offset: 2px;
}

/* Стили для микроскопа */
.microscope-view {
  animation: fadeInUp 0.6s ease-out;
}

.microscope-field {
  background: radial-gradient(circle at center, #ffffff 0%, #f8fafc 70%, #e2e8f0 100%);
  box-shadow: inset 0 0 20px rgba(0,0,0,0.1);
}

/* SVG анимации */
.zone-visualization svg {
  animation: microscopeZoom 0.8s ease-out;
}

.tissue-visualization svg {
  animation: microscopeZoom 0.8s ease-out;
}

@keyframes microscopeZoom {
  from {
    transform: scale(0.8);
    opacity: 0.5;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Стили для наблюдений */
.study-info {
  animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
  from {
    transform: translateX(20px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Цветовые схемы для зон */
.zone-division {
  border-left: 4px solid #ef4444;
}

.zone-elongation {
  border-left: 4px solid #f97316;
}

.zone-absorption {
  border-left: 4px solid #eab308;
}

.zone-conduction {
  border-left: 4px solid #22c55e;
}

/* Цветовые схемы для тканей */
.tissue-xylem {
  border-left: 4px solid #3b82f6;
}

.tissue-phloem {
  border-left: 4px solid #8b5cf6;
}

.tissue-cambium {
  border-left: 4px solid #6b7280;
}

/* Улучшенные стили для таблиц результатов */
table {
  border-collapse: collapse;
  width: 100%;
}

th, td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid #e5e7eb;
}

th {
  background-color: #f9fafb;
  font-weight: 600;
  color: #374151;
}

tbody tr:hover {
  background-color: #f3f4f6;
}

/* Стили для графиков */
canvas {
  border-radius: 8px;
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Индикаторы состояния */
.status-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
}

.status-active {
  background: #22c55e;
  animation: pulse 2s infinite;
}

.status-inactive {
  background: #94a3b8;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Эффекты наведения для карточек */
.card-hover {
  transition: all 0.3s ease;
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* Градиентные кнопки */
.btn-gradient {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--light-blue) 100%);
  border: none;
  color: white;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-gradient:hover {
  background: linear-gradient(135deg, var(--dark-blue) 0%, var(--primary-blue) 100%);
  transform: translateY(-1px);
}

/* Стили для дыхательной лаборатории */
.experiment-panel {
  animation: slideInUp 0.6s ease-out;
}

/* Анимации для газообмена */
@keyframes gasFlow {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
}

.oxygen-molecule {
  animation: gasFlow 2s ease-in-out infinite;
}

.co2-molecule {
  animation: gasFlow 2.5s ease-in-out infinite;
}

/* Стили для аппаратуры */
.apparatus-container {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border: 2px solid #cbd5e0;
}

.glass-jar {
  filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.1));
}

/* Анимации процесса дыхания */
.respiration-process .oxygen-molecule {
  animation: moveToCenter 3s ease-in-out infinite;
}

.respiration-process .co2-molecule {
  animation: moveFromCenter 3s ease-in-out infinite 1.5s;
}

@keyframes moveToCenter {
  0% { opacity: 0; transform: translateX(-20px) scale(0.5); }
  50% { opacity: 1; transform: translateX(0) scale(1); }
  100% { opacity: 0; transform: translateX(20px) scale(0.5); }
}

@keyframes moveFromCenter {
  0% { opacity: 0; transform: translateX(-20px) scale(0.5); }
  50% { opacity: 1; transform: translateX(0) scale(1); }
  100% { opacity: 0; transform: translateX(20px) scale(0.5); }
}

/* Индикаторы газов */
.gas-indicator {
  transition: all 0.3s ease;
}

.gas-level-high {
  background-color: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}

.gas-level-normal {
  background-color: #f0f9ff;
  border-color: #bae6fd;
  color: #0369a1;
}

/* Специальные стили для корневой лаборатории */
.root-zone-button {
  position: relative;
  overflow: hidden;
}

.root-zone-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.5s;
}

.root-zone-button:hover::before {
  left: 100%;
}

/* Стили для лаборатории выделения */
.excretion-lab {
  background: var(--bg-gradient);
  min-height: 100vh;
}

/* Анимации для процессов выделения */
@keyframes oxygen-release {
  0% { opacity: 0; transform: scale(0.5) translateY(0); }
  50% { opacity: 1; transform: scale(1) translateY(-10px); }
  100% { opacity: 0; transform: scale(0.8) translateY(-30px); }
}

@keyframes co2-emission {
  0% { opacity: 0; transform: scale(0.5) translateX(0); }
  50% { opacity: 1; transform: scale(1) translateX(10px); }
  100% { opacity: 0; transform: scale(0.8) translateX(30px); }
}

@keyframes water-transpiration {
  0% { opacity: 0; transform: translateY(0) scale(1); }
  50% { opacity: 0.7; transform: translateY(-20px) scale(1.1); }
  100% { opacity: 0; transform: translateY(-50px) scale(0.9); }
}

@keyframes waste-accumulation {
  0% { opacity: 0; transform: scale(0) rotate(0deg); }
  50% { opacity: 0.8; transform: scale(1.2) rotate(180deg); }
  100% { opacity: 1; transform: scale(1) rotate(360deg); }
}

/* Молекулярные анимации */
.o2-molecule {
  animation: oxygen-release 2s ease-in-out infinite;
}

.co2-molecule {
  animation: co2-emission 3s ease-in-out infinite;
}

.h2o-molecule {
  animation: water-transpiration 2.5s ease-in-out infinite;
}

.waste-particle {
  animation: waste-accumulation 4s ease-in-out infinite;
}

/* Фиолетовые градиенты для панелей экспериментов */
.experiment-panel.excretion-panel {
  background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
  border: 2px solid var(--light-purple);
}

/* Индикаторы уровней выделения */
.excretion-indicator {
  transition: all 0.5s ease;
  border-radius: 50%;
}

.excretion-indicator.high {
  background: linear-gradient(45deg, #dc2626, #ef4444);
  box-shadow: 0 0 20px rgba(220, 38, 38, 0.3);
}

.excretion-indicator.medium {
  background: linear-gradient(45deg, #d97706, #f59e0b);
  box-shadow: 0 0 20px rgba(217, 119, 6, 0.3);
}

.excretion-indicator.low {
  background: linear-gradient(45deg, #059669, #10b981);
  box-shadow: 0 0 20px rgba(5, 150, 105, 0.3);
}

/* Стили для аппаратуры выделения */
.excretion-apparatus {
  filter: drop-shadow(3px 3px 6px rgba(124, 58, 237, 0.1));
  transition: all 0.3s ease;
}

.excretion-apparatus:hover {
  filter: drop-shadow(5px 5px 12px rgba(124, 58, 237, 0.2));
  transform: scale(1.02);
}

/* Эффекты света для фотосинтеза */
.light-beam {
  background: linear-gradient(180deg, 
    rgba(255, 255, 0, 0.4) 0%, 
    rgba(255, 255, 0, 0.2) 50%, 
    transparent 100%);
  animation: light-pulse 3s ease-in-out infinite;
}

@keyframes light-pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* Стили для графиков выделения */
.excretion-chart {
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid var(--light-purple);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.1);
}

/* Анимации процессов в реальном времени */
.real-time-process {
  position: relative;
  overflow: hidden;
}

.real-time-process::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(124, 58, 237, 0.1), transparent);
  animation: process-scan 4s linear infinite;
}

@keyframes process-scan {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Стили для мониторинга температуры и влажности */
.environment-monitor {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border-left: 4px solid var(--primary-purple);
}

/* Улучшенные стили кнопок для фиолетовой темы */
.btn-excretion {
  background: linear-gradient(135deg, var(--primary-purple) 0%, var(--light-purple) 100%);
  border: none;
  color: white;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.2);
}

.btn-excretion:hover {
  background: linear-gradient(135deg, var(--dark-purple) 0%, var(--primary-purple) 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.3);
}