/* ============================================
   ФАЙЛ: accessibility.css
   ПОЛНАЯ ВЕРСИЯ СО ВСЕМИ СТИЛЯМИ ДЛЯ ВСЕХ СТРАНИЦ
   ============================================ */

/* ===== КНОПКИ УПРАВЛЕНИЯ ===== */
.accessibility-controls {
    position: fixed;
    top: 40px;
    right: 20px;
    z-index: 9999 !important;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Кнопки - увеличенные, без рамки, адаптивные */
.accessibility-btn {
    width: 8vw;
    height: 6vw;
    min-width: 45px;
    max-width: 100px;
    min-height: 45px;
    max-height: 80px;
    border: none !important;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: transparent;
    padding: 0;
    outline: none;
    background-size: 100% 100% !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

.accessibility-btn:focus {
    outline: none;
}

.accessibility-btn::-moz-focus-inner {
    border: 0;
}

/* Кнопка поиска */
.search-btn {
    background-image: url('/images/search-button.png') !important;
}

/* Кнопка версии для слабовидящих */
.vision-btn {
    background-image: url('/images/vision-icon.png') !important;
}

.accessibility-btn:hover {
    transform: scale(1.1);
}

.accessibility-btn:active {
    transform: scale(0.95);
}

.vision-btn.active {
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

/* ===== АДАПТИВНОСТЬ КНОПОК ===== */
@media (max-width: 1024px) {
    .accessibility-btn {
        width: 5vw;
        height: 5vw;
        min-width: 40px;
        max-width: 60px;
        min-height: 40px;
        max-height: 60px;
    }
}

@media (max-width: 768px) {
    .accessibility-controls {
        top: 10px;
        right: 10px;
        gap: 8px;
    }
    
    .accessibility-btn {
        width: 6vw;
        height: 6vw;
        min-width: 35px;
        max-width: 50px;
        min-height: 35px;
        max-height: 50px;
        border-radius: 10px;
    }
}

@media (max-width: 480px) {
    .accessibility-controls {
        top: 5px;
        right: 5px;
        gap: 5px;
    }
    
    .accessibility-btn {
        width: 8vw;
        height: 8vw;
        min-width: 30px;
        max-width: 45px;
        min-height: 30px;
        max-height: 45px;
        border-radius: 8px;
    }
}

/* ===== МОДАЛЬНОЕ ОКНО ПОИСКА ===== */
.search-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9998 !important;
    animation: fadeIn 0.3s ease;
    justify-content: center;
    align-items: flex-start;
    top: 10%;
}

.search-modal.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.search-modal-content {
    background: white;
    border-radius: 16px;
    padding: 30px 30px 25px;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease;
    position: relative;
}

.search-modal-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #333;
    margin: 0 0 20px 0;
    padding: 0;
    text-align: center;
}

/* ===== КОНТЕЙНЕР ПОИСКА ===== */
.search-container {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.search-input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border-radius: 10px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
    height: 50px;
}

.search-input-wrapper:focus-within {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

/* Иконка через background-image */
.search-icon {
    width: 3vw;
    height: 3vw;
    margin-right: 12px;
    flex-shrink: 0;
    background-size: 100% 100% !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    background-image: url('/images/search-icon.png') !important;
}

.search-input {
    flex: 1;
    border: none;
    padding: 12px 0;
    font-size: 16px;
    font-family: 'Montserrat', sans-serif;
    background: transparent;
    outline: none;
    color: #333;
}

.search-input::placeholder {
    color: #999;
}

/* Кнопка "Искать" */
.search-submit-btn {
    width: 9vw;
    height: 9vw;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    padding: 0;
    background: transparent;
    background-size: 100% 100% !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    background-image: url('/images/search-submit.png') !important;
    outline: none;
}

.search-submit-btn:focus {
    outline: none;
}

.search-submit-btn::-moz-focus-inner {
    border: 0;
}

.search-submit-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.4);
}

.search-submit-btn:active {
    transform: scale(0.95);
}

/* ===== РЕЗУЛЬТАТЫ ПОИСКА ===== */
.search-results {
    margin-top: 20px;
    max-height: 350px;
    overflow-y: auto;
    display: none;
}

.search-results.has-results {
    display: block;
}

.search-result-item {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s ease;
    border-radius: 8px;
}

.search-result-item:hover {
    background: #f8f9ff;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-title {
    font-weight: 600;
    color: #333;
    font-size: 16px;
    margin-bottom: 4px;
}

.search-result-description {
    color: #666;
    font-size: 14px;
}

.search-result-empty {
    text-align: center;
    color: #999;
    padding: 30px 0;
    font-size: 16px;
}

.search-result-item mark {
    background: #ffeb3b;
    padding: 0 2px;
    border-radius: 2px;
}

