/* Виртуальная лаборатория - Дополнительные стили */

/* Анимации и переходы */
.tab-content {
    animation: fadeIn 0.3s ease-in-out;
}

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

/* Активная вкладка */
.tab-btn.active {
    border-bottom-color: #2d5016 !important;
    color: #2d5016 !important;
    background-color: #f0fdf4;
}

/* Интерактивные элементы микроскопа */
.stem-part {
    cursor: pointer;
    transition: all 0.2s ease;
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.3));
}

.stem-part:hover {
    transform: scale(1.02);
    filter: brightness(1.1) drop-shadow(3px 3px 6px rgba(0,0,0,0.4));
}

/* Точки-метки на микроскопе */
.label-point {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border: 2px solid white;
    border-radius: 50%;
    cursor: help;
    transform: translate(-50%, -50%);
    transition: all 0.2s ease;
}

.label-point:hover {
    transform: translate(-50%, -50%) scale(1.5);
    background: #dc2626;
}

.label-point::after {
    content: attr(data-label);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    margin-bottom: 5px;
}

.label-point:hover::after {
    opacity: 1;
}

/* Drag and Drop для заданий */
.draggable-item {
    transition: all 0.2s ease;
    user-select: none;
}

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

.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

.drop-zone {
    transition: all 0.2s ease;
    position: relative;
}

.drop-zone.drag-over {
    border-color: #2d5016;
    background-color: #f0fdf4;
    transform: scale(1.02);
}

.drop-zone.correct {
    border-color: #16a34a;
    background-color: #dcfce7;
}

.drop-zone.incorrect {
    border-color: #dc2626;
    background-color: #fef2f2;
}

/* Фокусировка микроскопа */
.microscope-blur {
    filter: blur(3px);
    transition: filter 0.3s ease;
}

.microscope-focused {
    filter: blur(0px);
    transition: filter 0.3s ease;
}

/* Увеличение микроскопа */
.magnification-4x svg {
    transform: scale(1);
}

.magnification-10x svg {
    transform: scale(1.5);
}

.magnification-40x svg {
    transform: scale(2.5);
}

/* Прогресс бары */
.progress-complete {
    background-color: #16a34a !important;
}

.progress-complete i {
    content: '✓';
}

/* Кнопки действий */
.action-btn {
    transition: all 0.2s ease;
}

.action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Информационные панели */
.info-panel {
    border-left: 4px solid #2d5016;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    transition: all 0.2s ease;
}

.info-panel:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(45, 80, 22, 0.1);
}

/* Микроскоп - виды образцов */
.specimen-sunflower circle:nth-child(1) { fill: #8B5A2B; } /* Кора */
.specimen-sunflower circle:nth-child(2) { fill: #90EE90; } /* Камбий */
.specimen-sunflower circle:nth-child(3) { fill: #DEB887; } /* Древесина */
.specimen-sunflower circle:nth-child(4) { fill: #F0E68C; } /* Сердцевина */

.specimen-corn circle:nth-child(1) { fill: #A0522D; }
.specimen-corn circle:nth-child(2) { fill: #9ACD32; }
.specimen-corn circle:nth-child(3) { fill: #D2B48C; }
.specimen-corn circle:nth-child(4) { fill: #FFFFE0; }

.specimen-oak circle:nth-child(1) { fill: #654321; }
.specimen-oak circle:nth-child(2) { fill: #32CD32; }
.specimen-oak circle:nth-child(3) { fill: #CD853F; }
.specimen-oak circle:nth-child(4) { fill: #DAA520; }

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

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

@keyframes loading-shimmer {
    to {
        left: 100%;
    }
}

/* Протокол - стили печати */
@media print {
    body * {
        visibility: hidden;
    }
    
    #protocol-content, #protocol-content * {
        visibility: visible;
    }
    
    #protocol-content {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }
    
    .no-print {
        display: none !important;
    }
    
    .page-break {
        page-break-before: always;
    }
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .stem-part {
        stroke-width: 4;
    }
    
    .label-point {
        width: 12px;
        height: 12px;
    }
    
    .tab-btn {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .microscope-view {
        height: 250px !important;
    }
}

/* Специальные эффекты для биологических элементов */
.cell-animation {
    animation: cellPulse 2s infinite alternate;
}

@keyframes cellPulse {
    from { opacity: 0.7; }
    to { opacity: 1; }
}

.vascular-bundle {
    animation: transport 3s infinite linear;
}

@keyframes transport {
    0% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: 20; }
}

/* Подсказки и всплывающие окна */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: rgba(0, 0, 0, 0.9);
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    font-size: 12px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: rgba(0, 0, 0, 0.9) transparent transparent transparent;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Выделение активных элементов */
.highlight {
    animation: highlight 1s ease-in-out;
}

@keyframes highlight {
    0%, 100% { background-color: transparent; }
    50% { background-color: rgba(34, 197, 94, 0.2); }
}