/* style.css - Стили в стиле тёмного Discord */

:root {
    /* Discord dark theme colors */
    --bg-primary: #36393f;
    --bg-secondary: #2f3136;
    --bg-tertiary: #202225;
    --bg-floating: #18191c;
    --text-normal: #dcddde;
    --text-muted: #72767d;
    --text-link: #00b0f4;
    --interactive-normal: #b9bbbe;
    --interactive-hover: #dcddde;
    --interactive-active: #fff;
    --interactive-muted: #4f545c;
    --background-modifier-hover: rgba(79, 84, 92, 0.16);
    --background-modifier-active: rgba(79, 84, 92, 0.24);
    --background-modifier-selected: rgba(79, 84, 92, 0.32);
    --background-modifier-accent: hsla(0, 0%, 100%, 0.06);
    --info-positive: #3ba55d;
    --info-warning: #faa81a;
    --info-danger: #ed4245;
    --button-primary: #5865f2;
    --button-primary-hover: #4752c4;
    --button-success: #3ba55d;
    --button-success-hover: #2d7d46;
    --button-danger: #ed4245;
    --button-danger-hover: #c03537;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Whitney', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: var(--bg-tertiary);
    color: var(--text-normal);
    line-height: 1.5;
}

/* Контейнеры */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.card {
    background-color: var(--bg-secondary);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.2);
}

.card-header {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-normal);
    border-bottom: 1px solid var(--bg-tertiary);
    padding-bottom: 10px;
}

/* Вкладки */
.tabs-container {
    background-color: var(--bg-tertiary);
    border-radius: 8px;
    overflow: hidden;
}

.tabs-header {
    display: flex;
    background-color: var(--bg-secondary);
    border-bottom: 2px solid var(--bg-tertiary);
}

.tab-btn {
    flex: 1;
    padding: 12px 20px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.tab-btn:hover {
    color: var(--text-normal);
    background-color: var(--background-modifier-hover);
}

.tab-btn.active {
    color: var(--button-primary);
    border-bottom-color: var(--button-primary);
}

.tab-content {
    display: none;
    padding: 20px;
    background-color: var(--bg-secondary);
}

.tab-content.active {
    display: block;
}

/* Формы */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--bg-floating);
    border-radius: 4px;
    color: var(--text-normal);
    padding: 10px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--button-primary);
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
    font-family: inherit;
}

/* Кнопки */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background-color: var(--button-primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--button-primary-hover);
}

.btn-success {
    background-color: var(--button-success);
    color: white;
}

.btn-success:hover {
    background-color: var(--button-success-hover);
}

.btn-danger {
    background-color: var(--button-danger);
    color: white;
}

.btn-danger:hover {
    background-color: var(--button-danger-hover);
}

.btn-secondary {
    background-color: var(--interactive-muted);
    color: white;
}

.btn-secondary:hover {
    background-color: var(--interactive-normal);
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-link {
    background: none;
    border: none;
    color: var(--text-link);
    text-decoration: none;
    cursor: pointer;
    padding: 4px 8px;
    font-size: 12px;
}

.btn-link:hover {
    text-decoration: underline;
    background: none;
}

/* Навигация */
.navbar {
    background-color: var(--bg-secondary);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 0 rgba(4, 4, 5, 0.2);
}

.navbar-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-normal);
}

.navbar-user {
    color: var(--text-muted);
    font-size: 14px;
}

/* Список должностей/вопросов */
.list-item {
    background-color: var(--bg-primary);
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s;
}

.list-item:hover {
    background-color: var(--background-modifier-hover);
}

.list-item-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-normal);
}

.list-item-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.list-item-actions {
    display: flex;
    gap: 8px;
}

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

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--bg-secondary);
    border-radius: 8px;
    padding: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

