/* Подключение шрифтов */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Syne:wght@500;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&family=Syne:wght@400;600;700;800&display=swap');/* Глобальные переменные (Цвета) */
:root {
    --bg-color: #f1f5f9;
    --bg-card: rgba(255, 255, 255, 0.85);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #cbd5e1;
    --primary: #0891b2;
    --primary-hover: #0e7490;
    --primary-light: #ecfeff;
    --secondary: #10b981;
    --error: #ef4444;
    --error-bg: #fef2f2;
    --success: #10b981;
    --success-bg: #ecfdf5;
    --warning: #f59e0b;
    --color-unstained: #cbd5e1;
    --color-violet: #6d28d9;
    --color-iodine: #4c1d95;
    --color-fuchsin: #e11d48;
    --color-acidfast: #dc2626;
    --color-methylene: #2563eb;
    --color-vesuvin: #d97706;
    --color-darkblue: #1e1b4b;
}

/* Сброс стилей и база */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Утилиты */
.hidden { display: none !important; }

/* --- Анимация фона (Блобы) --- */
.ambient-container {
    position: absolute; width: 100%; height: 100%; top: 0; left: 0;
    z-index: -1; pointer-events: none; overflow: hidden;
}
.bio-blob {
    position: absolute; border-radius: 50%;
    animation: float-slowly 25s infinite ease-in-out;
}
.blob-1 { width: 350px; height: 350px; top: 15%; left: 5%; background: radial-gradient(circle, rgba(8,145,178,0.20) 0%, transparent 70%); }
.blob-2 { width: 450px; height: 450px; bottom: 10%; right: 5%; animation-delay: 4s; background: radial-gradient(circle, rgba(16,185,129,0.16) 0%, transparent 70%); }
.blob-3 { width: 250px; height: 250px; top: 60%; left: 8%; animation-delay: 8s; background: radial-gradient(circle, rgba(244,63,94,0.14) 0%, transparent 70%); }

@keyframes float-slowly {
    0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
    33% { transform: translate(30px, -50px) scale(1.08) rotate(120deg); }
    66% { transform: translate(-20px, 20px) scale(0.95) rotate(240deg); }
}

/* --- Навигация --- */
nav {
    width: 100%; background-color: rgba(255, 255, 255, 0.85); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border); padding: 0 40px; display: flex;
    justify-content: space-between; align-items: center; height: 70px;
    position: sticky; top: 0; z-index: 100;
}
.nav-left { display: flex; align-items: center; gap: 30px; }
/* НОВЫЙ ЛОГОТИП (Концепт 1) */
.logo { 
    font-family: 'Space Grotesk', sans-serif; 
    font-weight: 700; 
    font-size: 1.8rem; /* УВЕЛИЧИЛИ РАЗМЕР ЗДЕСЬ */
    color: var(--text-main); 
    text-decoration: none; 
    letter-spacing: -0.5px; 
    display: flex;
    align-items: center;
}
    .logo-accent { 
    color: var(--primary); 
    transition: color 0.3s ease;
    }
        .logo:hover .logo-accent {
    color: var(--secondary); 
}

    .nav-btn { 
        text-decoration: none; 
        font-family: 'Outfit', sans-serif; 
        font-size: 1.05rem; /* Увеличили шрифт (было 0.95) */
        font-weight: 600;   /* Сделали текст более плотным (было 500) */
        color: var(--text-main); /* Сделали цвет темным и контрастным вместо блекло-серого */
        padding: 0 20px; 
        height: 70px; 
        display: flex; 
        align-items: center; 
        border-bottom: 2px solid transparent; 
        transition: all 0.2s ease;
}

.nav-btn:hover, .nav-btn.active { 
    color: var(--primary); /* Теперь при наведении текст загорается фирменным бирюзовым */
    border-bottom-color: var(--primary); 
    background-color: rgba(8, 145, 178, 0.04); 
}

/* --- Контейнер приложения --- */
.app-container {
    background-color: var(--bg-card); backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.7); padding: 3.5rem;
    border-radius: 24px; box-shadow: 0 20px 40px rgba(15, 23, 42, 0.05);
    max-width: 1200px; width: 94%; margin-top: 40px; margin-bottom: 60px;
}

/* --- Кнопки действий --- */
.btn-main { background-color: var(--primary); color: white; border: none; border-radius: 12px; padding: 14px 28px; font-size: 0.95rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-family: 'Outfit', sans-serif; text-decoration: none; cursor: pointer; transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1); }
.btn-main:hover { background-color: var(--primary-hover); transform: translateY(-2px); }
.btn-main:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-secondary { background-color: transparent; color: var(--primary); border: 1px solid var(--primary); }
.btn-secondary:hover { background-color: var(--primary-light); transform: translateY(-2px); }

/* Глобальный Адаптив (Телефоны) */
@media (max-width: 600px) {
    .nav-left { gap: 15px; }
    nav { padding: 0 20px; }
    .app-container { padding: 2rem 1.5rem; }
}

/* ============================================================
   ГЛОБАЛЬНАЯ ДИЗАЙН-СИСТЕМА МИКРОБИОЛОГИИ
   ============================================================ */


