body {
    margin: 0;
    background-color: #300A24;
    color: #EFF0F1;
    font-family: 'Ubuntu Mono', monospace;
}

.pure-img-responsive {
    max-width: 100%;
    height: auto;
    filter: brightness(0.8) contrast(1.2);
}

/*
Add transition to containers so they can push in and out.
*/
#layout,
#menu,
.menu-link {
    -webkit-transition: all 0.2s ease-out;
    -moz-transition: all 0.2s ease-out;
    -ms-transition: all 0.2s ease-out;
    -o-transition: all 0.2s ease-out;
    transition: all 0.2s ease-out;
}

/*
This is the parent `<div>` that contains the menu and the content area.
*/
#layout {
    position: relative;
    left: 0;
    padding-left: 0;
}

#layout.active #menu {
    left: 150px;
    width: 150px;
}

#layout.active .menu-link {
    left: 150px;
}

/*
The content `<div>` is where all your content goes.
*/
.content {
    margin: 0 auto;
    padding: 0 2em;
    max-width: 800px;
    margin-bottom: 50px;
    line-height: 1.6em;
}

.header {
    margin: 0;
    color: #E95420;
    /* Ubuntu orange */
    text-align: center;
    padding: 2.5em 2em 0;
    border-bottom: 1px solid #3E3E3E;
}

.header h1 {
    margin: 0.2em 0;
    font-size: 3em;
    font-weight: 300;
    text-shadow: 0 0 5px rgba(233, 84, 32, 0.3);
}

.header h2 {
    font-weight: 300;
    color: #888;
    padding: 0;
    margin-top: 0;
}

.content-subhead {
    margin: 50px 0 20px 0;
    font-weight: 300;
    color: #E95420;
    /* Ubuntu orange */
    border-bottom: 1px solid #3E3E3E;
    padding-bottom: 0.5em;
}

/*
The `#menu` `<div>` is the parent `<div>` that contains the `.pure-menu` that
appears on the left side of the page.
*/

#menu {
    margin-left: -150px;
    /* "#menu" width */
    width: 150px;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    /* so the menu or its navicon stays above all content */
    background: #2C001E;
    /* Ubuntu dark purple */
    overflow-y: auto;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.3);
}

/*
    All anchors inside the menu should be styled like this.
    */
#menu a {
    color: #EFF0F1;
    border: none;
    padding: 0.6em 0 0.6em 0.6em;
    font-family: 'Ubuntu Mono', monospace;
}

/*
    Remove all background/borders, since we are applying them to #menu.
    */
#menu .pure-menu,
#menu .pure-menu ul {
    border: none;
    background: transparent;
}

/*
    Add that light border to separate items into groups.
    */
#menu .pure-menu ul,
#menu .pure-menu .menu-item-divided {
    border-top: 1px solid #4E3D42;
}

/*
        Change color of the anchor links on hover/focus.
        */
#menu .pure-menu li a:hover,
#menu .pure-menu li a:focus {
    background: #4E3D42;
    color: #E95420;
}

/*
    This styles the selected menu item `<li>`.
    */
#menu .pure-menu-selected,
#menu .pure-menu-heading {
    background: #E95420;
    /* Ubuntu orange */
}

/*
        This styles a link within a selected menu item `<li>`.
        */
#menu .pure-menu-selected a {
    color: #fff;
}

/*
    This styles the menu heading.
    */
#menu .pure-menu-heading {
    font-size: 110%;
    color: #fff;
    margin: 0;
    background: #4E3D42;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* -- Dynamic Button For Responsive Menu -------------------------------------*/

/*
The button to open/close the Menu is custom-made and not part of Pure. Here's
how it works:
*/

/*
`.menu-link` represents the responsive menu toggle that shows/hides on
small screens.
*/
.menu-link {
    position: fixed;
    display: block;
    /* show this only on small screens */
    top: 0;
    left: 0;
    /* "#menu width" */
    background: #2C001E;
    background: rgba(44, 0, 30, 0.9);
    font-size: 10px;
    /* change this value to increase/decrease button size */
    z-index: 10;
    width: 2em;
    height: auto;
    padding: 2.1em 1.6em;
    border-radius: 0 0 4px 0;
}

.menu-link:hover,
.menu-link:focus {
    background: #E95420;
}

