/* Стиль для активной ссылки в навигации */
.navbar-nav .nav-link.active {
    font-weight: bold;
    color: #0d6efd !important;
}

/* Небольшие отступы для аккордеона */
.accordion-item {
    margin-bottom: 1rem;
    border: 1px solid rgba(0, 0, 0, .125);
}

/* Стиль для подзаголовков внутри разделов */
.subsection-title {
    color: #555;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

footer a {
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Стили для отдельной кнопки открытия панели доступности */
.accessibility-fixed-button {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    background: #0056b3;
    color: white;
    border: none;
    border-radius: 5px 0 0 5px;
    padding: 12px 10px;
    cursor: pointer;
    font-weight: bold;
    z-index: 9998;
    transition: transform 0.3s ease;
    box-shadow: -2px 2px 10px rgba(0, 0, 0, 0.2);
}

.accessibility-fixed-button:hover {
    background: #004494;
}

.accessibility-fixed-button i {
    font-size: 1.3em;
}

/* Стили для панели доступности */
.accessibility-panel {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px 0 0 10px;
    box-shadow: -3px 3px 15px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    width: 300px;
    max-height: 90vh;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.accessibility-panel.hidden {
    transform: translateX(100%) translateY(-50%);
}

/* Когда панель открыта, кнопка сдвигается вместе с ней */
.accessibility-panel:not(.hidden)+.accessibility-fixed-button {
    transform: translateX(-300px) translateY(-50%);
}

.accessibility-content {
    padding: 20px;
}

.accessibility-option {
    margin-bottom: 15px;
}

.accessibility-btn {
    width: 100%;
    margin-bottom: 8px;
}

/* Стили для режимов доступности */
body.high-contrast {
    background-color: #000 !important;
    color: #fff !important;
}

body.high-contrast * {
    background-color: #000 !important;
    color: #fff !important;
    border-color: #fff !important;
}

body.high-contrast a {
    color: #ffff00 !important;
    text-decoration: underline !important;
}

body.high-contrast .accordion-button {
    background-color: #333 !important;
    color: #fff !important;
}

body.high-contrast .alert {
    background-color: #222 !important;
    border-color: #fff !important;
}

/* Три разных уровня увеличения текста */
body.font-size-medium {
    font-size: 1.3em !important;
    /* A+: увеличение на 30% */
    line-height: 1.5 !important;
}

body.font-size-medium * {
    font-size: inherit !important;
    line-height: inherit !important;
}

body.font-size-large {
    font-size: 1.6em !important;
    /* A++: увеличение на 60% */
    line-height: 1.7 !important;
}

body.font-size-large * {
    font-size: inherit !important;
    line-height: inherit !important;
}

/* Очень большой текст - дополнительный уровень */
body.font-size-xlarge {
    font-size: 2.0em !important;
    /* A+++: увеличение на 100% */
    line-height: 1.8 !important;
}

body.font-size-xlarge * {
    font-size: inherit !important;
    line-height: inherit !important;
}

body.dyslexia-font {
    font-family: "Comic Sans MS", "Segoe UI", Arial, sans-serif !important;
    letter-spacing: 0.05em !important;
}

body.grayscale {
    filter: grayscale(100%) !important;
}

/* Стили для демонстрации размера текста на кнопках */
.font-size-btn-small {
    font-size: 14px;
}

.font-size-btn-medium {
    font-size: 18px;
}

.font-size-btn-large {
    font-size: 22px;
}

.font-size-btn-xlarge {
    font-size: 26px;
}

body:focus,
html:focus {
    outline: none !important;
}

.high-contrast *:focus {
    outline: 3px solid yellow !important;
    outline-offset: 2px !important;
}

.high-contrast [aria-current="page"],
.high-contrast .active {
    outline: 3px solid yellow !important;
    outline-offset: 2px !important;
}

/* Стили для скрытых элементов */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.visually-hidden-focusable:not(:focus):not(:focus-within) {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Стили для увеличения интерфейса */
body.interface-medium {
    zoom: 1.2;
}

body.interface-large {
    zoom: 1.5;
}

/* Стили для уведомлений */
.accessibility-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    min-width: 300px;
    max-width: 500px;
}

/* Бейдж для активных настроек */
.accessibility-badge {
    font-size: 0.6em;
    padding: 0.25em 0.4em;
}

/* Стили для печати */
@media print {

    .accessibility-panel,
    .accessibility-fixed-button,
    .skip-link {
        display: none !important;
    }

    .high-contrast * {
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}

/* Анимации с учетом настроек */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Стили для режима уменьшенного движения */
.reduced-motion * {
    animation: none !important;
    transition: none !important;
}

/* Улучшенные стили для высокого контраста в печати */
@media print and (prefers-contrast: high) {
    body {
        background: white !important;
        color: black !important;
    }

    * {
        background: white !important;
        color: black !important;
        border-color: black !important;
    }
}

/* Стили для мобильных устройств */
@media (max-width: 768px) {
    .accessibility-panel {
        width: 90%;
        max-width: 300px;
        right: 0;
        top: 10px;
        transform: none;
        max-height: 80vh;
    }

    .accessibility-panel.hidden {
        transform: translateX(100%);
        top: 10px;
    }

    .accessibility-fixed-button {
        right: 0;
        padding: 10px 8px;
    }

    /* На мобильных корректируем сдвиг кнопки */
    .accessibility-panel:not(.hidden)+.accessibility-fixed-button {
        transform: translateX(-90%) translateY(-50%);
    }
}

/* Исправление прокрутки для панели */
.accessibility-panel::-webkit-scrollbar {
    width: 8px;
}

.accessibility-panel::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.accessibility-panel::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.accessibility-panel::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Стили для всех режимов цвета */
.high-contrast .accessibility-panel::-webkit-scrollbar-track {
    background: #222 !important;
}

.high-contrast .accessibility-panel::-webkit-scrollbar-thumb {
    background: #ffff00 !important;
}

.grayscale .accessibility-panel::-webkit-scrollbar-track {
    background: #888 !important;
}

.grayscale .accessibility-panel::-webkit-scrollbar-thumb {
    background: #333 !important;
}

/* Анимация загрузки */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.content-fade-in {
    animation: fadeIn 0.3s ease-in;
}

/* НОВЫЕ СТИЛИ: Для фиксирования подвала внизу */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1 0 auto;
    /* flex-grow: 1, flex-shrink: 0, flex-basis: auto */
}

footer {
    flex-shrink: 0;
}

/* Дополнительный контейнер для контента */
#content-container {
    min-height: 400px; /* Минимальная высота основного контента */
}

/* Стили для фотографии преподавателя - КРУГЛАЯ ОБРЕЗКА */
.teacher-photo-container {
    padding-top: 15px;
}

.teacher-photo-frame {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border: 5px solid white;
    overflow: hidden; /* ОБРЕЗАЕМ ВСЁ, ЧТО ВЫХОДИТ ЗА ПРЕДЕЛЫ КРУГА */
}

.teacher-photo {
    width: 100%;
    height: 100%;
    object-fit: cover; /* ЗАПОЛНЯЕМ КРУГ, ОБРЕЗАЯ ИЗОБРАЖЕНИЕ ПРИ НЕОБХОДИМОСТИ */
    object-position: center center; /* ЦЕНТРИРУЕМ ИЗОБРАЖЕНИЕ */
}

/* Адаптивность для фотографии */
@media (max-width: 768px) {
    .teacher-photo-frame {
        width: 150px;
        height: 150px;
    }
}

@media (max-width: 576px) {
    .teacher-photo-frame {
        width: 130px;
        height: 130px;
    }
}

/* Дополнительные стили для документов */
.document-list .card {
    transition: all 0.3s ease;
    border-left: 4px solid #0d6efd;
}

.document-list .card:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1) !important;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Стили для teacher-info */
.teacher-info p,
.education-info p,
.qualification-info p {
    line-height: 1.6;
}

/* Общие стили для карточек */
.card {
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.text-primary {
    color: #0d6efd !important;
}

a.text-decoration-none:hover {
    text-decoration: underline !important;
}

.btn-outline-primary:hover {
    background-color: #0d6efd;
    color: white;
}