/* Контейнер вправи */
.exercise-container {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border-left: 5px solid var(--primary-color);
}

.back-link {
    display: inline-block;
    margin-bottom: 1.5rem;
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 600;
	font-size: 1.2em;
}

.exercise-container h2 {
    color: #35518f;           /* Глибокий темно-синій для тексту */
    font-size: 1.7rem;
    font-weight: 700;
    padding: 0.8rem 1.2rem;   /* Трохи збільшені відступи */
    
    /* ФОН ТА РАМКИ */
    background-color: #f1f5f9; /* Світло-блакитний сірий (більш насичений) */
    border: 1px solid #e2e8f0;
    border-radius: 6px;       /* Трохи більше заокруглення */
    margin-bottom: 2rem;
    
    /* ТІНЬ ДЛЯ ГЛИБИНИ */
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05), 0 2px 4px rgba(0,0,0,0.05);
    
    /* ВИРІВНЮВАННЯ ЕМОДЗІ */
    display: flex;
    align-items: center;
    gap: 12px;
    line-height: 1.3;
}

/* 2. ВЕЛИКІ БЛОКИ КОДУ (Prism.js) */
pre[class*="language-"], 
code[class*="language-"] {
    background: #f6f8fa !important; /* Ваш суцільний фон */
    text-shadow: none !important;
    font-family: 'JetBrains Mono', 'Consolas', monospace !important;
    font-variant-ligatures: none !important;
    font-feature-settings: "liga" 0 !important;
}

pre[class*="language-"] {
    /* 1. Фон: GitHub використовує #f6f8fa, VS використовує білий */
    background: #f6f8fa !important; 
    
    /* 2. Рамка та тінь */
    border: 1px solid #d1d5da !important;
    box-shadow: 0 1px 3px rgba(27,31,35,0.08);
    
    /* 3. Відступи та шрифт */
    padding: 1.25rem !important;
    margin: 1.5rem 0 1.5rem 0 !important; 
    border-radius: 6px !important;
    max-width: 90%;
    overflow-x: auto;
    
    font-family: 'JetBrains Mono', monospace !important;
    font-size: 1.0rem !important;
    line-height: 1.45 !important;
}

/* 3. КОРОТКИЙ КОД У ТЕКСТІ */
code:not(pre code) {
    background-color: #f3f4f6; 
    color: #d11149;           
    padding: 0.08rem 0.4rem;
    margin: 0 0.1rem;
    border-radius: 4px;
    font-size: 0.95em;        
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-weight: 500;
    border: 1px solid #e5e7eb;
    white-space: nowrap;
    font-variant-ligatures: none !important;
    font-feature-settings: "liga" 0 !important;
    letter-spacing: 0.3px; 
}

/* 4. НАЗВИ ФАЙЛІВ (Оновлено на зелений) */
code.file-name {
    color: #059669 !important;        /* Насичений зелений (Emerald) */
    background-color: #ecfdf5 !important; /* Дуже світлий зелений фон */
    border: 1px solid #a7f3d0 !important; /* Ніжна зелена рамка */
    padding: 0.08rem 0.4rem;
    border-radius: 4px;              
}

/* 5. МОБІЛЬНА АДАПТАЦІЯ */
@media (max-width: 768px) {
    pre[class*="language-"] {
        max-width: 100%;
        margin-left: 0 !important;
    }
}

.instructions {
    line-height: 1.8;
}
.instructions li {
    line-height: 1.6; /* Збільшує простір між рядками в списку */
    margin-bottom: 8px; /* Додає відстань між пунктами */
}

.safety-note {
    background: #ffe9d4;
    border: 1px solid #e6cbb3;
    padding: 1rem;
    border-radius: 8px;
    color: #9a3412;
    margin-bottom: 1.5rem;
	font-size: 1.1em;
	font-weight: 500;
}


kbd {
    background-color: #eee;
    border-radius: 3px;
    border: 1px solid #b4b4b4;
    box-shadow: 
        0 1px 1px rgba(0, 0, 0, 0.2), 
        0 2px 0 0 rgba(255, 255, 255, 0.7) inset;
    color: #333;
    display: inline-block;
    font-size: 1em;
    font-weight: 700;
    line-height: 1.4;
    padding: 0.08rem 0.4rem;
    white-space: nowrap;
    font-family: system-ui, -apple-system, sans-serif;
    margin: 0 2px;
    position: relative;
    top: -1px;
}

