/* Основные стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.03)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    z-index: -1;
}

/* Навигация */
.navbar {
    backdrop-filter: blur(10px);
    background: rgba(13, 110, 253, 0.9) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.2rem;
}

.nav-link {
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-link:hover {
    transform: translateY(-2px);
}

/* Герой секция */
.hero-section {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.8) 0%, rgba(98, 0, 238, 0.8) 100%);
    padding: 4rem 0;
    margin-bottom: 0;
}

.hero-image img {
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.hero-image img:hover {
    transform: scale(1.05);
}

.badge-container {
    margin-top: 1.5rem;
}

.badge {
    margin-right: 0.5rem;
    padding: 0.5rem 1rem;
    font-weight: 500;
}

/* Контент секции */
.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); }
}

.card {
    border-radius: 20px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.card-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1.5rem;
}

.theory-image-container img {
    max-width: 100%;
    height: auto;
    border-radius: 15px;
}

/* Моделирование ДНК */
.nucleotide-bank {
    background: rgba(248, 249, 250, 0.8);
    border-radius: 15px;
    padding: 1rem;
    border: 2px dashed #dee2e6;
}

.nucleotide {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: grab;
    transition: all 0.3s ease;
    border: 3px solid;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.nucleotide:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.nucleotide:active {
    cursor: grabbing;
    transform: scale(0.95);
}

/* Цвета нуклеотидов */
.nucleotide.adenine {
    background: linear-gradient(45deg, #ff6b6b, #ff8787);
    border-color: #ff5252;
    color: white;
}

.nucleotide.thymine {
    background: linear-gradient(45deg, #4ecdc4, #6dd5db);
    border-color: #26a69a;
    color: white;
}

.nucleotide.guanine {
    background: linear-gradient(45deg, #45b7d1, #6cb4ee);
    border-color: #2196f3;
    color: white;
}

.nucleotide.cytosine {
    background: linear-gradient(45deg, #f9ca24, #f0932b);
    border-color: #ff9f43;
    color: white;
}

.nucleotide-label {
    font-size: 1.5rem;
    font-weight: bold;
}

.nucleotide-name {
    font-size: 0.7rem;
    text-align: center;
    margin-top: 2px;
}

/* Область сборки ДНК */
.dna-construction-area {
    background: rgba(248, 249, 250, 0.8);
    border-radius: 20px;
    padding: 2rem;
    border: 2px solid rgba(13, 110, 253, 0.2);
}

.dna-strands {
    position: relative;
    margin: 2rem 0;
}

.dna-strand {
    display: flex;
    align-items: center;
    margin: 1rem 0;
}

.strand-label {
    font-weight: bold;
    color: #495057;
    margin-right: 1rem;
    min-width: 80px;
    text-align: center;
    font-size: 0.9rem;
}

.strand-sequence {
    display: flex;
    gap: 10px;
    flex: 1;
}

.nucleotide-slot {
    width: 60px;
    height: 60px;
    border: 3px dashed #dee2e6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.5);
}

.nucleotide-slot.drag-over {
    border-color: #28a745;
    background: rgba(40, 167, 69, 0.1);
    transform: scale(1.1);
}

.nucleotide-slot.filled {
    border-style: solid;
}

/* Водородные связи */
.hydrogen-bonds {
    position: absolute;
    top: 50%;
    left: 80px;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    gap: 10px;
    pointer-events: none;
}

.bond-line {
    width: 60px;
    height: 2px;
    background: transparent;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bond-line.active::before {
    content: '';
    width: 30px;
    height: 2px;
    background: #6c757d;
    animation: bondForm 0.5s ease-in-out;
}

.bond-line.double::before {
    box-shadow: 0 -3px 0 #6c757d, 0 3px 0 #6c757d;
}

.bond-line.triple::before {
    box-shadow: 0 -4px 0 #6c757d, 0 4px 0 #6c757d;
    background: #6c757d;
}

@keyframes bondForm {
    from { width: 0; opacity: 0; }
    to { width: 30px; opacity: 1; }
}

/* Прогресс */
.progress {
    border-radius: 10px;
    overflow: hidden;
    background: rgba(233, 236, 239, 0.8);
}

.progress-bar {
    transition: width 0.5s ease;
    border-radius: 10px;
    background: linear-gradient(90deg, #28a745, #20c997);
}

/* Сообщения валидации */
.alert {
    border-radius: 15px;
    border: none;
    backdrop-filter: blur(10px);
}

.alert-success {
    background: rgba(40, 167, 69, 0.15);
    color: #155724;
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.alert-danger {
    background: rgba(220, 53, 69, 0.15);
    color: #721c24;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.alert-info {
    background: rgba(13, 110, 253, 0.15);
    color: #0c5460;
    border: 1px solid rgba(13, 110, 253, 0.3);
}

/* Кнопки */
.btn {
    border-radius: 12px;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
    border: none;
}

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

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(45deg, #007bff, #0056b3);
}

.btn-success {
    background: linear-gradient(45deg, #28a745, #1e7e34);
}

.btn-warning {
    background: linear-gradient(45deg, #ffc107, #e0a800);
    color: #212529;
}

.btn-outline-danger {
    border: 2px solid #dc3545;
    color: #dc3545;
}

.btn-outline-primary {
    border: 2px solid #007bff;
    color: #007bff;
}

/* Протокол */
#protocolForm {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 2rem;
}

.form-control {
    border-radius: 10px;
    border: 2px solid rgba(206, 212, 218, 0.5);
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    background: rgba(255, 255, 255, 0.95);
}

.form-label {
    font-weight: 600;
    color: #495057;
}

/* Результаты */
#sequenceResults {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    line-height: 1.8;
    background: rgba(255, 255, 255, 0.8);
    padding: 1rem;
    border-radius: 10px;
    margin-top: 1rem;
}

.sequence-pair {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.sequence-strand {
    font-weight: bold;
}

/* Адаптивность */
@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 0;
    }
    
    .dna-construction-area {
        padding: 1rem;
    }
    
    .strand-sequence {
        gap: 5px;
    }
    
    .nucleotide-slot {
        width: 40px;
        height: 40px;
    }
    
    .nucleotide {
        width: 60px;
        height: 60px;
    }
    
    .nucleotide-label {
        font-size: 1.2rem;
    }
    
    .nucleotide-name {
        font-size: 0.6rem;
    }
    
    .strand-label {
        min-width: 60px;
        font-size: 0.8rem;
    }
}

/* Анимации */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.nucleotide.draggable:hover {
    animation: pulse 1s infinite;
}

/* Скрытие элементов */
.d-none {
    display: none !important;
}

/* Эффекты при загрузке */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

/* Стили для печати (экспорт PDF) */
@media print {
    .navbar, .btn, .nucleotide-bank, .dna-construction-area {
        display: none !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #000 !important;
    }
    
    .hero-section {
        background: white !important;
        color: black !important;
    }
}