:root {
    --content-max-width: 97%;
}

/* Базовые сбросы и контейнеры */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    font-size: 14px;
}

.content main{
    max-width: 100%; /*var(--content-max-width);*/
}

.container {
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

ul {
    display: block;
    list-style-type: disc;
    margin-block-start: 0.3em;
    margin-block-end: 0.1em;
    padding-inline-start: 15px;
    unicode-bidi: isolate;
}

table{
    margin: 0;  
    border-collapse: collapse;
}

/* Первая строка с id */
th[id]:nth-of-type(1) {
    width: 300px;
}

/* Вторая строка с id */
th[id]:nth-of-type(2) {
    width: 600px;
}

/* Третья строка с id */
th[id]:nth-of-type(3) {
    width: 100px;
}

/* Навигация (если используется) */
.nav-chapters {
    min-width: 20px;
}

/* Стили таблицы */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0px auto;
    table-layout: fixed;
}

/* Общие стили ячеек */
.data-table tr {
    height: auto; /* Автоматическая высота строки */
}

.data-table td, .data-table th {
    border: 1px solid #ccc;
    position: relative;
    padding: 0;
    vertical-align: top;
    background-color: #f9f9f9; /* Фон по умолчанию для всей ячейки */
   
    height: auto;
}

.data-table td *, .data-table th *{
    background-color: transparent !important; /* или inherit, если применимо */
}

/* Стили заголовков */
.data-table th {
    background-color: #eeeeee;
    font-weight: bold;
    /*height: 50px; /* Фиксированная высота для заголовков */
    min-height: 25px;
    min-width: 3px;
}

/* Контейнер содержимого ячейки */
.data-table .cell-content {
    display: block;
    width: 100%;
    min-height: 25px;
    padding: 2px;
    box-sizing: border-box;
    background-color: transparent; /* Делаем внутренний div прозрачным */
    text-align: left;
    outline: none;
}

/* Редактируемые ячейки */
.data-table td .cell-content[contenteditable="true"] {
    background-color: #f9f9f9;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.data-table td .cell-content[contenteditable="true"]:focus {
    background-color: #fff;
    box-shadow: 0 0 5px rgba(0,123,255,0.5);
}

/* Панель управления */
.controls {
    text-align: center;
    margin: 0px;
}

.controls button {
    margin: 0px;
    padding: 5px 10px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.controls button:hover {
    background-color: #0056b3;
}


/* Настройки таблицы */
.settings-trigger {
    position: absolute;
    top: 0;
    right: 0;
    width: 20px;
    height: 20px;
    cursor: pointer;
    z-index: 10;
    border-radius: 0 0 0 8px;
}

.settings-trigger:hover {
    background-color: rgba(0,123,255,0.1);
}

.settings-menu {
    display: none;
    position: absolute;
    top: 20px;
    right: 2px;
    background: #c7bdbd !important; /* #fff;*/
    border: 1px solid #ccc;
    padding: 4px;
    border-radius: 4px;
    white-space: nowrap;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 100;
    font-size: 12px;
}

.data-table td .settings-menu,
.data-table th .settings-menu {
    background: #20df96 !important;
}

.show-settings .settings-menu {
    display: flex;
    gap: 15px;
    align-items: center;
}

.settings-menu label {
    display: flex;
    align-items: center;
    gap: 5px;
}

.settings-menu input[type="number"],
.settings-menu select,
.settings-menu input[type="color"] {
    width: 34px;
    font-size: 12px;
}

.btn.btn-default {
    color: inherit !important; /* Наследует цвет текста */
    text-decoration: none !important; /* Убирает подчеркивание */
}

.btn.btn-default:hover {
    opacity: 0.8; /* Легкое затемнение при наведении */
}

/* Ресайзер колонок */
.column-resizer {
    position: absolute;
    top: 0;
    right: -2px;
    width: 4px;
    height: 100%;
    cursor: col-resize;
    background: transparent;
    z-index: 5;
}

.column-resizer:hover {
    background: rgba(0,123,255,0.3);
}

.section{
    opacity: 0.9 !important;
}


/* Стили для блоков кода */
.data-table .cell-content pre {
    margin: 0;
    padding: 0px;
    background:rgb(245, 245, 245);
    border-radius: 4px;
    overflow-x: auto;
}
pre code.hljs{
    padding: 0px;
    margin-top:-1px;
}
code.hljs {
    padding: 0px 0px;
}
code {
    white-space: pre-wrap; /* Сохраняем переносы строк */
    overflow-x: auto;
}

/* Highlight.js переопределит эти стили */
.hljs {
    white-space: pre-wrap;
}

/* стили для модального окна */

.current-text {
    background: #f9f9f9;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin: 20px 0;
    min-height: 50px;
}

.edit-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
}

