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

* {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
}

/* Стили для навигации */
.nav-btn {
    @apply px-6 py-3 bg-gray-100 text-gray-700 rounded-lg whitespace-nowrap transition-all duration-300 hover:bg-gray-200 border-2 border-transparent;
}

.nav-btn.active {
    @apply bg-blue-600 text-white border-blue-600 shadow-lg;
}

.nav-btn:hover {
    @apply transform scale-105;
}

/* Скрытие/показ разделов */
.content-section {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.content-section.active {
    display: block;
}

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

/* Карточки типов нейронов */
.neuron-type-card {
    transition: all 0.3s ease;
}

.neuron-type-card:hover {
    transform: translateY(-5px);
}

.neuron-type-card.selected {
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

/* Карточки глиальных клеток */
.glia-card {
    transition: all 0.3s ease;
}

.glia-card:hover {
    transform: translateY(-3px);
}

.glia-card.selected {
    transform: scale(1.05);
}

.glia-card.selected > div {
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

/* Карточки медиаторов */
.mediator-card {
    transition: all 0.3s ease;
}

.mediator-card:hover {
    transform: translateY(-5px);
}

.mediator-card.selected {
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

/* Стили для интерактивных диаграмм */
.interactive-diagram {
    position: relative;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    min-height: 400px;
    overflow: hidden;
}

.diagram-element {
    position: absolute;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.diagram-element:hover {
    transform: scale(1.1);
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.diagram-element.highlighted {
    animation: pulse 2s infinite;
    z-index: 15;
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
    50% { transform: scale(1.15); box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4); }
    100% { transform: scale(1); box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
}

/* Элементы нейрона */
.neuron-cell-body {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
    top: 45%;
    left: 15%;
    width: 120px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.neuron-nucleus {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: white;
    top: 50%;
    left: 17%;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 12px;
    z-index: 5;
}

.neuron-dendrites {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    top: 20%;
    left: 5%;
    width: 100px;
    height: 60px;
}

.neuron-axon {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    top: 47%;
    left: 35%;
    width: 200px;
    height: 40px;
    border-radius: 20px;
}

.neuron-terminal {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    top: 45%;
    right: 5%;
    width: 80px;
    height: 60px;
    border-radius: 50%;
}

/* SVG стили для симуляций */
.axon-svg {
    width: 100%;
    height: 150px;
}

.myelin-segment {
    fill: #fbbf24;
    stroke: #f59e0b;
    stroke-width: 2;
}

.node-ranvier {
    fill: #dc2626;
    stroke: #b91c1c;
    stroke-width: 1;
}

.axon-core {
    stroke: #3b82f6;
    stroke-width: 4;
    fill: none;
}

.impulse {
    r: 8;
    fill: #ef4444;
    stroke: #dc2626;
    stroke-width: 2;
    opacity: 0.8;
}

.impulse.fast {
    animation: moveImpulseFast 2s linear infinite;
}

.impulse.slow {
    animation: moveImpulseSlow 6s linear infinite;
}

@keyframes moveImpulseFast {
    0% { cx: 50; opacity: 1; }
    90% { opacity: 1; }
    100% { cx: 350; opacity: 0; }
}

@keyframes moveImpulseSlow {
    0% { cx: 50; opacity: 1; }
    90% { opacity: 1; }
    100% { cx: 350; opacity: 0; }
}

/* Стили синапса */
.synapse-svg {
    width: 100%;
    height: 300px;
}

.presynaptic-terminal {
    fill: #3b82f6;
    stroke: #2563eb;
    stroke-width: 2;
}

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

.synaptic-cleft {
    fill: #f1f5f9;
    stroke: #cbd5e1;
    stroke-width: 1;
}

.vesicle {
    fill: #fbbf24;
    stroke: #f59e0b;
    stroke-width: 1;
}

.neurotransmitter {
    fill: #ef4444;
    r: 3;
    opacity: 0;
}

.neurotransmitter.released {
    animation: releaseNeurotransmitter 3s ease-in-out;
}

@keyframes releaseNeurotransmitter {
    0% { opacity: 0; cy: 100; }
    20% { opacity: 1; }
    80% { opacity: 1; cy: 200; }
    100% { opacity: 0; cy: 220; }
}

/* Стили для протокола */
.protocol-section {
    border-left: 4px solid #e5e7eb;
    padding-left: 20px;
    margin-bottom: 24px;
}

.protocol-section.filled {
    border-left-color: #10b981;
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.05) 0%, transparent 100%);
}

/* Анимации загрузки */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Прогресс бар для экспериментов */
.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin: 16px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
    border-radius: 4px;
    transition: width 0.5s ease;
    width: 0%;
}

/* Tooltips */
.tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    max-width: 200px;
    text-align: center;
}

.tooltip.show {
    opacity: 1;
}

/* Печать */
@media print {
    .nav-btn, footer, .no-print {
        display: none !important;
    }
    
    .content-section {
        display: block !important;
    }
    
    body {
        background: white !important;
    }
    
    .bg-gradient-to-br {
        background: white !important;
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    .container {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    .grid.md\\:grid-cols-2 {
        grid-template-columns: 1fr;
    }
    
    .grid.md\\:grid-cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid.lg\\:grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .neuron-cell-body,
    .neuron-axon {
        position: relative;
        margin: 10px auto;
        transform: none !important;
    }
    
    .interactive-diagram {
        min-height: 300px;
    }
}

@media (max-width: 480px) {
    .grid.md\\:grid-cols-3 {
        grid-template-columns: 1fr;
    }
    
    .grid.lg\\:grid-cols-4 {
        grid-template-columns: 1fr;
    }
    
    .nav-btn {
        padding: 12px 16px;
        font-size: 14px;
    }
}