/* Большое модальное окно для результатов кандидата */
.modal-content-large {
    background-color: var(--bg-secondary);
    border-radius: 8px;
    padding: 30px;
    max-width: 950px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

/* Адаптивность для планшетов */
@media (max-width: 1024px) {
    .modal-content-large {
        max-width: 90%;
        width: 90%;
        padding: 20px;
    }
}

/* Адаптивность для телефонов */
@media (max-width: 768px) {
    .modal-content-large {
        max-width: 95%;
        width: 95%;
        padding: 15px;
        max-height: 95vh;
    }
}

.modal-header {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-normal);
}

.modal-close {
    float: right;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-normal);
}

/* Таблицы */
.table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

.table thead {
    background-color: var(--bg-tertiary);
}

.table th {
    padding: 12px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
}

.table td {
    padding: 12px;
    border-top: 1px solid var(--bg-tertiary);
    color: var(--text-normal);
    word-wrap: break-word;
    word-break: break-word;
    vertical-align: top;
}

.table tbody tr:hover {
    background-color: var(--background-modifier-hover);
}

/* Расширяемый текст в таблицах */
.expandable-text {
    max-height: 100px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.expandable-text.expanded {
    max-height: none;
    overflow: visible;
}

/* Адаптивность таблиц на мобильных */
@media (max-width: 768px) {
    .table {
        font-size: 14px;
    }

    .table th,
    .table td {
        padding: 8px;
    }

    .expandable-text {
        max-height: 80px;
    }
}

/* Тумблер (Toggle Switch) */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--interactive-muted);
    transition: 0.3s;
    border-radius: 28px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--button-primary);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 0 2px var(--button-primary-hover);
}

/* Алерты */
.alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background-color: rgba(59, 165, 93, 0.1);
    color: var(--info-positive);
    border: 1px solid var(--info-positive);
}

.alert-danger {
    background-color: rgba(237, 66, 69, 0.1);
    color: var(--info-danger);
    border: 1px solid var(--info-danger);
}

.alert-info {
    background-color: rgba(0, 176, 244, 0.1);
    color: var(--text-link);
    border: 1px solid var(--text-link);
}

/* Загрузчик */
.loader {
    border: 3px solid var(--bg-tertiary);
    border-top: 3px solid var(--button-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Утилиты */
.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none;
}

.flex {
    display: flex;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gap-10 {
    gap: 10px;
}

/* Вопросы в тесте */
.question-container {
    background-color: var(--bg-secondary);
    border-radius: 8px;
    padding: 30px;
    max-width: 800px;
    margin: 40px auto;
}

.question-number {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 10px;
}

.question-text {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-normal);
    margin-bottom: 20px;
    line-height: 1.6;
    /* Защита от выделения и копирования теперь применяется условно через JavaScript */
}

.answer-textarea {
    width: 100%;
    min-height: 200px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--bg-floating);
    border-radius: 4px;
    color: var(--text-normal);
    padding: 15px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
}

.answer-textarea:focus {
    outline: none;
    border-color: var(--button-primary);
}

/* Логин форма */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-card {
    background-color: var(--bg-secondary);
    border-radius: 8px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

.login-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-normal);
    text-align: center;
    margin-bottom: 30px;
}

/* Статистика */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: var(--bg-primary);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.stat-value {
    font-size: 32px;
    font-weight: 600;
    color: var(--button-primary);
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Прогресс бар */
.progress-bar {
    width: 100%;
    height: 6px;
    background-color: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 30px;
}

.progress-fill {
    height: 100%;
    background-color: var(--button-primary);
    transition: width 0.3s;
}

/* Фильтры в таблице */
.filter-input {
    width: 100%;
    background-color: var(--bg-primary);
    border: 1px solid var(--bg-floating);
    border-radius: 4px;
    color: var(--text-normal);
    padding: 4px 6px;
    font-size: 11px;
    margin-top: 6px;
    transition: border-color 0.2s;
}

.filter-input:focus {
    outline: none;
    border-color: var(--button-primary);
}

.filter-input::placeholder {
    color: var(--text-muted);
}

/* Обертка для таблицы с горизонтальным скроллом */
.table-wrapper {
    overflow-x: auto;
    margin-top: 15px;
    border-radius: 8px;
    background-color: var(--bg-tertiary);
}

/* Стили для таблицы общей статистики */
#allSessionsTable {
    min-width: 1700px;
    font-size: 13px;
}

