:root {
    --bg: #ffffff;
    --text: #111111;
    --sidebar-bg: #f1f1f1;
    --font-size-base: 1rem;
    /* Базовий розмір шрифта */
    --font-size-heading: 1.4rem;
    /* Розмір для заголовків */
    --font-size-small: 1rem;
    /* Розмір для всіх елементів */
}

[data-theme="dark"] {
    --bg: #121212;
    --text: #eeeeee;
    --sidebar-bg: #1e1e1e;
}

body {
    font-family: sans-serif;
    margin: 0;
    background-color: var(--bg);
    color: var(--text);
    transition: background 0.3s, color 0.3s;
    font-size: var(--font-size-base);
    /* Загальний розмір шрифта */
}

/* Шапка */
#header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background-color: var(--sidebar-bg);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    z-index: 1100;
    box-sizing: border-box;
}

/* Бургер-меню */
#burger {
    display: none;
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    user-select: none;
}

/* Кнопка теми */
#theme-toggle {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    user-select: none;
}

/* Заголовок в центрі */
#header-title {
    font-weight: 700;
    font-size: var(--font-size-heading);
    text-align: center;
    flex-grow: 1;
}

/* Бігучий рядок */
.ticker-container {
    margin-top: 48px;
    overflow: hidden;
    white-space: nowrap;
    background: #222;
    color: #fff;
    padding: 0.5rem 1rem;
    position: relative;
    z-index: 1000;
}

.ticker-text {
    display: inline-block;
    padding-left: 100%;
    animation: scroll-text 15s linear infinite;
}

@keyframes scroll-text {
    0% {
        transform: translateX(0%);
    }

    100% {
        transform: translateX(-100%);
    }
}

/* Бічне меню */
#sidebar {
    width: 200px;
    padding: 1rem;
    background-color: var(--sidebar-bg);
    height: 100vh;
    position: fixed;
    overflow-y: auto;
    left: 0;
    top: 48px;
    transition: transform 0.3s ease;
    z-index: 1050;
}

/* Початковий стан прихований для мобільних */
#sidebar.sidebar-closed {
    transform: translateX(-100%);
}

#sidebar.sidebar-open {
    transform: translateX(0);
}

#sidebar ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

#sidebar ul li {
    margin: 1rem 0;
}

#sidebar ul li a {
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
}

#sidebar ul li a:hover {
    text-decoration: underline;
}

/* Основний контент */
main {
    margin-left: 220px;
    padding: 1rem;
    margin-top: 48px;
}

.stage-section {
    padding-left: 1rem;
    margin-top: 0.3rem;
}

.stage-section li a {
    display: block;
    padding: 0.3rem 0;
    font-size: 0.95rem;
}

.stage-toggle {
    background: none;
    border: none;
    color: #333;
    font-weight: bold;
    cursor: pointer;
    padding: 0.5rem 0;
    font-size: 1rem;
    width: 100%;
    text-align: left;
}

.stage-toggle:hover {
    color: #007bff;
}

/* Приховані секції */
.hidden {
    display: none;
}

section img {
    max-width: 70%;
    height: auto;
    display: block;
    margin: 0 auto 1rem auto;
    /* по центру з відступом знизу */
}

.btn-feedback {
    display: inline-block;
    padding: 10px 20px;
    background-color: #0088cc;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: background-color 0.3s ease;
    margin-top: 15px;
}

.btn-feedback:hover {
    background-color: #005f7f;
}

/* Вікно пожертви */

#donation-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: fadeInBg 0.3s ease forwards;
}

#donation-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.25);
    /* Зменшена непрозорість */
}

#donation-box {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.85);
    background: rgba(255, 255, 255, 0.85);
    /* Напівпрозорий білий фон */
    padding: 30px 40px;
    max-width: 420px;
    width: 90%;
    border-radius: 14px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.10);
    text-align: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #222;
    opacity: 0;
    animation: popupScaleIn 0.35s ease forwards;
}

#donation-box p {
    margin-bottom: 28px;
    font-size: 18px;
    line-height: 1.5;
    font-weight: 500;
}

#donation-box button {
    margin: 0 12px;
    padding: 12px 28px;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

