/* Стили для реферата */
.reference-content {
    background: rgba(250, 244, 240, 0.9);
    padding: 30px;
    border-radius: 8px;
    border: 1px solid #d7ccc8;
    line-height: 1.8;
    text-align: justify;
}

.reference-content h2 {
    color: var(--primary-color);
    font-size: 1.4em;
    margin: 20px 0 10px 0;
    border-bottom: 1px solid var(--secondary-color);
    padding-bottom: 8px;
    padding-left: 1em;

}

.reference-content h3 {
    color: var(--accent-color);
    font-size: 1.2em;
    margin: 25px 0 12px 0;
}

.reference-content p {
    margin-bottom: 16px;
    text-indent: 1.5em;
}

.reference-content ul, .reference-content ol {
    margin: 15px 0;
    padding-left: 2em;
}

.reference-content li {
    margin-bottom: 8px;
}

/* Содержание */
.table-of-contents {
    background: rgba(141, 110, 99, 0.1);
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 30px;
    border-left: 3px solid var(--secondary-color);
}

.table-of-contents h2 {
    color: var(--primary-color);
    margin-bottom: 15px;
    text-align: center;
}

.toc-list {
    list-style-type: none;
    padding: 0;
}

.toc-list li {
    margin: 8px 0;
    padding: 5px 0;
    border-bottom: 1px dashed #bcaaa4;
}

.toc-list a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.3s;
}

.toc-list a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Ссылки на литературу */
.literature-ref {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
    padding: 2px 4px;
    border-radius: 3px;
    transition: background-color 0.3s;
}

.literature-ref:hover {

    text-decoration: none;
}

/* Список литературы */
.bibliography {
    margin-top: 5px !important;
    padding-top: 0 !important;
}
.bibliography h2 {
    color: var(--primary-color);
    margin-bottom: 10px !important;
    font-size: 1.4em;
    font-weight: bold;
    margin-top: 0 !important;
}

.bibliography-list {
    list-style-type: decimal;
    padding-left: 2em;
    margin: 0;
}

.bibliography-list li {
    margin-bottom: 15px;
    padding: 8px 0;
    background: transparent;
    border-left: none;
    border-radius: 0;
    line-height: 1.6;
    text-align: justify;
}

.bibliography-list a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.3s;
}

.bibliography-list a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Стили для ссылок в литературе */
.bibliography .academic-link {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.3s;
    font-weight: 500;
    border-bottom: 1px dotted rgba(141, 110, 99, 0.3);
}

.bibliography .academic-link:hover {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px solid var(--primary-color);
}

/* Убираем кастомную нумерацию */
.bibliography-list {
    counter-reset: none;
}

.bibliography-list li::before {
    content: none;
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .bibliography-list {
        padding-left: 1.5em;
    }
    
    .bibliography-list li {
        padding: 6px 0;
        margin-bottom: 12px;
    }
}


/* Нумерация страниц для печати */
@media print {
    .reference-content {
        text-align: justify;
    }
    
    .table-of-contents, .bibliography {
        page-break-inside: avoid;
    }
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .reference-content {
        padding: 20px 15px;
    }
    
    .table-of-contents {
        padding: 15px;
    }
}