#allSessionsTable th {
    padding: 8px 10px;
    white-space: nowrap;
    vertical-align: top;
}

#allSessionsTable td {
    padding: 10px;
    font-size: 13px;
}

/* Фиксированные ширины столбцов для красивого отображения */
#allSessionsTable th:nth-child(1),
#allSessionsTable td:nth-child(1) {
    width: 110px;
    min-width: 110px;
}

#allSessionsTable th:nth-child(2),
#allSessionsTable td:nth-child(2) {
    width: 150px;
    min-width: 150px;
}

#allSessionsTable th:nth-child(3),
#allSessionsTable td:nth-child(3) {
    width: 100px;
    min-width: 100px;
}

#allSessionsTable th:nth-child(4),
#allSessionsTable td:nth-child(4) {
    width: 100px;
    min-width: 100px;
}

#allSessionsTable th:nth-child(5),
#allSessionsTable td:nth-child(5) {
    width: 120px;
    min-width: 120px;
}

#allSessionsTable th:nth-child(6),
#allSessionsTable td:nth-child(6) {
    width: 100px;
    min-width: 100px;
    text-align: center;
}

#allSessionsTable th:nth-child(7),
#allSessionsTable td:nth-child(7) {
    width: 110px;
    min-width: 110px;
    text-align: center;
}

#allSessionsTable th:nth-child(8),
#allSessionsTable td:nth-child(8) {
    width: 100px;
    min-width: 100px;
}

#allSessionsTable th:nth-child(9),
#allSessionsTable td:nth-child(9) {
    width: 150px;
    min-width: 150px;
}

#allSessionsTable th:nth-child(10),
#allSessionsTable td:nth-child(10) {
    width: 150px;
    min-width: 150px;
}

#allSessionsTable th:nth-child(11),
#allSessionsTable td:nth-child(11) {
    width: 140px;
    min-width: 140px;
}

#allSessionsTable th:nth-child(12),
#allSessionsTable td:nth-child(12) {
    width: 180px;
    min-width: 180px;
}

/* Заголовки столбцов с курсором */
#allSessionsTable th > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
    margin-bottom: 2px;
}

#allSessionsTable th > div:hover {
    color: var(--text-normal);
}

/* Индикаторы сортировки */
#allSessionsTable th span[id^="sort-all-"] {
    margin-left: 4px;
    font-size: 10px;
}

