/* Основные стили для анализа контрактов, совместимые с Bootstrap 5 */

/* Основные контейнеры и разметка */
html, body {
    height: 100%;
    overflow-x: hidden;
}

/* Стили для левой и правой панели */
/*ВАЖНО! из-за этого может перестать работать страница контракта*/
/* .content-container {
    height: calc(100vh - 56px); 
    overflow: hidden;
} */

.fixed-height-content {
    height: calc(100vh - 56px); /* 56px - это стандартная высота навбара Bootstrap */
    overflow: hidden;
}

.panel {
    height: 100%;
    overflow: hidden;
}

.panel-content {
    height: 100%;
    overflow-y: auto;
    position: relative;
}

/* Секции в левой панели */
.panel-section {
    display: flex;
    flex-direction: column;
    height: 50%;
}

.questions-section {
    border-bottom: 1px solid #dee2e6;
}

.section-header {
    flex-shrink: 0;
    background-color: #e9ecef !important;
    color: #1a1a1a;
    border-bottom: 1px solid #dee2e6;
}

.questions-content, .theses-content {
    flex-grow: 1;
    overflow-y: auto;
}

/* Узкий столбец с иконками */
.icons-column {
    width: 40px !important;
    padding: 0;
    background-color: #f8f9fa;
    border-left: 1px solid #dee2e6;
    border-right: 1px solid #dee2e6;
    display: flex;
    flex-direction: column;
}

.icons-section {
    height: 50%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.questions-icons {
    border-bottom: 1px solid #dee2e6;
    justify-content: center;
}

.theses-icons {
    justify-content: center;
}

.icons-container {
    position: relative;
    padding: 10px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.icon-wrapper {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 3px 0;
}

.icon-wrapper:hover {
    background-color: #e9ecef;
    transform: scale(1.1);
}

.icon-arrow {
    position: absolute;
    color: #6c757d;
    font-size: 0.9rem;
}

.left-arrow {
    left: 2px;
    top: 50%;
    transform: translateY(-50%);
}

.icon-questions {
    color: #4281c9;
}

.icon-theses {
    color: #495057;
}

/* Компоненты навигации */
.nav-tabs .nav-link {
    cursor: pointer;
}

/* Стили для списков вопросов и тезисов */
.question-item, .thesis-item {
    cursor: pointer;
    transition: background-color 0.2s ease, border-left 0.2s ease, color 0.2s ease;
}

.question-item:hover, .thesis-item:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

/* Стиль для активного вопроса/тезиса (Вариант 5) */
.question-item.active, .thesis-item.active {
    background-color: #e9ecef;
    color: #1a1a1a;
    border-left: 3px solid #495057;
}

.question-item .question-type,
.thesis-item .question-type {
    font-size: 0.8rem;
    color: #6c757d;
}

/* Стили для документа */
.document-container {
    position: relative;
    height: 100%;
    overflow-y: auto;
}

/* Стиль для закрепленного заголовка (Вариант 5) */
.sticky-header {
    position: sticky;
    top: 0;
    background-color: #efefef;
    padding: 0.5rem;
    border-bottom: 1px solid #dddddd;
    z-index: 100;
    font-weight: 500;
    color: #222222;
}

.document-line {
    padding: 0.25rem 0.5rem;
    margin: 1px 0;
    border-radius: 0.2rem;
    transition: background-color 0.2s ease, border-left 0.2s ease;
}

/* Стиль для раздела документа (Вариант 5) */
.document-line.new-section {
    background-color: #f8f9fa;
    border-left: 3px solid #343a40;
}

/* Стиль для выделенных строк документа (Вариант 5) */
.document-line.highlight {
    background-color: #e4edf7;
    border-left: 3px solid #4281c9;
}

/* Зарезервированные цвета из Варианта 5 */
.color-important {
    color: #d42e2e; /* Красный - для важных элементов */
}

/* Стили для ссылок между пунктами */
.document-link {
    color: #0066cc;
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.2s ease;
}

.document-link:hover {
    color: #004499;
    text-decoration: underline;
}

/* Базовые стили для проблемных ссылок */
.missing-link, .alert-link {
    color: #f44336;
    background-color: #ffebee;
    padding: 1px 3px;
    border-radius: 3px;
    text-decoration: underline;
    text-decoration-style: wavy;
}

.missing-link:hover, .alert-link:hover {
    background-color: #ffcdd2;
}

/* Специфичные стили для missing ссылок */
.missing-link {
    cursor: help;
    font-weight: bold;
}

/* Специфичные стили для alert ссылок */
.alert-link {
    cursor: pointer;
    font-weight: normal;
}

/* Tooltip для отсутствующих ссылок */
.missing-link-tooltip {
    position: absolute;
    background-color: #f44336;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    white-space: nowrap;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.missing-link-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border: 5px solid transparent;
    border-top-color: #f44336;
}

.missing-link-tooltip.visible {
    opacity: 1;
    visibility: visible;
}

/* Кнопка возврата */
.back-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.back-button.visible {
    opacity: 1;
    visibility: visible;
}

/* Подсветка целевого элемента при навигации */
.document-line.highlight-link-target {
    background-color: #fff3cd;
    border-left: 3px solid #ffc107;
    animation: highlightPulse 2s ease-in-out;
}

@keyframes highlightPulse {
    0% { 
        background-color: #fff3cd;
        transform: scale(1);
    }
    50% { 
        background-color: #ffeeba;
        transform: scale(1.02);
    }
    100% { 
        background-color: #fff3cd;
        transform: scale(1);
    }
}

.color-success {
    color: #28a745; /* Зеленый - для успешных элементов */
}

.color-attention {
    color: #ffa200; /* Оранжевый - для элементов, требующих внимания */
}

.bg-important {
    background-color: #f8d7da; /* Фон для важных элементов */
}

.bg-success {
    background-color: #d4edda; /* Фон для успешных элементов */
}

.bg-attention {
    background-color: #fff3cd; /* Фон для элементов, требующих внимания */
}

/* Адаптивный дизайн */
@media (max-width: 992px) {
    .fixed-height-content {
        height: auto;
    }
    
    .panel {
        height: auto;
    }
    
    .panel-section {
        height: auto;
        max-height: 40vh;
    }
    
    .icons-column {
        display: none !important;
    }
}

.document-line.highlight-thesis {
    background-color: #e4edf7;
    border-left: 3px solid #4281c9;
}

.document-line.highlight-thesis-active {
    background-color: #ffe6b3;
    border-left: 3px solid #ffa200;
}

.thesis-item.text-muted {
    background-color: #ffe6ef !important;
    color: #d42e2e !important;
}

.question-item.no-theses {
    position: relative;
    padding-left: 2.2em;
}
.question-item.no-theses::before {
    content: '\f071';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: #d42e2e;
    position: absolute;
    left: 0.7em;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1em;
}

.sticky-bottom {
    left: 0;
    right: 0;
    width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}
.panel-section, .panel-content {
    overflow-x: hidden;
} 