#btn-no {
    background: #e6e6e6;
    color: #555;
}

#btn-no:hover,
#btn-no:focus {
    background: #cccccc;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
    outline: none;
}

#btn-donate {
    background: #0069ff;
    color: white;
    font-weight: 600;
    box-shadow: 0 5px 15px rgba(0, 105, 255, 0.35);
}

#btn-donate:hover,
#btn-donate:focus {
    background: #004ecb;
    box-shadow: 0 7px 20px rgba(0, 78, 203, 0.5);
    outline: none;
}

/* Анімації */

@keyframes fadeInBg {
    from {
        background: rgba(0, 0, 0, 0);
    }

    to {
        background: rgba(0, 0, 0, 0.25);
    }
}

@keyframes popupScaleIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.85);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Адаптивність */
@media (max-width: 420px) {
    #burger {
        display: block;
    }

    #sidebar {
        top: 48px;
        height: calc(100vh - 48px);
        position: fixed;
        z-index: 1050;
    }

    main {
        margin-left: 0;
        padding: 1rem;
    }

    /* Стиль для секцій */
    #linux,
    #terminal,
    #git,
    #css,
    #scripts {
        padding: 1rem;
        font-size: var(--font-size-small);
        /* Зроблено однаковим для всіх секцій */
    }

    /* Заголовки */
    #linux h2,
    #terminal h2,
    #git h2,
    #css h2,
    #scripts h2 {
        font-size: var(--font-size-heading);
        /* Розмір заголовків однаковий для всіх */
    }

    #linux h3,
    #terminal h3,
    #git h3,
    #css h3,
    #scripts h3 {
        font-size: 1rem;
    }

    /* Стиль для коду */
    #linux code,
    #terminal code,
    #git code,
    #css code,
    #scripts code {
        font-size: 0.85rem;
        /* Зменшений розмір для коду */
    }

    #linux pre,
    #terminal pre,
    #git pre,
    #css pre,
    #scripts pre {
        font-size: 0.85rem;
        overflow-x: auto;
        display: block;
        white-space: pre-wrap;
        word-break: break-word;
        padding: 0.4rem;
    }

    /* Кнопки та форми */
    #linux select,
    #terminal select,
    #git select,
    #css select,
    #scripts select,
    #linux button,
    #terminal button,
    #git button,
    #css button,
    #scripts button {
        font-size: 0.85rem;
        padding: 0.4rem 0.6rem;
    }
}

#welcome {
    padding: 1rem 0.8rem;
}

#welcome h2 {
    font-size: 1.4rem;
    margin-bottom: 0.8rem;
}

#welcome p {
    font-size: 0.95rem;
    margin-bottom: 0.8rem;
}


/* Секція для Linux */
#linux {
    padding: 1rem;
    font-size: var(--font-size-small);
    line-height: 1.5;
}

#linux h2,
#linux h3 {
    font-size: var(--font-size-heading);
}

#linux ul,
#linux ol {
    padding-left: 1.2rem;
}

#linux code,
#linux pre {
    font-size: 0.85rem;
    overflow-x: auto;
    display: block;
    white-space: pre-wrap;
    word-break: break-word;
}

#linux table {
    display: block;
    overflow-x: auto;
    width: 100%;
}

#linux th,
#linux td {
    font-size: 0.85rem;
    padding: 4px 6px;
    white-space: nowrap;
}

#linux pre code {
    padding: 0.5rem;
    background: #f0f0f0;
    border-radius: 6px;
    display: block;
}

/* Секція для Terminal */
#terminal {
    padding: 15px 10px;
    font-size: var(--font-size-small);
}

#terminal h2 {
    font-size: var(--font-size-heading);
}

#terminal h3 {
    font-size: 1rem;
}

#terminal p,
#terminal ul {
    font-size: var(--font-size-small);
}

#terminal code {
    font-size: 0.85rem;
}

#terminal pre {
    font-size: 0.85rem;
}

/* Секція для Git */
#git {
    padding: 1rem 0.8rem;
    font-size: var(--font-size-small);
}

#git h2 {
    font-size: var(--font-size-heading);
}