/* Кнопки с иконками для таблиц */
.btn-icon {
    position: relative;
    min-width: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Всегда показываем только иконки в кнопках действий таблиц */
.btn-icon .btn-icon-only {
    display: inline !important;
    font-size: 18px;
}

.btn-icon .btn-text {
    display: none !important;
}

.btn-icon {
    padding: 10px;
    min-width: 42px;
    min-height: 42px;
}

/* ============================================
   АДАПТИВНАЯ ВЕРСТКА ДЛЯ МОБИЛЬНЫХ УСТРОЙСТВ
   ============================================ */

/* Планшеты и меньше (до 1024px) */
@media (max-width: 1024px) {
    .container {
        padding: 15px;
    }

    .card {
        padding: 15px;
    }

    /* Адаптивные кнопки на планшетах */
    .flex-between {
        flex-wrap: wrap;
        gap: 10px;
    }

    .flex-between > div {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
}

/* Мобильные устройства (до 768px) */
@media (max-width: 768px) {
    /* Навбар */
    .navbar {
        flex-direction: column;
        gap: 10px;
        padding: 12px 15px;
        text-align: center;
    }

    .navbar-title {
        font-size: 16px;
    }

    .navbar-user {
        font-size: 13px;
    }

    /* Контейнер */
    .container {
        padding: 10px;
    }

    .card {
        padding: 12px;
        margin-bottom: 15px;
    }

    /* Заголовки */
    .card-header {
        font-size: 18px;
    }

    h2 {
        font-size: 20px;
    }

    h3 {
        font-size: 16px;
    }

    /* Кнопки */
    .btn {
        padding: 12px 16px;
        font-size: 14px;
        width: 100%;
        margin-bottom: 8px;
    }

    .btn-small {
        padding: 10px 14px;
        font-size: 13px;
        width: auto;
    }

    /* Группы кнопок */
    .flex-between {
        flex-direction: column;
        align-items: stretch;
    }

    .flex-between > div {
        width: 100%;
    }

    .list-item-actions {
        flex-direction: column;
        width: 100%;
        gap: 6px;
    }

    .list-item-actions .btn {
        margin-bottom: 0;
    }

    /* Список элементов */
    .list-item {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    /* Таблицы - обязательный скролл */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table {
        font-size: 12px;
    }

    .table th,
    .table td {
        padding: 8px 6px;
        font-size: 12px;
    }

    /* Компактные действия в таблицах */
    .table td[style*="display: flex"] {
        flex-direction: column !important;
        gap: 6px !important;
    }

    /* Модальные окна */
    .modal-content,
    .modal-content-large {
        width: 95%;
        max-width: 95%;
        padding: 15px;
        max-height: 90vh;
    }

    .modal-header {
        font-size: 18px;
    }

    /* Формы */
    .form-input,
    .form-textarea,
    .form-select {
        font-size: 16px; /* Важно для iOS чтобы не зумило */
        padding: 12px;
    }

    .form-label {
        font-size: 13px;
    }

    .form-textarea {
        min-height: 120px;
    }

    /* Чекбоксы и лейблы */
    .form-label[style*="cursor: pointer"] {
        font-size: 14px;
    }

    /* Фильтры в таблицах */
    .filter-input {
        font-size: 12px;
        padding: 8px;
    }

    /* Статистика - карточки в столбец */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* Адаптация общей статистики */
    #allSessionsTable {
        min-width: 900px; /* Меньше для мобильных */
        font-size: 11px;
    }

    #allSessionsTable th,
    #allSessionsTable td {
        padding: 6px 4px;
        font-size: 11px;
    }

    /* Логин форма */
    .login-card {
        padding: 25px;
        max-width: 95%;
    }

    .login-title {
        font-size: 20px;
    }

    /* Кнопки-иконки уже настроены глобально */
}

/* Очень маленькие экраны (до 480px) */
@media (max-width: 480px) {
    .navbar-title {
        font-size: 14px;
    }

    .card-header {
        font-size: 16px;
    }

    h2 {
        font-size: 18px;
    }

    h3 {
        font-size: 15px;
    }

    .btn {
        padding: 14px 18px;
        font-size: 15px;
    }

    .btn-small {
        padding: 12px 16px;
        font-size: 14px;
        width: 100%;
    }

    .table {
        font-size: 11px;
    }

    .table th,
    .table td {
        padding: 6px 4px;
    }

    /* Модальные окна на весь экран */
    .modal-content,
    .modal-content-large {
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        padding: 12px;
    }

    /* Формы */
    .form-input,
    .form-textarea {
        font-size: 16px;
    }

    /* Логин */
    .login-card {
        padding: 20px;
    }

    /* Компактные элементы списка */
    .list-item-title {
        font-size: 15px;
    }

    .list-item-meta {
        font-size: 11px;
    }

    /* Общая статистика еще компактнее */
    #allSessionsTable {
        font-size: 10px;
    }

    #allSessionsTable th,
    #allSessionsTable td {
        padding: 4px 2px;
        font-size: 10px;
    }
}

/* Улучшения для тач-устройств */
@media (hover: none) and (pointer: coarse) {
    /* Увеличиваем области нажатия */
    .btn {
        min-height: 44px; /* Рекомендация Apple для тач-целей */
    }

    .btn-small {
        min-height: 38px;
    }

    /* Убираем hover эффекты на тач-устройствах */
    .list-item:hover {
        background-color: var(--bg-primary);
    }

    /* Лучше видимые активные состояния */
    .btn:active {
        transform: scale(0.98);
        opacity: 0.9;
    }

    /* Тумблеры крупнее */
    .toggle-switch {
        width: 60px;
        height: 32px;
    }

    .toggle-slider:before {
        height: 24px;
        width: 24px;
    }

    .toggle-switch input:checked + .toggle-slider:before {
        transform: translateX(28px);
    }
}