.exercise-question {
    background-color: #fefce8; /* Дуже лагідний жовтий фон */
    border-left: 4px solid #facc15; /* Жовтий акцентний борт */
    padding: 0.8rem 1.2rem;
    margin: 0.8rem 0;
    border-radius: 0 8px 8px 0;
    font-size: 1.0rem;
    color: #422006; /* Темно-коричневий для легкого читання */
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.exercise-question strong {
    color: #ca8a04; /* Золотистий колір для цифри */
    min-width: 20px; /* Щоб цифри не зміщували текст, якщо їх буде > 9 */
}


.instructions a {
    color: #2563eb;
    text-decoration: none;
    position: relative;
    font-weight: 500;
    display: inline-block; /* Важливо для коректного позиціонування лінії */
}

.instructions a::after {
    content: '';
    position: absolute;
    width: 100%;
    transform: scaleX(0);
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: #2563eb;
    transform-origin: bottom right;
    transition: transform 0.3s ease-out;
}

.instructions a:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

/* Стиль для зображень всередині завдань */
.exercise-container img {
    display: block;       /* Щоб зображення було окремим блоком */
    margin-left: 40px;    /* Відступ зліва, як у списку <ol>/<ul> */
    margin-top: 15px;     /* Відступ зверху від тексту */
    margin-bottom: 15px;  /* Відступ знизу до наступного тексту */
    max-width: 85%;       /* Щоб великі скріншоти не вилазили за край */
    height: auto;         /* Збереження пропорцій */
    border-radius: 8px;   /* Легке закруглення кутів для сучасного вигляду */
    box-shadow: 0 4px 8px rgba(0,0,0,0.1); /* Легка тінь, щоб скріншот виділявся */
}

/* Якщо зображення йде прямо всередині <li> (пункту списку) */
.exercise-container li img {
    margin-left: 0;       /* Всередині <li> відступ уже є від самого списку */
    margin-top: 10px;
}
/* Стиль таблиць */
.result {
    width: 100%;
    max-width: 600px;
    border-collapse: collapse;
    font-family: 'Segoe UI', Roboto, sans-serif;
    color: #333;
    margin: 20px 0;
}

.result td {
    padding: 10px 12px;
    border-bottom: 1px solid #eee; /* Тонка світла лінія замість сітки */
}

/* Робимо правий стовпчик з балами напівжирним та вирівнюємо по правому краю */
.result td:last-child {
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    white-space: nowrap;
}

/* Ефект при наведенні для інтерактивності */
.result tr:hover {
    background-color: #f9f9f9;
}

/* Другий рівень: Маркований список всередині нумерованого */
.exercise-container ol li ul {
    margin-top: 8px;          /* Відступ від тексту батьківського пункту */
    margin-bottom: 10px;      /* Відступ до наступного пункту */
    padding-left: 25px;       /* Зміщення вправо для ієрархії */
    list-style-type: disc;    /* Класичні круглі маркери (або емодзі) */
}

/* Стиль для пунктів другого рівня */
.exercise-container ol li ul li {
    margin-bottom: 10px;
    line-height: 1.4;
}

/* Можна замінити стандартні точки на стрілочки або рисочки */
.exercise-container ol li ul {
    list-style-type: "– ";    /* Виглядає дуже акуратно в конспектах */
}


/* Оновлений стиль для Scratch-блоків */
.scratch-block {
    display: block;        /* Блоковий елемент для прогнозованих відступів */
    max-width: 100%;       /* Не даємо виходити за межі екрана */
    height: auto;
    
    /* Використовуємо zoom замінюючи scale, якщо це можливо. 
       Він автоматично перераховує займане місце */
    zoom: 0.5; 
    
    /* Якщо все ж хочете scale, додайте від'ємний margin, 
       але фіксований, або через aspect-ratio */
    image-rendering: -webkit-optimize-contrast; /* Для чіткості в Chrome/Edge */
    image-rendering: crisp-edges;
    margin: 10px 0 10px 40px; /* Вирівнювання з текстом */
}
/* Прибираємо оформлення "фотографії" для блоків коду */
.exercise-container img.scratch-block {
    box-shadow: none;        /* Прибираємо тінь */
    border-radius: 0;        /* Прибираємо заокруглення */
    border: none;            /* Прибираємо рамку */
    margin-left: 40px;       /* Чітке вирівнювання під списком */
}