/* Современные CSS переменные для лаборатории */
:root {
    --primary-color: #2563eb;
    --secondary-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --background: #f8fafc;
    --surface: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --border-radius: 0.5rem;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header стили */
.header {
    background: linear-gradient(135deg, var(--primary-color), #3b82f6);
    color: white;
    padding: 2rem 0;
    box-shadow: var(--shadow-lg);
}

.header-content {
    text-align: center;
}

.header-content i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.header-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.header-content p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* Навигационные вкладки */
.nav-tabs {
    background: var(--surface);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.tab-buttons {
    display: flex;
    justify-content: center;
    gap: 0;
}

.tab-btn {
    background: none;
    border: none;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-btn:hover {
    background-color: #f1f5f9;
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background-color: #eff6ff;
}

/* Основной контент */
.main-content {
    padding: 2rem 0;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

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

/* Теоретический раздел */
.theory-grid {
    display: grid;
    gap: 2rem;
    margin-bottom: 2rem;
}

.theory-card {
    background: var(--surface);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.theory-card h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.protein-structure {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.structure-img, .denaturation-img {
    width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.structure-info ul, .info-text ul {
    list-style: none;
    padding-left: 0;
}

.structure-info li, .info-text li {
    padding: 0.5rem 0;
    border-left: 3px solid var(--primary-color);
    padding-left: 1rem;
    margin-bottom: 0.5rem;
    background-color: #f8fafc;
}

.denaturation-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.process-steps {
    margin-top: 1rem;
}

.step {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: linear-gradient(90deg, #eff6ff, #f0f9ff);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--secondary-color);
}

/* Симуляция эксперимента */
.simulation-container {
    background: var(--surface);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.experiment-setup {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.controls-panel, .visualization-panel {
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

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

.control-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.control-group input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--border-color);
    outline: none;
    -webkit-appearance: none;
    margin-bottom: 0.5rem;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: var(--shadow);
}

.control-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    background: var(--surface);
}

.btn-primary, .btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--text-secondary);
    color: white;
}

.btn-secondary:hover {
    background: #475569;
}

/* Визуализация белка */
.protein-visualization {
    text-align: center;
    margin-bottom: 2rem;
}

.protein-model {
    width: 120px;
    height: 120px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.5s ease;
    box-shadow: var(--shadow);
}

.protein-model.native {
    background: linear-gradient(135deg, var(--secondary-color), #059669);
}

.protein-model.denatured {
    background: linear-gradient(135deg, var(--danger-color), #dc2626);
    animation: denature 0.5s ease-in-out;
}

.protein-model.partially-denatured {
    background: linear-gradient(135deg, var(--warning-color), #d97706);
}

@keyframes denature {
    0% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(5deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.protein-structure i {
    font-size: 2.5rem;
    color: white;
}

.experiment-info {
    display: grid;
    gap: 1rem;
}

.info-card, .results-card {
    background: var(--surface);
    padding: 1rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.denaturation-indicator {
    margin-top: 1rem;
}

.level-bar {
    width: 100%;
    height: 20px;
    background: var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.level-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary-color), var(--warning-color), var(--danger-color));
    transition: width 0.5s ease;
}

/* Журнал экспериментов */
.experiment-log {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.history-list {
    max-height: 300px;
    overflow-y: auto;
}

.history-item {
    background: var(--surface);
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
    box-shadow: var(--shadow);
}

/* Протокол лабораторной работы */
.protocol-container {
    background: var(--surface);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.protocol-form {
    max-width: 800px;
}

.form-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.form-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 1rem;
}

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

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-family: inherit;
    background: var(--surface);
    resize: vertical;
}

.form-group textarea {
    min-height: 100px;
}

.form-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.form-section h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.results-table {
    overflow-x: auto;
    margin: 1rem 0;
}

.results-table table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.results-table th, .results-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.results-table th {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

.results-table tr:hover {
    background-color: #f8fafc;
}

.work-steps {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.work-step {
    padding: 1rem;
    margin-bottom: 1rem;
    background: #f1f5f9;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--secondary-color);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

/* Footer */
.footer {
    background: var(--text-primary);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
}

/* Адаптивность */
@media (max-width: 768px) {
    .container {
        padding: 0 0.5rem;
    }
    
    .tab-buttons {
        flex-direction: column;
    }
    
    .tab-btn {
        padding: 0.75rem 1rem;
    }
    
    .experiment-setup {
        grid-template-columns: 1fr;
    }
    
    .protein-structure, .denaturation-info {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .header-content h1 {
        font-size: 2rem;
    }
}

/* Анимации для интерактивности */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.btn-primary:active {
    animation: pulse 0.2s ease-in-out;
}

.placeholder {
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    padding: 2rem;
}

/* Дополнительные стили для улучшения UX */
.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 1s infinite;
}

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