.menu-link span {
    position: relative;
    display: block;
}

.menu-link span,
.menu-link span:before,
.menu-link span:after {
    background-color: #EFF0F1;
    pointer-events: none;
    width: 100%;
    height: 0.2em;
}

.menu-link span:before,
.menu-link span:after {
    position: absolute;
    margin-top: -0.6em;
    content: " ";
}

.menu-link span:after {
    margin-top: 0.6em;
}

/* Links in content */
.content a {
    color: #E95420;
    text-decoration: none;
    border-bottom: 1px dotted #E95420;
}

.content a:hover {
    color: #FF6B3B;
    border-bottom: 1px solid #FF6B3B;
}

/* Code blocks */
.content pre,
.content code {
    background-color: #1A1A1A;
    color: #D1D1D1;
    border: 1px solid #4E3D42;
    border-radius: 3px;
    padding: 0.2em 0.4em;
    font-family: 'Ubuntu Mono', monospace;
}

.content pre {
    padding: 1em;
    overflow-x: auto;
}

/* Tables */
.content table {
    border: 1px solid #4E3D42;
    background-color: #1A1A1A;
}

.content th {
    background-color: #2C001E;
    color: #E95420;
}

.content td,
.content th {
    border: 1px solid #4E3D42;
    padding: 0.5em 1em;
}

/* -- Responsive Styles (Media Queries) ------------------------------------- */

/*
Hides the menu at `48em`, but modify this based on your app's needs.
*/
@media (min-width: 48em) {

    .header,
    .content {
        padding-left: 2em;
        padding-right: 2em;
    }

    #layout {
        padding-left: 150px;
        /* left col width "#menu" */
        left: 0;
    }

    #menu {
        left: 150px;
    }

    .menu-link {
        position: fixed;
        left: 150px;
        display: none;
    }

    #layout.active .menu-link {
        left: 150px;
    }
}

@media (max-width: 48em) {

    /* Only apply this when the window is small. Otherwise, the following
    case results in extra padding on the left:
        * Make the window small.
        * Tap the menu to trigger the active state.
        * Make the window large again.
    */
    #layout.active {
        position: relative;
        left: 150px;
    }
}






/* Стили для  блока с ответами
    */
.answer-result {
    padding: 15px;
    margin: 15px 0;
    border-radius: 5px;
    border: 2px solid;
    font-weight: bold;
}