/* Анимация пульсации для индикатора записи */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

/* Стили для перетаскивания столбцов */
.column-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 8px;
    background: var(--bg-secondary);
    border: 2px solid var(--bg-primary);
    border-radius: 6px;
    cursor: move;
    transition: all 0.2s ease;
}

.column-item:hover {
    background: var(--bg-primary);
    border-color: var(--button-primary);
}

.column-item.dragging {
    opacity: 0.5;
    transform: scale(0.98);
}

.column-item.drag-over {
    border-color: var(--button-primary);
    background: var(--background-modifier-accent);
    transform: translateY(-2px);
}

.drag-handle {
    font-size: 18px;
    color: var(--text-muted);
    cursor: grab;
    user-select: none;
}

.drag-handle:active {
    cursor: grabbing;
}

.column-label {
    flex: 1;
    color: var(--text-normal);
    font-weight: 500;
    user-select: none;
}

/* Drag and Drop стили для вопросов */
.question-item,
.video-question-item {
    cursor: move !important;
}

.question-item:active,
.video-question-item:active {
    cursor: grabbing !important;
}

/* Разрешаем взаимодействие с кнопками внутри перетаскиваемых элементов */
.question-item button,
.video-question-item button,
.question-item input[type="checkbox"],
.video-question-item input[type="checkbox"] {
    pointer-events: auto;
    cursor: pointer !important;
}

/* ===================================
   Стили для страницы анализа ответов
   =================================== */

/* Контейнер для прогресс-бара */
.progress-bar-container {
    width: 100%;
    background-color: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

/* Информационный текст */
.info-text {
    color: var(--text-muted);
    font-size: 14px;
}

/* Скрытые секции */
.hidden {
    display: none !important;
}

/* Таблица результатов */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.table thead {
    background-color: var(--bg-secondary);
}

.table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
}

.table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.table tbody tr:hover {
    background-color: var(--bg-secondary);
}

/* ==========================================
   MARKDOWN CONTENT STYLES
   ========================================== */

.markdown-content {
    line-height: 1.8;
    color: var(--text-normal);
    font-size: 15px;
}

/* Заголовки в Markdown */
.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    margin-top: 24px;
    margin-bottom: 16px;
    font-weight: 600;
    line-height: 1.25;
    color: var(--interactive-active);
}

.markdown-content h1 {
    font-size: 2em;
    border-bottom: 2px solid var(--interactive-muted);
    padding-bottom: 0.3em;
}

.markdown-content h2 {
    font-size: 1.5em;
    border-bottom: 1px solid var(--interactive-muted);
    padding-bottom: 0.3em;
}

.markdown-content h3 {
    font-size: 1.25em;
}

.markdown-content h4 {
    font-size: 1em;
}

.markdown-content h5 {
    font-size: 0.875em;
}

.markdown-content h6 {
    font-size: 0.85em;
    color: var(--text-muted);
}

/* Первый заголовок без верхнего отступа */
.markdown-content h1:first-child,
.markdown-content h2:first-child,
.markdown-content h3:first-child {
    margin-top: 0;
}

/* Абзацы */
.markdown-content p {
    margin-bottom: 16px;
    line-height: 1.8;
}

.markdown-content p:last-child {
    margin-bottom: 0;
}

/* Списки */
.markdown-content ul,
.markdown-content ol {
    margin-bottom: 16px;
    padding-left: 2em;
}

.markdown-content li {
    margin-bottom: 8px;
    line-height: 1.8;
}

.markdown-content li > p {
    margin-bottom: 8px;
}

/* Вложенные списки */
.markdown-content ul ul,
.markdown-content ul ol,
.markdown-content ol ol,
.markdown-content ol ul {
    margin-top: 8px;
    margin-bottom: 8px;
}

/* Стиль маркеров */
.markdown-content ul {
    list-style-type: disc;
}

