/* ===== СТИЛИ ДЛЯ СЛАБОВИДЯЩИХ ===== */

/* --- Кнопка в шапке --- */
.vi-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent), var(--primary-light));
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    color: white;
    font-size: 1.2rem;
}

.vi-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.vi-btn.active {
    background: #dc2626;
}

/* --- Мобильная кнопка --- */
.vi-btn-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent), var(--primary-light));
    border-radius: 50%;
    cursor: pointer;
    border: none;
    color: white;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.vi-btn-mobile:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.vi-btn-mobile.active {
    background: #dc2626;
}

/* --- Панель настроек --- */
.vi-panel {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 320px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    z-index: 9998;
    padding: 1.5rem;
    border: 2px solid var(--accent);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.vi-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.vi-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--bg-alt);
}

.vi-panel-header h3 {
    margin: 0;
    color: var(--primary);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.vi-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.vi-close-btn:hover {
    background: var(--bg-alt);
    color: var(--primary);
}

.vi-section {
    margin-bottom: 1.5rem;
}

.vi-section-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- Размер шрифта --- */
.vi-font-size-controls {
    display: flex;
    gap: 0.5rem;
}

.vi-font-btn {
    flex: 1;
    padding: 0.6rem;
    border: 2px solid var(--border);
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    font-size: 1rem;
}

.vi-font-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.vi-font-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* --- Цветовые схемы --- */
.vi-color-schemes {
    display: flex;
    gap: 0.75rem;
}

.vi-scheme-btn {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.vi-scheme-btn:hover {
    transform: scale(1.05);
}

.vi-scheme-btn.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

.vi-scheme-default {
    background: linear-gradient(135deg, #ffffff 50%, #f8fafc 50%);
}

.vi-scheme-contrast {
    background: linear-gradient(135deg, #000000 50%, #ffffff 50%);
}

.vi-scheme-blue {
    background: linear-gradient(135deg, #1e3a8a 50%, #fbbf24 50%);
}

/* --- Переключатели --- */
.vi-toggles {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.vi-toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-alt);
    border-radius: 8px;
}

.vi-toggle-label {
    font-size: 0.95rem;
    color: var(--text);
}

.vi-switch {
    position: relative;
    width: 48px;
    height: 24px;
    background: var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.3s;
}

.vi-switch.active {
    background: var(--accent);
}

.vi-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.vi-switch.active::after {
    transform: translateX(24px);
}

/* --- Кнопка сброса --- */
.vi-reset-btn {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-alt);
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.vi-reset-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* --- Мобильная адаптация --- */
@media (max-width: 968px) {
    .mobile-controls {
        display: flex;
        align-items: center;
        gap: 1rem;
    }
    
    .nav-links .vi-btn {
        display: none;
    }
}

@media (max-width: 768px) {
    .vi-panel {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        border-radius: 20px 20px 0 0;
        max-height: 85vh;
        overflow-y: auto;
        transform: translateY(100%);
    }
    
    .vi-panel.active {
        transform: translateY(0);
    }
    
    .vi-btn-mobile {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
}

.mobile-nav .vi-btn {
    display: none !important;
}

.mobile-nav .vi-link-mobile {
    display: flex !important;
    align-items: center;
    gap: 0.75rem;
    color: var(--primary);
    font-size: 1.1rem;
    font-weight: 500;
    padding: 0.75rem 0;
    text-decoration: none;
    border-bottom: 1px solid var(--border);
}

.mobile-nav .vi-link-mobile i {
    color: var(--accent);
    font-size: 1.2rem;
}

/* ===== РЕЖИМЫ ДЛЯ СЛАБОВИДЯЩИХ ===== */

/* Контрастный черно-белый */
body.vi-contrast,
body.vi-contrast * {
    background-color: #000000 !important;
    color: #ffffff !important;
    border-color: #ffffff !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

body.vi-contrast img,
body.vi-contrast video {
    filter: grayscale(100%) contrast(150%) brightness(0.9) !important;
}

body.vi-contrast .vi-panel,
body.vi-contrast .vi-panel * {
    background-color: #000000 !important;
    color: #ffffff !important;
    border-color: #ffffff !important;
}

body.vi-contrast .vi-btn,
body.vi-contrast .vi-btn-mobile {
    background: #ffffff !important;
    color: #000000 !important;
}

body.vi-contrast a {
    text-decoration: underline !important;
    color: #ffff00 !important;
}

/* Сине-желтый режим */
body.vi-blue,
body.vi-blue * {
    background-color: #1e3a8a !important;
    color: #fbbf24 !important;
    border-color: #fbbf24 !important;
    box-shadow: none !important;
}

body.vi-blue img,
body.vi-blue video {
    filter: sepia(100%) hue-rotate(180deg) saturate(200%) !important;
    opacity: 0.8;
}

body.vi-blue .vi-panel,
body.vi-blue .vi-panel * {
    background-color: #1e3a8a !important;
    color: #fbbf24 !important;
    border-color: #fbbf24 !important;
}

body.vi-blue .vi-btn,
body.vi-blue .vi-btn-mobile {
    background: #fbbf24 !important;
    color: #1e3a8a !important;
}

body.vi-blue a {
    text-decoration: underline !important;
    color: #ffffff !important;
}

/* Скрытие изображений */
body.vi-no-images img,
body.vi-no-images video,
body.vi-no-images .hero-image,
body.vi-no-images .work-image-gallery,
body.vi-no-images .photo-card,
body.vi-no-images .carousel-track {
    display: none !important;
}

body.vi-no-images .work-card,
body.vi-no-images .news-card {
    background: transparent !important;
    border: 2px solid currentColor !important;
}

/* Увеличенный шрифт */
body.vi-font-medium {
    font-size: 120% !important;
}

body.vi-font-large {
    font-size: 140% !important;
}

body.vi-font-large h1,
body.vi-font-large h2,
body.vi-font-large h3 {
    font-size: 1.8em !important;
}

/* Увеличенные интервалы */
body.vi-spacing-wide {
    letter-spacing: 0.1em !important;
    line-height: 1.8 !important;
}

body.vi-spacing-wide * {
    line-height: 1.8 !important;
}

/* Навигация в режимах */
body.vi-contrast .nav,
body.vi-blue .nav {
    background: transparent !important;
    backdrop-filter: none !important;
}
/* ===== МОБИЛЬНЫЕ КОНТРОЛЫ (кнопка VI + бургер) ===== */

.mobile-controls {
    display: none; /* Скрыто на десктопе */
    align-items: center;
    gap: 1rem; /* Расстояние между кнопкой VI и бургером */
}

/* Показываем на мобильных */
@media (max-width: 968px) {
    .mobile-controls {
        display: flex;
        flex-direction: row; /* Горизонтальное расположение */
        align-items: center;
    }
    
    /* Скрываем десктопную кнопку VI в меню */
    .nav-links .vi-btn {
        display: none;
    }
}

/* ===== КНОПКА ДЛЯ СЛАБОВИДЯЩИХ (мобильная) ===== */

.vi-btn-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent), var(--primary-light));
    border-radius: 50%;
    cursor: pointer;
    border: none;
    color: white;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    flex-shrink: 0; /* Не сжиматься */
    order: -1; /* ВАЖНО: размещает кнопку ПЕРВОЙ (слева) */
}

/* Эффекты при наведении/нажатии */
.vi-btn-mobile:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

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

/* Активное состояние (когда панель открыта) */
.vi-btn-mobile.active {
    background: #dc2626;
}

/* ===== БУРГЕР-МЕНЮ ===== */

.mobile-menu {
    display: none; /* Скрыто на десктопе */
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 5px;
    order: 1; /* ВАЖНО: размещает бургер ВТОРЫМ (справа) */
}

.mobile-menu span {
    width: 25px;
    height: 2px;
    background: var(--primary);
    transition: 0.3s;
}

/* Показываем бургер на мобильных */
@media (max-width: 968px) {
    .mobile-menu {
        display: flex;
    }
}

/* ===== МАЛЕНЬКИЕ ЭКРАНЫ (оптимизация) ===== */

@media (max-width: 768px) {
    .vi-btn-mobile {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    
    .mobile-controls {
        gap: 0.75rem; /* Меньше расстояние на маленьких экранах */
    }
}

@media (max-width: 480px) {
    .vi-btn-mobile {
        width: 34px;
        height: 34px;
        font-size: 0.9rem;
    }
    
    .mobile-controls {
        gap: 0.5rem;
    }
}