/* 
 * Magnifier for visually impaired users (Loupe Effect)
 * Author: Antigravity AI
 * Designed for strong-likes.ru
 */

:root {
    --magnifier-size: 250px;
    --magnifier-zoom: 2.7;
    --magnifier-border-color: rgba(14, 165, 233, 0.5);
    --magnifier-shadow: 0 0 30px rgba(0, 0, 0, 0.5), 0 0 10px rgba(14, 165, 233, 0.3);
}

@media (max-width: 768px) {
    :root {
        --magnifier-size: 180px; /* Уменьшаем линзу для мобильных */
    }
}

/* Стили самой лупы */
#ai-magnifier-lens {
    position: fixed;
    width: var(--magnifier-size);
    height: var(--magnifier-size);
    border-radius: 50%;
    border: 3px solid var(--magnifier-border-color);
    box-shadow: var(--magnifier-shadow);
    pointer-events: none; /* Лупа не должна мешать кликам */
    overflow: hidden;
    z-index: 10000;
    display: none; /* По умолчанию скрыта */
    background: #020617; /* Фон должен совпадать с фоном сайта */
    cursor: none;
}

#ai-magnifier-lens * {
    pointer-events: none !important;
}

/* Контейнер внутри лупы, который содержит клон контента */
#ai-magnifier-content {
    position: absolute;
    transform-origin: 0 0;
}

/* Кнопка управления доступностью (плавающая) */
.accessibility-toolbar {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 10001; /* Выше линзы */
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    touch-action: manipulation; /* Разрешаем только простые жесты */
}

@media (max-width: 640px) {
    .accessibility-toolbar {
        bottom: 1rem;
        right: 1rem;
    }
}

.accessibility-btn {
    width: auto;
    min-width: 60px;
    height: 60px;
    border-radius: 30px;
    padding: 0 1.25rem;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(12px);
    border: 2px solid rgba(14, 165, 233, 0.3);
    color: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.875rem;
}

.accessibility-btn:hover {
    border-color: #0ea5e9;
    box-shadow: 0 0 30px rgba(14, 165, 233, 0.5);
    transform: translateY(-2px);
}

.accessibility-btn .btn-text {
    white-space: nowrap;
}

/* Пульсация для привлечения внимания при первом визите */
@keyframes pulse-blue {
    0% { box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(14, 165, 233, 0); }
    100% { box-shadow: 0 0 0 0 rgba(14, 165, 233, 0); }
}

.accessibility-btn:not(.active) {
    animation: pulse-blue 3s infinite;
}

.accessibility-btn.active {
    background: #0ea5e9;
    color: #fff;
    box-shadow: 0 0 25px rgba(14, 165, 233, 0.6);
}

.accessibility-btn svg {
    width: 24px;
    height: 24px;
}

/* Режим лупы: блокируем скролл и системные жесты для корректной работы линзы */
body.magnifier-active {
    touch-action: none; /* Критично для корректной работы pointermove без скролла */
    -webkit-user-select: none;
    user-select: none;
}

/* Анимация появления */
@keyframes magnifierFadeIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

#ai-magnifier-lens.visible {
    display: block;
    animation: magnifierFadeIn 0.2s ease-out;
}
