/* Общие стили */
* {
    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;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* Заголовок */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-icon {
    font-size: 48px;
    background: rgba(255, 255, 255, 0.2);
    padding: 20px;
    border-radius: 15px;
}

.header h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 5px;
}

.subtitle {
    font-size: 16px;
    opacity: 0.9;
}

.protocol-btn {
    background: white;
    color: #667eea;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.protocol-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Секции */
section {
    padding: 40px;
}

section h2 {
    font-size: 28px;
    color: #333;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Теоретическая справка */
.theory-section {
    background: #f8f9fa;
}

.theory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.theory-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

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

.theory-card.exothermic {
    border-left: 5px solid #ff6b6b;
}

.theory-card.endothermic {
    border-left: 5px solid #4ecdc4;
}

.theory-card h3 {
    font-size: 22px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.theory-card ul {
    margin-top: 15px;
    padding-left: 20px;
}

.theory-card li {
    margin: 8px 0;
    line-height: 1.6;
}

/* Экологическая секция */
.ecology-section {
    background: #e8f5e9;
}

.ecology-content {
    background: white;
    padding: 25px;
    border-radius: 15px;
    border-left: 5px solid #4caf50;
}

.ecology-content ul {
    margin-top: 15px;
    list-style: none;
}

.ecology-content li {
    margin: 12px 0;
    padding-left: 30px;
    position: relative;
    line-height: 1.6;
}

.ecology-content li i {
    position: absolute;
    left: 0;
    top: 3px;
    color: #4caf50;
}

/* Карточки опытов */
.experiments-section {
    background: white;
}

.experiment-card {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.experiment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.experiment-header h3 {
    font-size: 22px;
    color: #333;
}

.badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
}

.exo-badge {
    background: #ffe5e5;
    color: #ff6b6b;
}

.endo-badge {
    background: #e0f7fa;
    color: #00acc1;
}

/* Лабораторная установка */
.experiment-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

@media (max-width: 768px) {
    .experiment-content {
        grid-template-columns: 1fr;
    }
}

.lab-setup {
    position: relative;
    background: linear-gradient(to bottom, #e3f2fd, #bbdefb);
    border-radius: 15px;
    padding: 30px;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Стакан */
.beaker {
    width: 150px;
    height: 200px;
    background: rgba(255, 255, 255, 0.3);
    border: 3px solid #333;
    border-top: none;
    border-radius: 0 0 15px 15px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.liquid {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 0;
    background: rgba(255, 200, 100, 0.6);
    transition: all 1s;
}

.liquid.water {
    background: rgba(100, 150, 255, 0.5);
}

/* Пузырьки */
.bubbles {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 0;
    overflow: hidden;
}

.bubble {
    position: absolute;
    bottom: 0;
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: rise 2s infinite;
}

@keyframes rise {
    0% {
        bottom: 0;
        opacity: 1;
    }
    100% {
        bottom: 200px;
        opacity: 0;
    }
}

/* Растворение */
.dissolving {
    position: absolute;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 30px;
    background: white;
    border-radius: 50%;
    opacity: 0;
}

/* Тигель */
.crucible {
    width: 120px;
    height: 80px;
    background: #ccc;
    border: 3px solid #666;
    border-radius: 0 0 30px 30px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.mg-ribbon {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 5px;
    height: 40px;
    background: silver;
    border-radius: 2px;
}

.flame {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 60px;
    background: radial-gradient(circle, #fff 0%, #ffeb3b 20%, #ff9800 50%, transparent 70%);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    opacity: 0;
    animation: flicker 0.2s infinite alternate;
}

@keyframes flicker {
    0% { opacity: 0.8; transform: translateX(-50%) scale(1); }
    100% { opacity: 1; transform: translateX(-50%) scale(1.1); }
}

.light-flash {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0) 70%);
    border-radius: 50%;
    opacity: 0;
    animation: flash 0.5s infinite;
}

@keyframes flash {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

/* Колба */
.flask-container {
    position: relative;
}

.flask {
    width: 100px;
    height: 140px;
    background: rgba(255, 255, 255, 0.3);
    border: 3px solid #333;
    border-radius: 0 0 50px 50px;
    position: relative;
    overflow: hidden;
}

.flask::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.3);
    border: 3px solid #333;
    border-bottom: none;
    border-radius: 5px 5px 0 0;
}

.mixture {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 0;
    background: rgba(200, 200, 200, 0.5);
    transition: all 1s;
}

.ice-effect {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 120%;
    height: 30px;
    background: linear-gradient(to bottom, transparent, rgba(150, 200, 255, 0.6));
    border-radius: 50%;
    opacity: 0;
    transition: opacity 1s;
}

.wood-block {
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    width: 140px;
    height: 20px;
    background: #8b4513;
    border-radius: 5px;
    text-align: center;
}

.wood-block p {
    font-size: 10px;
    margin-top: 22px;
    color: #333;
}

/* Термометр */
.thermometer {
    position: absolute;
    right: 10px;
    top: 20px;
    width: 20px;
    height: 120px;
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid #333;
    border-radius: 10px;
    overflow: hidden;
}

.mercury {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 30%;
    background: #ff0000;
    transition: height 1s, background 1s;
}

.temp-label {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

/* Реактивы */
.reagents {
    display: flex;
    gap: 20px;
    margin-top: 30px;
    justify-content: center;
}

.reagent {
    text-align: center;
    padding: 15px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
    cursor: pointer;
}

.reagent:hover {
    transform: scale(1.05);
}

.reagent i {
    font-size: 36px;
    color: #667eea;
    margin-bottom: 8px;
}

.reagent p {
    font-size: 12px;
    font-weight: 600;
    color: #333;
}

/* Управление опытами */
.experiment-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

.observation {
    background: white;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
    animation: slideIn 0.5s;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.observation h4 {
    color: #667eea;
    margin-bottom: 10px;
}

.observation p {
    line-height: 1.6;
    color: #333;
}

.warning-box {
    background: #fff3cd;
    border: 2px solid #ffc107;
    padding: 15px;
    border-radius: 10px;
    margin-top: 15px;
}

.warning-box i {
    color: #ff9800;
    margin-right: 8px;
}

/* Прогресс */
.progress-section {
    background: #f8f9fa;
    text-align: center;
}

.progress-container {
    max-width: 600px;
    margin: 20px auto;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.5s;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    color: white;
    font-weight: 600;
}

.progress-text {
    margin-top: 15px;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

/* Протокол */
.protocol-form {
    padding: 40px;
}

.protocol-section {
    margin-bottom: 30px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 15px;
}

.protocol-section h2 {
    color: #667eea;
    font-size: 24px;
    margin-bottom: 15px;
}

.protocol-text {
    line-height: 1.8;
    color: #333;
    font-size: 16px;
}

.protocol-list {
    list-style: disc;
    padding-left: 25px;
    margin-top: 10px;
}

.protocol-list li {
    margin: 8px 0;
    line-height: 1.6;
}

.student-info {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Inter', sans-serif;
    transition: border 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.experiment-detail {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 4px solid #667eea;
}

.experiment-detail h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.experiment-detail ol {
    padding-left: 25px;
    margin: 10px 0;
}

.experiment-detail li {
    margin: 8px 0;
    line-height: 1.6;
}

.conclusion-hints {
    background: #e8f5e9;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
    border-left: 4px solid #4caf50;
}

.conclusion-hints h4 {
    color: #4caf50;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.conclusion-hints ul {
    list-style: none;
    padding-left: 0;
}

.conclusion-hints li {
    margin: 10px 0;
    padding-left: 25px;
    position: relative;
    line-height: 1.6;
}

.conclusion-hints li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #4caf50;
    font-weight: bold;
}

.protocol-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 30px;
}

.success-message {
    background: #d4edda;
    border: 2px solid #28a745;
    color: #155724;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
    text-align: center;
    animation: slideIn 0.5s;
}

.success-message i {
    font-size: 36px;
    margin-bottom: 10px;
    display: block;
}

.warning-message {
    background: #fff3cd;
    border: 2px solid #ffc107;
    padding: 25px;
    border-radius: 10px;
    text-align: center;
}

.warning-message i {
    font-size: 36px;
    color: #ff9800;
    margin-bottom: 15px;
    display: block;
}

/* Печать */
@media print {
    body {
        background: white;
        padding: 0;
    }
    
    .container {
        box-shadow: none;
    }
    
    .header {
        background: white !important;
        color: black !important;
        border-bottom: 2px solid #333;
    }
    
    .protocol-btn,
    .protocol-actions {
        display: none !important;
    }
    
    .protocol-section {
        page-break-inside: avoid;
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    section {
        padding: 20px;
    }
    
    .header {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 24px;
    }
    
    .experiment-content {
        grid-template-columns: 1fr;
    }
    
    .protocol-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}
