/* Специфичные стили для научных статей */
.article-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px 0;
}

.article-content {
    background: rgba(255, 255, 255, 255);
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    font-family: 'Times New Roman', Times, serif;
    line-height: 1.5;
    text-align: justify;
    color: #000000;
}

/* Скрывает EN только на страницах статей */
/* .top-block .lang-box {
    visibility: hidden;
} */


/* Стили для кнопки назад */
.article-back-box {
    display: flex;
    align-items: center;
    gap: 20px;
}

.article-back-link {
    color: #ffffff;
    text-decoration: none;
    margin-left: 0;
    font-weight: 600;
    transition: all 0.3s ease;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    padding: 8px 15px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    display: inline-block;
}

.article-back-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Выравнивание университетских ссылок */
.university-links {
    display: flex;
    align-items: center;
    gap: 25px; /* Заменяем margin-left на gap */
}

.university-links a {
    margin-left: 0; /* Убираем старый margin */
}

/* Уменьшаем высоту top-block только на страницах статей */
.top-block {
    padding: 12px 20px !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.udk {
    text-align: left;
    font-weight: bold;
    margin-bottom: 10px;
    color: #000000;
    font-size: 14px;
}

.article-header {
    text-align: center;
}

.article-title {
    font-size: 14px;
    font-weight: 700;
    margin: 10px 0;
    line-height: 1.4;
    color: #000000;
    text-transform: uppercase;
}

.authors {
    text-align: center;
    margin: 15px 0;
    font-weight: 600;
    color: #000000;
    font-size: 14px;
}

.university {
    text-align: center;
    font-style: normal;
    margin-bottom: 10px;
    color: #000000;
    font-size: 14px;
}

.contact {
    text-align: center;
    margin-bottom: 10px;
    color: #000000;
    font-size: 14px;
    line-height: 1.8;
}

.contact br {
    display: block;
    margin-bottom: 5px;
}

.abstract {
    margin: 10px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 5px;
    border-left: 3px solid #000;
    text-align: justify;
}

.abstract p {
    margin-bottom: 10px;
    font-style: italic;
}

.keywords {
    margin: 10px 0;
    color: #000000;
    font-style: normal;
}

.section {
    margin: 10px 0;
    text-align: justify;
}

.section-title {
    font-weight: 700;
    margin-bottom: 15px;
    font-size: 14px;
    color: #000000;
    text-align: left;
    text-transform: none;
    border-bottom: none;
    padding-bottom: 0;

    text-indent: 1.5em;
}

.section-title-center{
    font-weight: 700;
    margin-bottom: 15px;
    font-size: 17px;
    color: #000000;
    text-align: center;
    text-transform: none;
    border-bottom: none;
    padding-bottom: 0;

    text-indent: 1.5em;
}

.section p {
    margin-bottom: 12px;
    text-indent: 1.5em;
    text-align: justify;
    color: #000000;
}

.figure {
    text-align: center;
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
    border: 1px solid #ddd;
}

.figure img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.figure-caption {
    font-style: italic;
    margin-top: 10px;
    color: #000000;
    font-size: 12px;
    text-align: center;
}

.references {
    margin-top: 10px;
}

.references .section-title {
    text-align: center;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 20px;
    text-indent: 0;
}

.reference-list {
    text-align: justify;
}

.reference-item {
    margin-bottom: 10px;
    color: #000000;
    line-height: 1.4;
    font-size: 14px;
    text-align: justify;
    text-indent: 1.5em;
}



/* Списки для статей */
.article-content ul,
.article-content ol {
    margin: 12px 0;
    padding-left: 15px;
    text-align: justify;
    color: #000000;
    
}

.article-content li {
    margin-bottom: 6px;
    line-height: 1.4;
    text-align: justify;
    color: #000000;
}

/* Особые стили для жирного текста */
.article-content strong {
    font-weight: 700;
    color: #000000;
}

/* Стили для курсивного текста в литературе */
.reference-item i {
    font-style: italic;
    color: #000000;
}

/* Стили для верхних индексов (надстрочные цифры) */
.article-content sup {
    font-size: 0.7em;
    vertical-align: super;
    line-height: 0;
    color: #000000;
}

/* Стили для математических формул */
.math-formula {
    text-align: center !important;
    margin: 20px 0;
    padding: 15px;
}

.math-formula p {
    margin: 0 !important;
    text-indent: 0 !important;
    font-family: 'Times New Roman', Times, serif;
    font-size: 16px;
    font-style: italic;
    text-align: center !important;
}

/* Стили для отдельных математических выражений в тексте */
.math-inline {
    font-style: italic;
    font-family: 'Times New Roman', Times, serif;
}

/* Стили для блоков с кодом */
.code-block {
    text-align: left;
    margin: 20px 0;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.4;
    color: #333;
    overflow-x: auto;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.code-block pre {
    margin: 0;
    padding: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.code-caption {
    font-style: italic;
    margin-top: 8px;
    color: #666;
    font-size: 12px;
    text-align: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Стили для таблиц */
.table-container {
    margin: 20px 0;
    text-align: center;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

.table th {
    background: #ffffff;
    color: rgb(0, 0, 0);
    font-weight: 600;
    padding: 12px 8px;
    text-align: center;
    border: 1px solid #9e9e9e;
}

.table td {
    padding: 10px 8px;
    text-align: center;
    border: 1px solid #e0e0e0;
    background: white;
}

.table tr:nth-child(even) td {
    background: #f8f9fa;
}

.table tr:hover td {
    background: #f1f3f4;
}

.table-caption {
    font-style: italic;
    margin-top: 8px;
    color: #666;
    font-size: 12px;
    text-align: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Мобильная адаптация для статей */
@media (max-width: 768px) {
    .article-container {
        padding: 10px 0;
        max-width: 100%;
    }
    
    .article-content {
        padding: 20px 15px;
        border-radius: 10px;
        margin: 0 10px;
    }
    
    .article-title {
        font-size: 13px;
        line-height: 1.3;
    }

     .top-block {
        padding: 10px 15px !important;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .article-back-box, .university-links {
        width: 100%;
        justify-content: center;
    }
    
    .university-links {
        gap: 15px;
    }
    
    .article-back-link, .university-links a {
        padding: 6px 12px;
        font-size: 14px;
    }
    
    .authors, .university, .contact {
        font-size: 13px;
    }
    
    .abstract {
        padding: 15px;
        margin: 15px 0;
    }
    
    .section-title, .section-title-center {
        font-size: 13px;
        text-indent: 1em;
    }
    
    .section p {
        font-size: 13px;
        text-indent: 1em;
        line-height: 1.4;
    }
    
    .reference-item {
        font-size: 12px;
        text-indent: 1em;
    }
    
    .figure {
        margin: 15px 0;
        padding: 10px;
    }
    
    .article-back-link {
        width: 100%;
        margin: 15px auto;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .article-content {
        padding: 15px 10px;
        margin: 0 5px;
    }
    
    .article-title {
        font-size: 12px;
    }
    
    .authors, .university, .contact {
        font-size: 12px;
    }
    
    .section p {
        font-size: 12px;
        text-indent: 0.8em;
    }

    .university-links {
        gap: 10px;
    }
    
    .article-back-link, .university-links a {
        padding: 5px 10px;
        font-size: 13px;
    }
}

/* Стили для кнопки цитирования */
.citation-btn {
    padding: 10px 18px;
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    cursor: pointer;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 15px;
    min-height: 40px;
    display: inline-block;
    line-height: 1.4;
    white-space: nowrap; /* Запрещаем перенос текста */
}

.citation-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Модальное окно цитирования */
.citation-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.citation-modal-content {
    background-color: white;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s;
    overflow: hidden;
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.citation-modal-header {
    padding: 20px;
    background: #667eea;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.citation-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.citation-close {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 5px;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.citation-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.citation-modal-body {
    padding: 25px;
}

.citation-text {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
    text-align: justify;
    font-family: 'Times New Roman', Times, serif;
    color: #333;
}

.citation-actions {
    display: flex;
    justify-content: flex-end;
}

.citation-copy-btn {
    padding: 10px 25px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.citation-copy-btn:hover {
    background: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Адаптация для мобильных */
@media (max-width: 768px) {

    .article-back-box {
        gap: 10px; /* Уменьшаем отступ на мобильных */
    }
    .article-back-link, .citation-btn {
        padding: 6px 12px;
        font-size: 13px;
    }

    /* Для мобильных делаем кнопки более компактными */
    .article-back-box {
        flex-wrap: wrap;
        justify-content: center;
    }

    .citation-btn {
        margin-left: 10px;
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .citation-modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .citation-modal-header h3 {
        font-size: 16px;
    }
    
    .citation-text {
        font-size: 13px;
        padding: 15px;
    }
    
    .citation-copy-btn {
        padding: 8px 20px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {

    .article-back-link, .citation-btn {
        padding: 5px 10px;
        font-size: 12px;
    }
    
    .article-back-box {
        gap: 8px;
    }
    .citation-btn {
        padding: 5px 10px;
        font-size: 12px;
    }
    
    .citation-modal-body {
        padding: 15px;
    }
    
    .citation-modal-header {
        padding: 15px;
    }
}