.edit-btn:hover {
    background: #0056b3;
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 5px;
    border-radius: 8px;
    width: 90%;
    max-width: 1000px;
    /*max-height: 80vh;*/
    z-index: 1001;
}

/*.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 0px;
    height: 30px;
}*/

.modal-close-btn {
    background: none;
    border: none;
    font-size: 15px;
    cursor: pointer;
}

.modal-text-editor {
    width: 99%;
    height: 800px;
    padding-left: 7px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    resize: vertical;
    font-size: large;
}

.modal-footer {
    display: flex;
    justify-content: space-between; 
    align-items: center; 
    gap: 10px;
    margin-top: 0;
    width: 100%;
}

.modal-footer-left {
    display: flex;
    gap: 5px; 
}

.modal-footer-right {
    display: flex;
    gap: 5px; 
}

.modal-save-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 1px 1px;
    border-radius: 4px;
    cursor: pointer;
}

.modal-cancel-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 1px 1px;
    border-radius: 4px;
    cursor: pointer;
}

.modal-save-btn:hover {
    background: #218838;
}

.modal-cancel-btn:hover {
    background: #5a6268;
}

textarea {
  caret-color: red; /* Цвет курсора */
  border-left: 2px solid black; /* Более жирная левая граница для имитации */
}

.result {
    background-color: #f6f8fa;
    border: 1px solid #a733aa;
    border-radius: 6px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    color: #24292f;
    overflow-x: auto;
}

/* makrdown */
details h3{
    padding-top: 1px;
    margin-top: 1px;
    padding-bottom: 0px;
    margin-bottom: 0px;
}
h3, h2 {
    margin-block-start: 0em;
}

/* lock modal*/
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(10px);
}
.lock-container {
    text-align: center;
    color: white;
    padding: 40px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}
.lock-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}
.timer {
    font-size: 3rem;
    font-weight: bold;
    margin: 20px 0;
    color: #ff6b6b;
}
.message {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.9;
}
.progress-bar {
    width: 300px;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
    margin: 20px auto;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b, #4ecdc4);
    border-radius: 10px;
    transition: width 0.1s ease;
}
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}
.hidden {
    display: none;
}
.activate-btn {
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    border-radius: 25px;
    cursor: pointer;
    transition: transform 0.3s ease;
} 

/* image button*/
.modern-file-button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 1px;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    color: #495057;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
}
.modern-file-button:hover {
    background: #e9ecef;
    border-color: #007bff;
    color: #007bff;
}
.modern-file-button svg {
    transition: transform 0.3s ease;
}
.modern-file-button:hover svg {
    transform: translateY(-2px);
}


/* Жёстко прописываем стили для всех ссылок */
a:not([tabindex]) {
  color: #0066cc !important;
  text-decoration: underline !important;
  cursor: pointer !important;
}
a:not([tabindex]):hover {
  opacity: 0.8;
}

/* Меню редактирования контента */
.dropdown-menu-edit-modal {
  position: relative; 
  display: inline-block;
  margin-left: auto; 
}
.dropdown-toggle-edit-modal {
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px 10px;
  font-size: 1.2em;
}

.dropdown-content-edit-modal {
  display: none;
  position: absolute;
  left: 100%;   
  top: 0;      
  min-width: max-content; 
  background: white;
  box-shadow: 2px 2px 10px rgba(0,0,0,0.1);
  border-radius: 0 4px 4px 0;
  z-index: 100;
  white-space: nowrap; 
}

.dropdown-item-edit-modal {
  display: inline-block; 
  padding: 8px 4px;
  text-decoration: none;
  color: #333;
  border-right: 1px solid #eee;
}

.dropdown-item-edit-modal:last-child {
  border-right: none;
}

.dropdown-item-edit-modal:hover {
  background: #f5f5f5;
}

/* скрыть автодобавление графика Matplotlib*/
body > div:has(canvas.mpl-canvas):last-of-type {
  display: none !important;
}