:root {
    --c-emerald: #50C878;
    --c-green-dark: #3CAE63;
    --c-teal: #50A8B7;
    --c-lime: #8AC850;
    --c-mint: #50C89F;
    --c-bg-light: #D8F5DD;
    --c-rose: #C85078;
    --c-rose-light: #DC809D;
    --c-indigo: #5064C8;

    --ink: #1D2A24;
    --ink-soft: #445048;
    --text-gray: #64766D;
    --surface: #ffffff;
    --body-bg: #F6F9F6;
    --line: #E1EAE2;
    --line-strong: #CBDACE;

    --primary: var(--c-emerald);
    --border: var(--line);
    
    --radius-s: 8px;
    --radius-m: 16px;
    --radius-l: 24px;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--body-bg);
    background-image:
        linear-gradient(var(--line) 1px, transparent 1px),
        linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 64px 64px;
    background-position: -1px -1px;
    color: var(--ink);
    display: flex; 
    flex-direction: column; 
    align-items: center;
    min-height: 100vh; 
    overflow-x: hidden; 
    position: relative;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { 
    font-family: 'Fraunces', serif; 
    font-weight: 600; 
    color: var(--ink); 
    margin-top: 0; 
    letter-spacing: -0.01em; 
}

/* Глобальные кнопки */
.btn-main {
    background: var(--c-green-dark); color: white; border: none;
    padding: 16px 24px; border-radius: 12px; font-size: 1.05rem; font-weight: 600;
    cursor: pointer; transition: all 0.2s; font-family: 'Inter', sans-serif;
}
.btn-main:hover:not(:disabled) { 
    background: #34985A; transform: translateY(-2px); box-shadow: 0 10px 20px rgba(60, 174, 99, 0.15); 
}
.btn-main:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-secondary { 
    background: transparent; color: var(--ink-soft); border: 1px solid var(--line-strong); 
}
.btn-secondary:hover:not(:disabled) { 
    border-color: var(--c-green-dark); color: var(--c-green-dark); background: transparent; box-shadow: none; 
}

/* Лоадер */
.spinner { 
    display: inline-block; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.4); 
    border-top-color: white; border-radius: 50%; animation: spin 0.6s linear infinite; margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   УНИВЕРСАЛЬНАЯ АДАПТАЦИЯ ПОД МОБИЛЬНЫЕ УСТРОЙСТВА (ТЕЛЕФОНЫ)
   ============================================================ */
@media (max-width: 860px) {
    /* 1. Общие отступы контейнеров и заголовков */
    .app-container {
        width: 100% !important;
        padding: 20px 14px !important;
        margin-top: 16px !important;
        margin-bottom: 40px !important;
        border-radius: 18px !important;
    }

    .page-header, .simulator-header {
        margin-top: 16px !important;
        margin-bottom: 24px !important;
        padding-bottom: 20px !important;
    }

    /* 2. Складываем все 2- и 3-колоночные сетки симуляторов 4, 5, 6, 7 в 1 колонку */
    .hub-container,
    .workspace,
    .sterilization-layout,
    #sim-morphology > div[style*="grid-template-columns"],
    #sim-streak div[style*="grid-template-columns"],
    #sim-respiration > div[style*="grid-template-columns"],
    #sim-antibiotics > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    /* Шапка симуляторов 6 и 7: чтобы кнопка «В меню» не наезжала на заголовок */
    .sim-header {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 10px !important;
        padding: 20px 14px 10px !important;
    }
    .btn-back {
        position: static !important;
        align-self: flex-start !important;
    }
    .sim-title {
        font-size: 1.6rem !important;
    }

    /* 3. Масштабируем крупные чашки Петри, микроскопы и SVG висячей капли под узкий экран */
    #hanging-drop-svg {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
    }

    .microscope-lens {
        width: 250px !important;
        height: 250px !important;
    }

    /* Чашка Петри в Морфологии колоний (Тема 4) и Антибиотикограмме (Тема 5) */
    #sim-morphology .petri-dish {
        zoom: 0.72;
    }
    .ab-petri {
        zoom: 0.78;
    }
    .ab-dispenser-area {
        flex-wrap: wrap !important;
        justify-content: center !important;
    }

    /* Рабочий стол «Посева штрихом» (Тема 4): пробирка, чашка и горелка переносятся по вертикали */
    #streak-workspace {
        flex-direction: column !important;
        gap: 24px !important;
        padding: 24px 14px !important;
    }

    /* Модальные окна инструктажа и справочника на телефонах */
    .guide-modal {
        flex-direction: column !important;
        padding: 24px 18px !important;
        gap: 20px !important;
    }
    .guide-modal > div {
        width: 100% !important;
    }

    /* 4. Пробирки в Теме 5 (Посев уколом) — оставляем в ряд, но компактнее */
    .workspace-tubes {
        flex-direction: row !important;
        justify-content: center !important;
        gap: 18px !important;
        padding: 50px 12px 24px 42px !important;
        min-height: 420px !important;
    }
    .tube-glass {
        width: 58px !important;
        height: 260px !important;
    }
    .cotton-plug {
        width: 54px !important;
    }
    .agar-fill {
        height: 200px !important;
    }

    /* 5. Симулятор 6 (Чашки Петри) и Симулятор 7 (Планшет РГА на 9 лунок) */
    .petri-area {
        flex-direction: column !important;
        align-items: center !important;
        gap: 24px !important;
    }
    .rga-plate {
        max-width: 100% !important;
        overflow-x: auto !important;
        justify-content: flex-start !important;
        padding: 18px 14px !important;
        gap: 10px !important;
    }
    .rga-well {
        width: 36px !important;
        height: 36px !important;
    }

    /* 6. Карточки квизов и модалки */
    .quiz-card {
        padding: 24px 18px !important;
    }
    .modal-window {
        padding: 28px 20px !important;
    }
}