.markdown-content ul ul {
    list-style-type: circle;
}

.markdown-content ul ul ul {
    list-style-type: square;
}

/* Жирный и курсив */
.markdown-content strong {
    font-weight: 600;
    color: var(--interactive-active);
}

.markdown-content em {
    font-style: italic;
    color: var(--text-link);
}

.markdown-content strong em,
.markdown-content em strong {
    font-weight: 600;
    font-style: italic;
}

/* Цитаты */
.markdown-content blockquote {
    margin: 16px 0;
    padding: 0 1em;
    color: var(--text-muted);
    border-left: 4px solid var(--text-link);
    background-color: var(--bg-tertiary);
    border-radius: 0 4px 4px 0;
}

.markdown-content blockquote > :first-child {
    margin-top: 0;
}

.markdown-content blockquote > :last-child {
    margin-bottom: 0;
}

/* Код */
.markdown-content code {
    padding: 0.2em 0.4em;
    margin: 0;
    font-size: 85%;
    background-color: var(--bg-tertiary);
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    color: #f0f6fc;
}

.markdown-content pre {
    padding: 16px;
    overflow: auto;
    font-size: 85%;
    line-height: 1.45;
    background-color: var(--bg-floating);
    border-radius: 6px;
    margin-bottom: 16px;
    border: 1px solid var(--interactive-muted);
}

.markdown-content pre code {
    display: inline;
    max-width: auto;
    padding: 0;
    margin: 0;
    overflow: visible;
    line-height: inherit;
    background-color: transparent;
    border: 0;
}

/* Горизонтальная линия */
.markdown-content hr {
    height: 2px;
    padding: 0;
    margin: 24px 0;
    background-color: var(--interactive-muted);
    border: 0;
}

/* Ссылки */
.markdown-content a {
    color: var(--text-link);
    text-decoration: none;
    transition: color 0.2s;
}

.markdown-content a:hover {
    text-decoration: underline;
}

/* Таблицы в Markdown */
.markdown-content table {
    border-spacing: 0;
    border-collapse: collapse;
    margin-bottom: 16px;
    width: 100%;
}

.markdown-content table th {
    padding: 8px 13px;
    border: 1px solid var(--interactive-muted);
    background-color: var(--bg-secondary);
    font-weight: 600;
}

.markdown-content table td {
    padding: 8px 13px;
    border: 1px solid var(--interactive-muted);
}

.markdown-content table tr:nth-child(2n) {
    background-color: var(--bg-secondary);
}

/* Изображения */
.markdown-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 16px 0;
}

/* Чекбоксы в списках задач */
.markdown-content input[type="checkbox"] {
    margin-right: 8px;
}

/* Контейнер с итоговым ответом - специальные стили */
#summaryText.markdown-content {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--interactive-muted);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Анимация появления */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.markdown-content {
    animation: fadeIn 0.3s ease-out;
}

/* Кастомный dropdown для автозаполнения */
.custom-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 300px;
    overflow-y: auto;
    background: var(--bg-secondary);
    border: 1px solid var(--interactive-muted);
    border-radius: 4px;
    margin-top: 4px;
    z-index: 1000;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

.custom-dropdown-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--bg-tertiary);
    transition: background-color 0.15s ease;
    color: var(--text-normal);
    font-size: 14px;
}

.custom-dropdown-item:last-child {
    border-bottom: none;
}

.custom-dropdown-item:hover {
    background-color: var(--background-modifier-hover);
}

.custom-dropdown-item:active {
    background-color: var(--background-modifier-active);
}

.custom-dropdown-empty {
    padding: 10px 12px;
    color: var(--text-muted);
    font-size: 14px;
    text-align: center;
}

/* Скроллбар для dropdown */
.custom-dropdown::-webkit-scrollbar {
    width: 8px;
}

.custom-dropdown::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

.custom-dropdown::-webkit-scrollbar-thumb {
    background: var(--interactive-muted);
    border-radius: 4px;
}

.custom-dropdown::-webkit-scrollbar-thumb:hover {
    background: var(--interactive-normal);
}
