/* Современный дизайн для лабораторной работы */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    overflow: hidden;
    min-height: 100vh;
}

header {
    background: linear-gradient(45deg, #2c3e50, #34495e);
    color: white;
    padding: 2rem;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

header h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #ecf0f1;
    font-weight: 300;
}

.objective {
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    border-left: 4px solid #3498db;
}

/* Навигация */
.navigation {
    display: flex;
    background: #34495e;
    overflow-x: auto;
}

.nav-btn {
    flex: 1;
    padding: 1rem 2rem;
    border: none;
    background: transparent;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-size: 1rem;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-btn.active {
    background: #3498db;
    border-bottom: 3px solid #2980b9;
}

/* Секции */
.section {
    display: none;
    padding: 2rem;
    min-height: 600px;
}

.section.active {
    display: block;
    animation: fadeIn 0.5s ease-in;
}

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

/* Теория */
.theory-content {
    max-width: 900px;
    margin: 0 auto;
}

.info-block {
    background: #f8f9fa;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-radius: 10px;
    border-left: 4px solid #3498db;
}

.info-block h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.formula-box {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1rem 0;
    border: 2px solid #e1e8ed;
}

.formula {
    font-size: 2rem;
    text-align: center;
    background: linear-gradient(45deg, #3498db, #2980b9);
    color: white;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    font-family: 'Courier New', monospace;
    font-weight: bold;
}

.units-table {
    background: white;
    padding: 1rem;
    border-radius: 8px;
}

.unit-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.unit-row:last-child {
    border-bottom: none;
}

.unit-row span {
    font-weight: bold;
    color: #2c3e50;
}

/* Практика */
.practice-steps {
    max-width: 1000px;
    margin: 0 auto;
}

.step {
    background: #f8f9fa;
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 10px;
    border-left: 4px solid #27ae60;
}

.step h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.image-card {
    background: white;
    border-radius: 10px;
    padding: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

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

.microscopy-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin: 1rem 0;
    border: 2px solid #e1e8ed;
}

.image-description {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
}

.measurement-instructions {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    margin: 2rem 0;
}

.instruction-item {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.step-number {
    background: #3498db;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-weight: bold;
}

.measurement-tips {
    background: #e8f5e8;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 2rem;
    border-left: 4px solid #27ae60;
}

.measurement-tips h5 {
    color: #27ae60;
    margin-bottom: 1rem;
}

/* Таблица измерений */
.measurement-table-container {
    overflow-x: auto;
    margin: 2rem 0;
    background: white;
    border-radius: 10px;
    padding: 1rem;
}

.measurement-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.measurement-table th,
.measurement-table td {
    padding: 1rem;
    text-align: center;
    border: 1px solid #ddd;
}

.measurement-table th {
    background: #3498db;
    color: white;
    font-weight: bold;
}

.measurement-table tr:nth-child(even) {
    background: #f9f9f9;
}

.measurement-input {
    width: 100px;
    padding: 0.5rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    text-align: center;
    font-size: 1rem;
}

.measurement-input:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

.result {
    font-weight: bold;
    color: #27ae60;
    font-size: 1.1rem;
}

/* Кнопки */
.calculate-btn,
.protocol-btn,
.quiz-btn {
    background: linear-gradient(45deg, #3498db, #2980b9);
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.3s ease;
    margin: 0.5rem;
}

.calculate-btn:hover,
.protocol-btn:hover,
.quiz-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

/* Калькулятор */
.calculator-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 2rem 0;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.calculator-input,
.calculator-result {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 10px;
    border-left: 4px solid #e74c3c;
}

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

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #2c3e50;
}

.input-group input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
}

.input-group .unit {
    margin-left: 0.5rem;
    color: #666;
    font-weight: bold;
}

.result-display {
    text-align: center;
    margin-bottom: 2rem;
}

.magnification-result {
    font-size: 3rem;
    font-weight: bold;
    color: #e74c3c;
    margin: 1rem 0;
}

.result-value {
    display: block;
}

.result-unit {
    font-size: 1.5rem;
    color: #666;
}

.calculation-steps {
    background: white;
    padding: 1rem;
    border-radius: 8px;
}

.step-calculation {
    font-family: 'Courier New', monospace;
    background: #f1f2f6;
    padding: 1rem;
    border-radius: 5px;
    margin: 0.5rem 0;
}

/* Конвертер единиц */
.unit-converter {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 10px;
    margin-top: 2rem;
    border-left: 4px solid #9b59b6;
}

.converter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.converter-item {
    text-align: center;
}

.converter-item input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    font-size: 1rem;
    text-align: center;
}

.converter-item label {
    display: block;
    font-weight: bold;
    color: #666;
}

/* Тест */
.quiz-container {
    max-width: 700px;
    margin: 0 auto;
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 10px;
}

.question-counter {
    text-align: center;
    margin-bottom: 2rem;
    color: #666;
    font-weight: bold;
}

.question {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 2rem;
    color: #2c3e50;
    text-align: center;
    padding: 1rem;
    background: white;
    border-radius: 8px;
}

.answers {
    margin-bottom: 2rem;
}

.answer-btn {
    width: 100%;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 2px solid #ddd;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    text-align: left;
}

.answer-btn:hover {
    border-color: #3498db;
    background: #ecf0f1;
}

.answer-btn.selected {
    border-color: #3498db;
    background: #3498db;
    color: white;
}

.answer-btn.correct {
    border-color: #27ae60;
    background: #27ae60;
    color: white;
}

.answer-btn.incorrect {
    border-color: #e74c3c;
    background: #e74c3c;
    color: white;
}

.quiz-navigation {
    text-align: center;
}

/* Результаты теста */
.quiz-results {
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 10px;
}

.score-display {
    margin: 2rem 0;
}

.score-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: linear-gradient(45deg, #27ae60, #2ecc71);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    color: white;
    font-size: 3rem;
    font-weight: bold;
}

.percent {
    font-size: 2rem;
}

.score-details {
    margin: 1rem 0;
    color: #666;
}

/* Протокол */
.protocol-form {
    max-width: 800px;
    margin: 0 auto;
}

.protocol-header {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
}

.protocol-content {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    border: 1px solid #ddd;
}

.protocol-content h4 {
    color: #2c3e50;
    margin: 1.5rem 0 0.5rem 0;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
}

.protocol-content ol {
    padding-left: 1.5rem;
}

.protocol-content li {
    margin-bottom: 0.5rem;
}

#conclusions {
    width: 100%;
    padding: 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
}

.protocol-actions {
    text-align: center;
}

/* Адаптивный дизайн */
@media (max-width: 768px) {
    .container {
        margin: 0;
        border-radius: 0;
    }
    
    header {
        padding: 1rem;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    header h2 {
        font-size: 1.2rem;
    }
    
    .section {
        padding: 1rem;
    }
    
    .calculator-container {
        grid-template-columns: 1fr;
    }
    
    .images-grid {
        grid-template-columns: 1fr;
    }
    
    .navigation {
        flex-direction: column;
    }
    
    .nav-btn {
        padding: 0.8rem;
    }
    
    .protocol-header {
        grid-template-columns: 1fr;
    }
    
    .converter-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .measurement-table-container {
        font-size: 0.8rem;
    }
    
    .measurement-input {
        width: 80px;
        padding: 0.3rem;
    }
    
    .formula {
        font-size: 1.5rem;
    }
    
    .magnification-result {
        font-size: 2rem;
    }
}

/* Анимации и эффекты */
.animate-bounce {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-30px);
    }
    60% {
        transform: translateY(-15px);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

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

/* Статусы и уведомления */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #27ae60;
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification.error {
    background: #e74c3c;
}

.notification.warning {
    background: #f39c12;
}

.notification.info {
    background: #3498db;
}