#git h3 {
    font-size: 1rem;
    margin-top: 1.2rem;
    margin-bottom: 0.5rem;
}

#git p,
#git ul,
#git ol,
#git form,
#git pre {
    font-size: var(--font-size-small);
    line-height: 1.4;
    margin-bottom: 0.8rem;
}

#git code {
    font-size: 0.85rem;
    padding: 2px 4px;
}

#git pre {
    font-size: 0.85rem;
    padding: 0.6rem;
}

#git select,
#git button {
    font-size: 0.85rem;
    padding: 0.5rem 0.6rem;
}

/* Секція для CSS */
#css {
    padding: 1rem;
    font-size: var(--font-size-small);
}

#css h2 {
    font-size: var(--font-size-heading);
}

#css h3 {
    font-size: 1rem;
    margin-top: 1rem;
    margin-bottom: 0.4rem;
}

#css p,
#css ul,
#css ol,
#css form,
#css pre {
    font-size: var(--font-size-small);
    margin-bottom: 0.6rem;
}

#css code {
    font-size: 0.85rem;
    padding: 2px 3px;
}

#css pre {
    font-size: 0.85rem;
    padding: 0.5rem;
}

#css select,
#css button {
    font-size: 0.85rem;
    padding: 0.4rem 0.5rem;
}

/* Секція для Scripts */
#scripts {
    padding: 0.6rem;
    font-size: var(--font-size-small);
}

#scripts pre {
    font-size: 0.85rem;
    padding: 0.4rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-width: 100%;
}

#scripts code {
    font-size: 0.85rem;
    padding: 2px 3px;
    word-wrap: break-word;
}

#scripts h2 {
    font-size: var(--font-size-heading);
}

#scripts h3 {
    font-size: 1rem;
    margin-top: 0.8rem;
    margin-bottom: 0.6rem;
}

#scripts p,
#scripts ul,
#scripts ol,
#scripts form,
#scripts pre {
    font-size: var(--font-size-small);
    margin-bottom: 0.6rem;
}

#scripts ul li,
#scripts ol li {
    font-size: var(--font-size-small);
}

#scripts select,
#scripts button {
    font-size: 0.85rem;
    padding: 0.4rem 0.5rem;
}

#thinking {
    padding: 1rem;
}

#thinking img {
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 1rem auto;
}

#thinking h2 {
    font-size: 1.4rem;
    text-align: center;
}

#thinking h3 {
    font-size: 1.1rem;
    margin-top: 1rem;
}

#thinking p {
    font-size: 1rem;
    line-height: 1.6;
}

#thinking ul {
    padding-left: 1.2rem;
}

#thinking li {
    font-size: 1rem;
    margin-bottom: 0.6rem;
}

#thinking blockquote {
    font-size: 1rem;
    border-left: 4px solid #ccc;
    padding-left: 0.8rem;
    margin-left: 0;
}

#html {
    padding: 1rem;
}

#html img {
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 1rem auto;
}

#html h2 {
    font-size: 1.4rem;
    text-align: center;
    margin-bottom: 1rem;
}

#html h3 {
    font-size: 1.15rem;
    margin-top: 1.2rem;
}

#html p,
#html li {
    font-size: 1rem;
    line-height: 1.6;
}

#html ul {
    padding-left: 1.2rem;
}

#html code {
    font-family: monospace;
    background-color: #f4f4f4;
    padding: 0.1em 0.3em;
    border-radius: 4px;
    font-size: 0.95rem;
}

#html pre {
    overflow-x: auto;
    background: #f9f9f9;
    padding: 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    line-height: 1.5;
    max-width: 100%;
    box-sizing: border-box;
}

#html hr {
    margin: 1.5rem 0;
}

#html a {
    word-break: break-word;
}

#scripts {
    padding: 1rem;
}

#scripts img {
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 1rem auto;
}

#scripts h2 {
    font-size: 1.4rem;
    text-align: center;
    margin-bottom: 1rem;
}

#scripts h3 {
    font-size: 1.15rem;
    margin-top: 1.2rem;
}

#scripts p,
#scripts li {
    font-size: 1rem;
    line-height: 1.6;
}

#scripts ul {
    padding-left: 1.2rem;
}