.correct-answer {
    background-color: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.incorrect-answer {
    background-color: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.result-icon {
    font-weight: bold;
    margin-right: 10px;
    font-size: 1.2em;
}

.result-text {
    font-weight: bold;
    font-size: 1.1em;
}

.user-answer {
    margin: 10px 0 0 0;
    font-style: italic;
    font-size: 0.9em;
    font-weight: normal;
}

.step-disabled-message {
    color: #856404;
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
}

/* Стили для форм */
.pure-form {
    margin: 20px 0;
}

.pure-input-rounded {
    border-radius: 20px;
    padding: 10px 15px;
    border: 1px solid #ddd;
}

.pure-button-primary {
    background-color: #0078e7;
    border-radius: 20px;
    padding: 10px 20px;
}

.pure-button-primary:hover {
    background-color: #0056b3;
}



/* Стили для легенды различий CSV */
.csv-legend {
    margin-top: 15px;
    padding: 12px;
    background: #2C001E;
    border: 1px solid #4E3D42;
    border-radius: 4px;
}

.csv-legend-title {
    color: #EFF0F1;
    font-size: 14px;
    margin: 0 0 10px 0;
    font-weight: bold;
}

.csv-legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.csv-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.csv-color-box {
    width: 16px;
    height: 16px;
    border: 1px solid #4E3D42;
}

.csv-legend-text {
    color: #EFF0F1;
    font-size: 13px;
}

/* Стили для статистики CSV */
.csv-stats {
    margin: 15px 0;
    padding: 12px;
    background: #2C001E;
    border: 1px solid #4E3D42;
}

.csv-stats h3 {
    color: #E95420;
    margin-top: 0;
    margin-bottom: 10px;
}

.csv-stats-table {
    width: 100%;
    color: #EFF0F1;
    font-family: 'Ubuntu Mono', monospace;
    border-collapse: collapse;
}

.csv-stats-table td {
    padding: 6px;
    border-bottom: 1px solid #4E3D42;
}

.csv-stats-table tr:last-child td {
    border-bottom: none;
}




#menu .pure-menu-item.completed-section>.pure-menu-link {
    color: #4E9A06 !important;
    font-weight: bold !important;
}




/* Стили для заданий с пропусками в коде */
.code-exercise {
    margin: 20px 0;
    padding: 15px;
    background: #2C001E;
    border-radius: 8px;
    border-left: 4px solid #E95420;
}

.exercise-question {
    font-weight: bold;
    margin-bottom: 15px;
    color: #EFF0F1;
    font-size: 1.1em;
}

.code-block {
    background: #1A0015;
    color: #F2F2F2;
    padding: 20px;
    border-radius: 5px;
    margin: 15px 0;
    font-family: 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
    overflow-x: auto;
    border: 1px solid #5E2750;
}

.code-line {
    margin: 8px 0;
    white-space: pre;
}

.code-text {
    color: #F2F2F2;
}

.blank-select {
    background: #2C001E;
    color: #F2F2F2;
    border: 1px solid #5E2750;
    border-radius: 3px;
    padding: 4px 8px;
    margin: 0 4px;
    font-family: 'Ubuntu Mono', monospace;
    font-size: 14px;
    min-width: 120px;
}

.blank-select:focus {
    outline: none;
    border-color: #E95420;
    box-shadow: 0 0 0 2px rgba(233, 84, 32, 0.2);
}

.blank-select option {
    background: #2C001E;
    color: #F2F2F2;
}

/* Подсветка правильных и неправильных ответов */
.blank-select.blank-correct {
    border: 2px solid #4E9A06 !important;
    background-color: #1C3C1C !important;
}

.blank-select.blank-incorrect {
    border: 2px solid #CC0000 !important;
    background-color: #3C1C1C !important;
}

/* Стили для результатов проверки */
.incorrect-blanks-list {
    margin: 10px 0;
    padding-left: 20px;
}

.incorrect-blanks-list li {
    color: #CC0000;
    margin: 5px 0;
}

.correct-answers-list {
    margin: 10px 0;
    padding-left: 20px;
}

.correct-answers-list li {
    color: #4E9A06;
    margin: 5px 0;
    font-weight: bold;
}

.correct-answers-info {
    margin-top: 15px;
    font-weight: bold;
    color: #4E9A06;
}

.solution-id-line {
    font-size: 0.9em;
    color: #888;
    margin-top: 5px;
    font-style: italic;
}


/* Стили для пошаговых алгоритмов */
.algorithm {
    background-color: #2C001E;
    border-left: 4px solid #E95420;
    padding: 15px;
    margin: 20px 0;
    border-radius: 0 8px 8px 0;
    border: 1px solid #4E3D42;
}

.algorithm summary {
    cursor: pointer;
    font-weight: bold;
    padding: 10px;
    color: #E95420;
    font-family: 'Ubuntu Mono', monospace;
    font-size: 1.1em;
    background: #1A0015;
    border-radius: 4px;
    margin: -10px -10px 10px -10px;
    transition: all 0.2s ease;
}

.algorithm summary:hover {
    background: #3D002B;
    color: #FF6B3B;
}

.algorithm ol {
    margin-top: 15px;
    padding-left: 25px;
    color: #EFF0F1;
}

.algorithm li {
    margin-bottom: 12px;
    line-height: 1.5;
    padding-left: 5px;
}

.algorithm code {
    background-color: #1A0015;
    color: #D1D1D1;
    border: 1px solid #5E2750;
    border-radius: 3px;
    padding: 2px 6px;
    font-family: 'Ubuntu Mono', monospace;
    font-size: 0.9em;
}

/* Стили для открытого состояния */
.algorithm[open] summary {
    border-radius: 4px 4px 0 0;
    margin-bottom: 15px;
}

/* Анимация открытия */
.algorithm[open] {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Иконка для аккордеона */
.algorithm summary {
    list-style: none;
    position: relative;
}

.algorithm summary::-webkit-details-marker {
    display: none;
}

.algorithm summary::after {
    content: "▶";
    position: absolute;
    right: 15px;
    transition: transform 0.2s ease;
    color: #E95420;
}

.algorithm[open] summary::after {
    transform: rotate(90deg);
}