/* General resets and base typography */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body, html {
    height: 100%;
    background-color: #ffffff;
    color: #2b4014;
    overflow-y: auto;
    scroll-behavior: smooth;

}

/* Master screen wrapper for slide system */
.screen-container {
    display: none; /* Hidden by default */
    height: 100vh;
    width: 100%;
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
    flex-shrink: 0;
}

/* Class to activate and show current screen */
.screen-container.active {
    display: flex;
    opacity: 1;
}

/* --- STRICT FIXED LAYOUT PROPORTIONS --- */
.left-side {
    width: 55%; /* Locked width for left column on all screens */
    height: 100%;
}

.right-side {
    width: 45%; /* Locked width for right column on all screens */
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background-color: #ffffff;
    box-shadow: -5px 0 25px rgba(0,0,0,0.05);
}

.content-wrapper {
    max-width: 480px;
    width: 100%;
}

/* --- TYPOGRAPHY & BRANDING --- */
.brand-badge {
    display: inline-block;
    background-color: #5a8324;
    color: #ffffff;
    padding: 6px 14px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 20px;
    border: 2px solid #a7cf38;
    margin-bottom: 28px;
}

h1 {
    font-size: 34px;
    line-height: 1.2;
    margin-bottom: 18px;
    color: #2b4014;
}

.highlight {
    color: #7b9e26; 
}

.description {
    font-size: 20px;
    line-height: 1.6;
    font-weight: 400;
    color: #4a5f35;
    margin-bottom: 30px;
}

/* --- SCREEN 1 SPECIFIC --- */
.intro-image-side {
    background-image: url('BIO_BG.webp');
    background-size: cover;
    background-position: center;
}

.learning-goals {
    background-color: #eef7ce;
    border-left: 5px solid #a7cf38;
    padding: 20px;
    border-radius: 0 8px 8px 0;
    margin-bottom: 35px;
}

.learning-goals h3 {
    font-size: 16px;
    margin-bottom: 12px;
    color: #2b4014;
}

.learning-goals ul {
    list-style: none;
}

.learning-goals li {
    font-size: 15px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    color: #384f1f;
}

.learning-goals li:last-child {
    margin-bottom: 0;
}

.learning-goals span {
    color: #5a8324;
    font-weight: bold;
    margin-right: 12px;
}

.btn-start {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    background-color: #f7a81b;
    color: #ffffff;
    border: none;
    padding: 16px 32px;
    font-size: 18px;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    box-shadow: 0 4px 14px rgba(247, 168, 27, 0.3);
    touch-action: manipulation; 
    -webkit-tap-highlight-color: transparent;
    position: relative; /* Чтобы z-index заработал */
    z-index: 9999 !important; 
    pointer-events: auto !important; /* Гарантируем, что клики проходят */
}

.btn-start:hover {
    background-color: #e0920d;
}

.btn-start:active {
    transform: scale(0.98);
}

.btn-portfolio-pipeline {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 32px;
    background-color: #ffffff;
    border: 1px solid #cccccc;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 700;
    color: #666;
    transition: background-color 0.2s ease, transform 0.1s ease;
    text-align: center;
}

.btn-portfolio-pipeline:hover {
    background-color: #f2f2f2;
}

button, .quiz-opt-label {
    -webkit-tap-highlight-color: transparent; /* Убирает "мигание" при тапе */
    touch-action: manipulation; /* Разрешает браузеру обрабатывать тап быстрее */
}