#scripts code {
    font-family: monospace;
    background-color: #f4f4f4;
    padding: 0.1em 0.3em;
    border-radius: 4px;
    font-size: 0.95rem;
    word-break: break-word;
}

#scripts pre {
    overflow-x: auto;
    background: #f9f9f9;
    padding: 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    line-height: 1.5;
    max-width: 100%;
    box-sizing: border-box;
    white-space: pre-wrap;
    word-wrap: break-word;
}

#scripts hr {
    margin: 1.5rem 0;
}

#scripts a {
    word-break: break-word;
}

#zavdannya {
    padding: 1rem;
}

#zavdannya img {
    width: 100%;
    height: auto;
    margin-bottom: 1rem;
}

#zavdannya h2 {
    font-size: 1.3rem;
    line-height: 1.4;
}

#zavdannya h3 {
    font-size: 1.1rem;
    margin-top: 1.2rem;
}

#zavdannya h4 {
    font-size: 1rem;
    margin-top: 0.8rem;
}

#zavdannya p,
#zavdannya li {
    font-size: 0.95rem;
    line-height: 1.5;
}

#zavdannya ul {
    padding-left: 1.2rem;
}

#zavdannya article.task {
    margin-bottom: 2rem;
}

#next {
    padding: 1rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

#next img {
    width: 100%;
    height: auto;
    max-width: 100%;
    margin-bottom: 1rem;
}

#next h2 {
    font-size: 1.4rem;
    text-align: center;
}

#next h3 {
    font-size: 1.2rem;
    margin-top: 1.5rem;
}

#next ul {
    padding-left: 1.2rem;
}

#next li {
    margin-bottom: 0.8rem;
    line-height: 1.4;
}

#next p {
    margin-bottom: 1rem;
    text-align: justify;
}

#feedback {
    padding: 15px 10px;
}

#feedback h2 {
    font-size: 1.4rem;
}

#feedback p {
    font-size: 0.9rem;
}

#VSCode {
    padding: 1rem;
    font-size: 15px;
}

#VSCode img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 1rem auto;
}

#VSCode h2,
#VSCode h3 {
    font-size: 1.2rem;
    margin-top: 1.2rem;
}

#VSCode ul,
#VSCode ol {
    padding-left: 1.2rem;
}

#VSCode li {
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

#VSCode p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

#VSCode a {
    word-break: break-word;
}

#bonus {
    padding: 12px 15px;
    margin: 10px;
    font-size: 0.95rem;
}

#bonus h2 {
    font-size: 1.4rem;
    margin-top: 15px;
}

#bonus h3 {
    font-size: 1.2rem;
    margin-top: 15px;
    margin-bottom: 10px;
}

#bonus p,
#bonus ul li {
    font-size: 0.9rem;
}

#bonus img {
    width: 90%;
    margin-bottom: 12px;
}

/* Зменшуємо відступи у списках для економії місця */
#bonus ul li {
    margin-bottom: 8px;
}

/* Вікно пожертви */
#donation-box {
    max-width: 320px;
    padding: 20px 20px;
    width: 95%;
    font-size: 15px;
}

#donation-box p {
    font-size: 15px;
}

#donation-box button {
    padding: 10px 15px;
    font-size: 14px;
    margin: 5px 5px 0 5px;
    width: 45%;
    /* кнопки займають майже половину ширини */
    box-sizing: border-box;
}


/* Стилі секції Сертифікат */
.certificate-section {
    padding: 40px;
    background-color: #f9f9f9;
    text-align: center;
    border-top: 2px solid #ccc;
}

.certificate-section h2 {
    font-size: 28px;
    color: #a70404;
    margin-bottom: 20px;
}

.certificate-section p {
    font-size: 16px;
    color: #333;
    max-width: 700px;
    margin: 0 auto 30px;
    line-height: 1.6;
}

/* Кнопки Telegram / Viber */
.certificate-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.certificate-buttons button {
    background-color: #0088cc;
    color: #fff;
    border: none;
    padding: 12px 25px;
    font-size: 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
}

.certificate-buttons a:nth-child(2) button {
    background-color: #665cac;
}

.certificate-buttons button:hover {
    opacity: 0.9;
}