/**
 * CSS анимации для замены jQuery анимаций
 * Используется вместо slideToggle и других jQuery эффектов
 */

/* Плавные переходы для аккордеонов */
.view-source .hide,
.question__body {
    transition: max-height 0.5s ease-in-out;
    overflow: hidden;
}

/* Анимация для мобильного меню */
.header-menu ul {
    transition: max-height 0.5s ease-in-out;
    overflow: hidden;
}

/* Мобильное меню - скрыто по умолчанию на мобильных */
@media (max-width: 900px) {
    .header-menu ul {
        max-height: 0px;
        overflow: hidden;
    }
    
    .header-menu ul.show {
        max-height: 500px; /* достаточно для всех пунктов меню */
    }
}

/* Улучшенный smooth scroll для браузеров */
html {
    scroll-behavior: smooth;
}

/* Анимации для табов и кнопок */
.tab, .cours-title, .question__header {
    transition: all 0.3s ease;
}

.tab:hover, .cours-title:hover, .question__header:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Анимация для активных элементов навигации */
.header-menu .scrl a {
    transition: color 0.3s ease;
}

.header-menu .scrl a.active {
    color: #1976d2;
    position: relative;
}

.header-menu .scrl a.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #1976d2;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

/* Анимация для курсов при фильтрации */
.tab {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.tab.mal {
    opacity: 0.3;
    transform: scale(0.95);
}

/* Улучшенная анимация для аккордеонов FAQ */
.question__container {
    transition: all 0.3s ease;
    border-radius: 8px;
    margin-bottom: 10px;
}

.question__container.active {
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.1);
    border-left: 3px solid #1976d2;
}

.question__body {
    transition: max-height 0.5s ease-in-out, padding 0.3s ease;
}

/* Кнопка "вверх" */
.scroll-up {
    transition: all 0.3s ease;
}

.scroll-up:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Анимация загрузки для направлений */
@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

.directions.loading .dir a {
    animation: pulse 1.5s infinite;
}

/* Микро-анимации для лучшего UX */
button, .btn, a.cours-title, .tab {
    transition: all 0.2s ease;
}

button:active, .btn:active, a.cours-title:active, .tab:active {
    transform: scale(0.98);
}

/* Адаптивные анимации - убираем на медленных устройствах */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