/* --- SCREEN 2 SPECIFIC --- */
.video-main-side {
    /* CSS Linear Gradient replicating your image colors from top to bottom */
    background: linear-gradient(to bottom, #386737 0%, #618b43 40%, #a0c257 70%, #3d6b38 100%);
    
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px; 
}

.video-wrapper {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    background-color: #000000;
}

.video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Instruction box exactly matches learning-goals geometry */
.instruction-box {
    background-color: #eef7ce;
    border-left: 5px solid #a7cf38;
    padding: 20px;
    border-radius: 0 8px 8px 0;
    margin-bottom: 35px;
}

.instruction-box h3 {
    font-size: 16px;
    margin-bottom: 12px;
    color: #2b4014;
}

.instruction-box p {
    font-size: 15px;
    line-height: 1.5;
    color: #384f1f;
}

/* Next button exactly matches start button sizing */
.btn-next {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    background-color: #cbd4c5;
    color: #8c9c84;
    border: none;
    padding: 16px 32px;
    font-size: 18px;
    font-weight: 700;
    border-radius: 8px;
    transition: all 0.3s ease;
    touch-action: manipulation; 
    -webkit-tap-highlight-color: transparent;
    position: relative; /* Чтобы z-index заработал */
    z-index: 9999 !important; 
    pointer-events: auto !important; /* Гарантируем, что клики проходят */
    cursor: pointer;
    
}

/* Pulse state modification */
.pulse-animation {
    animation: buttonPulse 2s infinite;
    background-color: #f7a81b !important;
    color: #ffffff !important;
    cursor: pointer !important;
    box-shadow: 0 4px 14px rgba(247, 168, 27, 0.4);
}

.pulse-animation:hover {
    background-color: #e0920d !important;
}

.pulse-animation:active {
    transform: scale(0.98);
}

@keyframes buttonPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* --- SCREEN 3: QUIZ CORE STYLES --- */
.quiz-visual-side {
    background: linear-gradient(to bottom, #386737 0%, #618b43 40%, #a0c257 70%, #3d6b38 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.visual-container {
    width: 100%;
    max-width: 550px;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    min-height: 380px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Option fields (Radios and Checkboxes layout) */
.quiz-opt-label {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background-color: #fcfbf7;
    border: 1px solid #cbd4c5;
    padding: 14px 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.quiz-opt-label:hover {
    border-color: #a7cf38;
    background-color: #f4f9e1;
}

.quiz-opt-label input {
    margin-top: 4px;
    accent-color: #5a8324;
}

.quiz-opt-label p {
    font-size: 16px;
    line-height: 1.4;
    color: #2b4014;
}


/* Numeric input box styling */
.numeric-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 200px;
    margin: 20px 0;
}

.numeric-input-wrapper input {
    width: 100%;
    padding: 12px;
    border: 2px solid #cbd4c5;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    color: #2b4014;
    outline: none;
    text-align: center;
}

.numeric-input-wrapper input:focus {
    border-color: #a7cf38;
}

.unit-label {
    font-size: 20px;
    font-weight: bold;
    color: #5a8324;
}




/* Feedback states */
.feedback-screen {
    text-align: center;
    animation: fadeIn 0.3s ease-in-out;
}

.feedback-screen h3 {
    font-size: 24px;
    margin: 15px 0 10px 0;
}

.feedback-screen.correct h3 { color: #5a8324; }
.feedback-screen.incorrect h3 { color: #c0392b; }

.simple-box, .discount-badge-visual, .customer-avatar {
    font-size: 42px;
    text-align: center;
}

.discount-badge-visual {
    background-color: #f7a81b;
    color: white;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 36px;
}

.final-score-box {
    text-align: center;
}
.final-score-box h2 { font-size: 22px; margin: 10px 0; }
.score-number {
    font-size: 48px;
    font-weight: 800;
    color: #f7a81b;
    margin: 15px 0;
}

.visual-container:has(.simple-box:empty) {
    background-color: transparent;
    box-shadow: none;
    border: none;
}

/* ==========================================================================
   ОБНОВЛЕННЫЕ СТИЛИ ДЛЯ ИНТЕГРАЦИИ ФОНОВЫХ ИЗОБРАЖЕНИЙ И ФИДБЕКА
   ========================================================================== */

/* Если контейнер пустой (во время вопроса), делаем его невидимым, чтобы открыть фото */
.visual-container:has(.simple-box:empty) {
    background-color: transparent;
    box-shadow: none;
    border: none;
}

/* Элегантное матовое стекло для плашки фидбека поверх фото при ответе */
.visual-container:has(.feedback-screen) {
    background-color: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 40px 30px;
    border-radius: 12px;
    transition: all 0.3s ease;
}

/* Центрирование контента внутри экрана обратной связи */
.feedback-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Стилизация картинок-статусов Richtig / Falsch */
.feedback-status-img {
    width: 90px;
    height: 90px;
    object-fit: contain;
    margin-bottom: 18px;
    /* Мягкое упругое появление иконки */
    animation: scaleInImg 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

/* Стили текстов фидбека */
.feedback-screen h3 {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 12px;
    margin-top: 0;
}

.feedback-screen p {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #2b4014;
    max-width: 420px;
    margin: 0 auto;
}

/* Цветовое кодирование заголовков вердикта */
.feedback-screen.correct h3 {
    color: #5a8324;
}

.feedback-screen.incorrect h3 {
    color: #c0392b;
}

/* Стили для текста вопроса в квизе */
.quiz-main-question {
    font-size: 1.15rem;      /* Такой же размер, как у текстов на других экранах */
    line-height: 1.6;        /* Комфортное межстрочное расстояние */
    color: #333333;          /* Читаемый темный цвет текста */
    margin-top: 12px;        /* Отступ от заголовка задачи H3 */
    margin-bottom: 25px;     /* ХОРОШИЙ ОТСТУП СНИЗУ, чтобы текст не прилипал к ответам */
}

/* На всякий случай проверим отступ у самого контейнера с интерактивными элементами */
#quiz-interactive-area {
    margin-top: 5px;
}

/* --- DRAG & DROP --- */

.dnd-container {
    width: 100%;
    display: flex;
    flex-direction: column; /* Элементы сверху, зоны снизу */
    gap: 20px;
    padding: 20px;
}

/* Элементы теперь в ОДИН ряд */
.dnd-items-pool {
    display: flex;
    flex-direction: row; /* Принудительно в ряд */
    flex-wrap: nowrap;   /* Запрещаем перенос на новую строку */
    gap: 15px;
    padding: 15px;
    background: #f0f0f0;
    border-radius: 8px;
    min-height: 100px;
    border: 2px dashed #ccc;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;    /* отмена горизонтального скролла */
}

/* Зоны теперь тоже в ряд */
.dnd-zones-target {
    display: flex;
    flex-direction: row; /* В ряд вместо колонки */
    gap: 15px;
    width: 100%;
}

.drop-zone {
    flex: 1;             /* Зоны делят ширину поровну */
    min-height: 150px;   /* Сделали чуть выше для удобства */
    border: 2px dashed #999;
    border-radius: 8px;
    display: flex;
    flex-direction: column; /* Внутри зоны заголовок сверху, картинка снизу */
    align-items: center;
    justify-content: flex-start;
    padding: 10px;
    background: #fafafa;
    transition: background 0.3s;
}

.draggable-img {
    width: 115px;         /* Немного уменьшил, чтобы помещались в ряд */
    height: 115px;
    object-fit: contain;
    cursor: grab;
    background: white;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    flex-shrink: 0;      /* Не дает картинкам сжиматься */
}

.zone-label {
    font-size: 12px;
    text-align: center;
    margin-bottom: 10px;
    font-weight: bold;
    color: #333;
    pointer-events: none;
}

.drop-target-area {
    display: flex;
    flex-wrap: wrap;      
    justify-content: center;
    gap: 5px;
    width: 100%;
    min-height: 50px;
}



/* Красивая анимация «выпрыгивания» иконки из центра */
@keyframes scaleInImg {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* Responsive configurations */
@media (max-width: 1024px) {
    .screen-container.active {
        flex-direction: column;
    }
    .left-side, .right-side {
        width: 100%;
    }
    .left-side {
        height: 700px;
    }
    .right-side {
        height: auto;
        padding: 30px 20px;
    }
    
     .quiz-visual-side, 
    .video-main-side {
        min-height: 700px !important;
        height: auto;
        flex-grow: 0;
    }
    
    #quiz-visual-content {
        min-height: 500px;
    }
}

/* --- МОБИЛЬНАЯ ОПТИМИЗАЦИЯ --- */
@media (max-width: 980px) {
    /* 1. Отключаем жесткую высоту, даем контенту прокручиваться */
    body, html {
        overflow-y: auto; 
    }

    .screen-container.active {
        flex-direction: column;
        height: auto; /* Позволяем контейнеру расти по высоте */
        min-height: 100vh;
    }

    .left-side {
        height: 250px; /* Фиксируем высоту изображения на мобильных */
        flex-shrink: 0;
    }

    .right-side {
        height: auto;
        padding: 20px;
        box-shadow: none;
    }

    /* 2. Уменьшаем шрифты для мобильных */
    h1 { font-size: 26px; }
    .description { font-size: 16px; margin-bottom: 20px; }

    /* 3. Оптимизация Drag & Drop для узких экранов */
   
/* Оптимизация Drag & Drop для мобильных */
    .dnd-container {
        padding: 10px;
    }

    .dnd-items-pool {
        flex-wrap: wrap; /* Разрешаем перенос элементов в пуле */
        min-height: auto;
        padding: 10px;
    }

    .dnd-zones-target {
        flex-direction: column; 
        gap: 10px;
    }

    .drop-zone {
        width: 100%; /* Зона на всю ширину экрана */
        min-height: 100px;
    }

    .draggable-img {
        width: 70px; /* Еще чуть компактнее для телефонов */
        height: 70px;
    }


    /* 4. Кнопки */
    .btn-start, .btn-next, .btn-portfolio-pipeline {
        padding: 12px 20px;
        font-size: 16px;
    }

    .visual-container {
        padding: 20px 15px;
    }
    
   .quiz-visual-side, 
    .video-main-side {
        min-height: 300px !important;
        height: auto;
        flex-grow: 0;
    }
    
    #quiz-visual-content {
        min-height: 350px;
    }
}