/* ===== АДАПТИВНОСТЬ МОДАЛЬНОГО ОКНА ===== */
@media (max-width: 768px) {
    .search-modal-content {
        padding: 20px 20px 18px;
        max-width: 95%;
    }
    
    .search-modal-title {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    .search-input-wrapper {
        height: 44px;
        padding: 0 14px;
    }
    
    .search-input {
        font-size: 14px;
        padding: 10px 0;
    }
    
    .search-submit-btn {
        width: 44px;
        height: 44px;
    }
    
    .search-icon {
        width: 28px;
        height: 28px;
        margin-right: 10px;
    }
}

@media (max-width: 480px) {
    .search-modal-content {
        padding: 16px 16px 14px;
        border-radius: 12px;
    }
    
    .search-modal-title {
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    .search-container {
        gap: 8px;
    }
    
    .search-input-wrapper {
        height: 40px;
        padding: 0 12px;
        border-radius: 40px;
    }
    
    .search-input {
        font-size: 13px;
        padding: 8px 0;
    }
    
    .search-submit-btn {
        width: 40px;
        height: 40px;
        border-radius: 6px;
    }
    
    .search-icon {
        width: 24px;
        height: 24px;
        margin-right: 8px;
    }
}

/* ============================================
   СТИЛИ ДЛЯ ВЕРСИИ СЛАБОВИДЯЩИХ (ВСЕ СТРАНИЦЫ)
   ============================================ */

/* Общие стили для body */
body.vision-mode {
    font-size: 18px !important;
    line-height: 1.8 !important;
    background: #ffffff !important;
    color: #000000 !important;
}

body.vision-mode * {
    font-size: inherit !important;
    line-height: inherit !important;
}

/* ===== СТИЛИ ДЛЯ ГЛАВНОЙ СТРАНИЦЫ ===== */
body.vision-mode .hall-button {
    border: 3px solid #000000 !important;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 5px #000000 !important;
    border-radius: 0 0 30px 0 !important;
}

body.vision-mode .hall-button:hover {
    transform: scale(1.1) !important;
    border-color: #0066cc !important;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 5px #0066cc !important;
}

body.vision-mode .main-logo {
    border: 3px solid #000000 !important;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 5px #000000 !important;
}

body.vision-mode .bottom-logo {
    border: 3px solid #000000 !important;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 5px #000000 !important;
}

/* ===== СТИЛИ ДЛЯ СТРАНИЦ ЗАЛОВ (ОБЩИЕ) ===== */

/* Фон залов - делаем светлее для читаемости */
body.vision-mode .hall-background,
body.vision-mode .person-background,
body.vision-mode .museum-background,
body.vision-mode .military-hall-background,
body.vision-mode .artifacts-background,
body.vision-mode .video-background {
    filter: brightness(1.3) contrast(1.2) !important;
}

body.vision-mode .museum-background {
    background-color: #ffffff !important;
    opacity: 0.9 !important;
}

/* Логотипы залов */
body.vision-mode .hall-logo,
body.vision-mode .military-hall-logo {
    border: 3px solid #000000 !important;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 5px #000000 !important;
}

/* ===== СТИЛИ ДЛЯ ВОЕННО-ИСТОРИЧЕСКОГО ЗАЛА ===== */

/* Кнопки войн */
body.vision-mode .military-war-button {
    border: 3px solid #000000 !important;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 5px #000000 !important;
    border-radius: 12px !important;
}

body.vision-mode .military-war-button:hover {
    transform: scale(1.05) !important;
    border-color: #0066cc !important;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 5px #0066cc !important;
}

/* Изображения кнопок войн */
body.vision-mode .military-war-button-bg {
    filter: contrast(1.2) brightness(1.1) !important;
}

/* Кнопка "Назад" в военном зале */
body.vision-mode .military-back-button {
    border: 3px solid #000000 !important;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 5px #000000 !important;
    border-radius: 12px !important;
    padding: 5px !important;
}

body.vision-mode .military-back-button:hover {
    border-color: #0066cc !important;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 5px #0066cc !important;
}

/* ===== СТИЛИ ДЛЯ СТРАНИЦЫ АРТЕФАКТОВ ВОЕННОГО ЗАЛА ===== */

/* Карточки артефактов */
body.vision-mode .artifact-card {
    border: 3px solid #000000 !important;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 5px #000000 !important;
    border-radius: 12px !important;
}

body.vision-mode .artifact-card:hover {
    transform: scale(1.05) !important;
    border-color: #0066cc !important;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 5px #0066cc !important;
}

body.vision-mode .artifact-image {
    filter: contrast(1.2) brightness(1.1) !important;
}

/* Плашка с названием войны на странице артефактов */
body.vision-mode .title-image-bg {
    filter: contrast(1.2) brightness(1.1) !important;
    border: 3px solid #000000 !important;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 5px #000000 !important;
}

/* Навигационные кнопки (Назад/Далее) на странице артефактов */
body.vision-mode .nav-button {
    border: 3px solid #000000 !important;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 5px #000000 !important;
    border-radius: 12px !important;
    padding: 5px !important;
}

body.vision-mode .nav-button:hover {
    border-color: #0066cc !important;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 5px #0066cc !important;
}

/* ===== СТИЛИ ДЛЯ СТРАНИЦЫ ВИДЕО АРТЕФАКТА ===== */

/* Рамка видео */
body.vision-mode .frame-image {
    border: 3px solid #000000 !important;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 5px #000000 !important;
    border-radius: 12px !important;
}

/* Видео-плеер */
body.vision-mode .video-overlay {
    border: 3px solid #000000 !important;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 5px #000000 !important;
    border-radius: 8px !important;
}

/* Название артефакта в правом нижнем углу */
body.vision-mode .artifact-name {
    background: #000000 !important;
    color: #ffffff !important;
    border: 2px solid #ffffff !important;
    font-size: 18px !important;
    padding: 10px 20px !important;
}

/* ===== СТИЛИ ДЛЯ СТРАНИЦЫ ПЕРСОНАЛИИ ===== */

/* Плашка с именем */
body.vision-mode .title-image-bg {
    filter: contrast(1.2) brightness(1.1) !important;
    border: 3px solid #000000 !important;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 5px #000000 !important;
}

/* Имя на плашке */
body.vision-mode .person-name-overlay .person-surname,
body.vision-mode .person-name-overlay .person-firstname {
    color: #000000 !important;
    text-shadow: 1px 1px 2px rgba(255,255,255,0.8) !important;
}

/* Краткая биография */
body.vision-mode .short-bio {
    font-size: clamp(16px, 1.8vw, 28px) !important;
    color: #000000 !important;
    background: rgba(255,255,255,0.85) !important;
    padding: 20px !important;
    border-radius: 12px !important;
    border: 3px solid #000000 !important;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 5px #000000 !important;
}

/* Фото персоналии */
body.vision-mode .person-photo {
    border: 3px solid #000000 !important;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 5px #000000 !important;
    border-radius: 12px !important;
}

/* Кнопка "Артефакты" */
body.vision-mode .artifacts-button {
    border: 3px solid #000000 !important;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 5px #000000 !important;
    border-radius: 12px !important;
}

body.vision-mode .artifacts-button:hover {
    border-color: #0066cc !important;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 5px #0066cc !important;
}

/* ===== СТИЛИ ДЛЯ КНОПКИ "НАЗАД" ===== */
body.vision-mode .back-button {
    border: 3px solid #000000 !important;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 5px #000000 !important;
    border-radius: 12px !important;
    padding: 5px !important;
}

body.vision-mode .back-button:hover {
    border-color: #0066cc !important;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 5px #0066cc !important;
}

/* ===== КНОПКИ УПРАВЛЕНИЯ ДОСТУПНОСТЬЮ ===== */
body.vision-mode .accessibility-btn {
    border: 3px solid #000000 !important;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 5px #000000 !important;
    width: 5vw !important;
    height: 5vw !important;
    min-width: 50px !important;
    max-width: 90px !important;
    min-height: 50px !important;
    max-height: 90px !important;
    border-radius: 12px !important;
}

body.vision-mode .accessibility-btn:hover {
    transform: scale(1.1) !important;
    border-color: #0066cc !important;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 5px #0066cc !important;
}

body.vision-mode .accessibility-btn:focus-visible {
    outline: 4px solid #FFD700 !important;
    outline-offset: 4px !important;
}

/* ===== МОДАЛЬНОЕ ОКНО ПОИСКА ===== */
body.vision-mode .search-modal-content {
    border: 3px solid #000000 !important;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 5px #000000 !important;
}

body.vision-mode .search-input-wrapper {
    border: 3px solid #000000 !important;
    height: 56px !important;
}

body.vision-mode .search-input {
    font-size: 20px !important;
    padding: 14px 0 !important;
}

body.vision-mode .search-submit-btn {
    border: 3px solid #000000 !important;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 5px #000000 !important;
    width: 56px !important;
    height: 56px !important;
    border-radius: 8px !important;
}

body.vision-mode .search-icon {
    width: 36px !important;
    height: 36px !important;
}

body.vision-mode .search-modal-title {
    font-size: 26px !important;
    color: #000000 !important;
}

body.vision-mode .search-result-item {
    border: 2px solid #000000 !important;
    margin-bottom: 8px !important;
    padding: 20px !important;
}

body.vision-mode .search-result-title {
    font-size: 20px !important;
    color: #000000 !important;
}

body.vision-mode .search-result-description {
    font-size: 18px !important;
    color: #333333 !important;
}

body.vision-mode .search-result-empty {
    font-size: 18px !important;
    color: #333333 !important;
}

/* ===== ИНДИКАТОР ВЕРСИИ ДЛЯ СЛАБОВИДЯЩИХ ===== */
body.vision-mode::before {
    content: "👁️ Версия для слабовидящих";
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #000000;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 16px;
    z-index: 99999 !important;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    border: 2px solid #ffffff;
    letter-spacing: 1px;
}

/* ===== АДАПТИВНОСТЬ ИНДИКАТОРА ===== */
@media (max-width: 768px) {
    body.vision-mode::before {
        font-size: 14px;
        padding: 10px 20px;
        bottom: 15px;
        max-width: 90%;
        text-align: center;
    }
    
    body.vision-mode .accessibility-btn {
        width: 6vw !important;
        height: 6vw !important;
        min-width: 40px !important;
        max-width: 60px !important;
        min-height: 40px !important;
        max-height: 60px !important;
    }
}

@media (max-width: 480px) {
    body.vision-mode::before {
        font-size: 12px;
        padding: 8px 16px;
        bottom: 10px;
    }
    
    body.vision-mode .accessibility-btn {
        width: 8vw !important;
        height: 8vw !important;
        min-width: 35px !important;
        max-width: 50px !important;
        min-height: 35px !important;
        max-height: 50px !important;
    }
    
    body.vision-mode .search-modal-title {
        font-size: 20px !important;
    }
}

/* ===== ДОПОЛНИТЕЛЬНЫЕ УЛУЧШЕНИЯ ===== */

/* Увеличиваем контрастность текста */
body.vision-mode .hall-description,
body.vision-mode .hall-title {
    color: #000000 !important;
    text-shadow: 1px 1px 2px rgba(255,255,255,0.8) !important;
}

/* Стили для автографов */
body.vision-mode .autograf-card {
    border: 3px solid #000000 !important;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 5px #000000 !important;
    border-radius: 12px !important;
}

body.vision-mode .autograf-card:hover {
    border-color: #0066cc !important;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 5px #0066cc !important;
}

/* Анимации для плавного переключения */
body.vision-mode * {
    transition: all 0.3s ease !important;
}

/* Улучшаем читаемость ссылок */
body.vision-mode a {
    color: #0000EE !important;
    text-decoration: underline !important;
}

body.vision-mode a:visited {
    color: #551A8B !important;
}

body.vision-mode a:hover {
    color: #0066cc !important;
    text-decoration: underline !important;
}

/* ===== СТИЛИ ДЛЯ РЕЗУЛЬТАТОВ ПОИСКА С ГРУППИРОВКОЙ ===== */
.search-result-count {
    padding: 10px 15px;
    background: #f8f9ff;
    border-radius: 8px;
    margin-bottom: 15px;
    font-weight: 600;
    color: #667eea;
    font-size: 14px;
}

.search-result-group {
    margin-bottom: 15px;
}

.search-result-group-title {
    font-weight: 700;
    color: #333;
    font-size: 14px;
    padding: 8px 12px;
    background: #f0f2f5;
    border-radius: 6px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-result-item {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s ease;
    border-radius: 8px;
    position: relative;
}

.search-result-item:hover {
    background: #f8f9ff;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-title {
    font-weight: 600;
    color: #333;
    font-size: 16px;
    margin-bottom: 4px;
}

.search-result-description {
    color: #666;
    font-size: 14px;
    margin-bottom: 4px;
}

.search-result-type {
    font-size: 12px;
    color: #999;
    font-weight: 500;
    display: inline-block;
    background: #f0f2f5;
    padding: 2px 10px;
    border-radius: 12px;
}

/* ===== АНИМАЦИИ ===== */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.4);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(102, 126, 234, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0);
    }
}

.accessibility-btn.active {
    animation: pulse 0.5s ease;
}

.search-results::-webkit-scrollbar {
    width: 6px;
}

.search-results::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.search-results::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.search-results::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

.accessibility-btn {
    user-select: none;
    -webkit-user-select: none;
}

.accessibility-btn:focus-visible,
.search-input:focus-visible,
.search-submit-btn:focus-visible {
    outline: 3px solid #FFD700;
    outline-offset: 3px;
}

body.vision-mode .accessibility-btn:focus-visible,
body.vision-mode .search-input:focus-visible,
body.vision-mode .search-submit-btn:focus-visible {
    outline: 4px solid #FFD700;
    outline-offset: 4px;
}