/* АНИМАЦИИ ДЛЯ ГЛАВНОЙ СТРАНИЦЫ - INDEX.PHP */

/* Базовые стили для элементов с анимациями */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* АНИМАЦИИ ДЛЯ HERO СЕКЦИИ */
.hero-content {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
    animation: heroContentAppear 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s forwards;
}

.hero-title {
    opacity: 0;
    transform: translateY(50px);
    animation: heroTitleSlide 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.4s forwards;
}

.hero-subtitle {
    opacity: 0;
    transform: translateY(30px);
    animation: heroSubtitleSlide 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.7s forwards;
}

.hero-stats {
    opacity: 1;
    /* Контейнер всегда видим, анимируем только дочерние элементы */
}

.hero-stat {
    opacity: 0;
    transform: translateY(30px) scale(0.8);
    animation: statAppear 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Поочередное появление статистики без ожидания завершения предыдущей */
.hero-stat:nth-child(1) { 
    animation-delay: 1.0s; 
    transform: translateY(30px) scale(0.8) rotateX(-20deg);
}
.hero-stat:nth-child(2) { 
    animation-delay: 1.2s; 
    transform: translateY(30px) scale(0.8) rotateY(-15deg);
}
.hero-stat:nth-child(3) { 
    animation-delay: 1.4s; 
    transform: translateY(30px) scale(0.8) rotateX(20deg);
}

/* АНИМАЦИИ ДЛЯ КАРТОЧЕК */
.modern-card {
    opacity: 0;
    transform: translateY(60px) scale(0.95);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.modern-card.animated {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Поочередное появление карточек в блоке */
.modern-card:nth-child(1) { transition-delay: 0.1s; }
.modern-card:nth-child(2) { transition-delay: 0.2s; }
.modern-card:nth-child(3) { transition-delay: 0.3s; }
.modern-card:nth-child(4) { transition-delay: 0.4s; }
.modern-card:nth-child(5) { transition-delay: 0.5s; }
.modern-card:nth-child(6) { transition-delay: 0.6s; }

/* АНИМАЦИИ ДЛЯ ИКОНОК КАРТОЧЕК */
.card-icon {
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.card-icon::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: translateX(-100%) translateY(-100%) rotate(45deg);
    transition: transform 0.8s ease;
}

.modern-card.animated .card-icon {
    animation: iconBounce 0.8s ease-out 0.3s;
}

.modern-card:hover .card-icon {
    transform: scale(1.1) rotate(10deg);
}

.modern-card.animated .card-icon::before {
    animation: iconShine 1.2s ease-out 0.5s;
}

/* АНИМАЦИИ ДЛЯ НОВОСТНЫХ КАРТОЧЕК */
.modern-news-card {
    opacity: 0;
    transform: translateY(50px) rotateX(15deg);
    transition: all 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.modern-news-card.animated {
    opacity: 1;
    transform: translateY(0) rotateX(0deg);
}

.modern-news-card:nth-child(1) { transition-delay: 0.1s; }
.modern-news-card:nth-child(2) { transition-delay: 0.2s; }
.modern-news-card:nth-child(3) { transition-delay: 0.3s; }

.modern-news-card:hover {
    transform: translateY(-8px) scale(1.02) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15) !important;
}

/* АНИМАЦИИ ДЛЯ СЕКЦИЙ */
.section-title {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.section-title.animated {
    opacity: 1;
    transform: translateY(0);
}

/* КАСТОМНЫЕ KEYFRAMES */
@keyframes heroContentAppear {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes heroTitleSlide {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes heroSubtitleSlide {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes statAppear {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.8);
    }
    50% {
        transform: translateY(-5px) scale(1.1);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes iconBounce {
    0% {
        transform: scale(0.3) rotate(-180deg);
    }
    50% {
        transform: scale(1.2) rotate(-90deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

@keyframes iconShine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

@keyframes highlightIconPop {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes highlightShine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

@keyframes competencyIconSpin {
    0% {
        transform: scale(0.5) rotate(-180deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.3) rotate(90deg);
        opacity: 0.8;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* Уникальные анимации всплытия для каждого highlight-item */
@keyframes highlightFloat1 {
    0% {
        opacity: 0;
        transform: translateY(60px) scale(0.8) rotateZ(-10deg);
    }
    50% {
        opacity: 0.8;
        transform: translateY(-10px) scale(1.1) rotateZ(-2deg);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1) rotateZ(0deg);
    }
}

@keyframes highlightFloat2 {
    0% {
        opacity: 0;
        transform: translateY(80px) scale(0.7);
    }
    60% {
        opacity: 0.9;
        transform: translateY(-15px) scale(1.15);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes highlightFloat3 {
    0% {
        opacity: 0;
        transform: translateY(60px) scale(0.8) rotateZ(10deg);
    }
    50% {
        opacity: 0.8;
        transform: translateY(-10px) scale(1.1) rotateZ(2deg);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1) rotateZ(0deg);
    }
}

@keyframes highlightFloat4 {
    0% {
        opacity: 0;
        transform: translateY(70px) scale(0.9) rotateZ(-5deg);
    }
    40% {
        opacity: 0.7;
        transform: translateY(-8px) scale(1.05) rotateZ(-1deg);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1) rotateZ(0deg);
    }
}

@keyframes highlightFloat5 {
    0% {
        opacity: 0;
        transform: translateY(90px) scale(0.6);
    }
    70% {
        opacity: 0.9;
        transform: translateY(-20px) scale(1.2);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes highlightFloat6 {
    0% {
        opacity: 0;
        transform: translateY(65px) scale(0.85) rotateZ(8deg);
    }
    55% {
        opacity: 0.85;
        transform: translateY(-12px) scale(1.12) rotateZ(3deg);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1) rotateZ(0deg);
    }
}

/* АНИМАЦИИ ДЛЯ МОБИЛЬНЫХ УСТРОЙСТВ */
@media (max-width: 768px) {
    .hero-content {
        animation-delay: 0.1s;
    }
    
    .hero-title {
        animation-delay: 0.2s;
    }
    
    .hero-subtitle {
        animation-delay: 0.4s;
    }
    
    .hero-stat:nth-child(1) { animation-delay: 0.6s; }
    .hero-stat:nth-child(2) { animation-delay: 0.7s; }
    .hero-stat:nth-child(3) { animation-delay: 0.8s; }
    
    .modern-card {
        transform: translateY(40px) scale(0.98);
    }
    
    .modern-news-card {
        transform: translateY(40px) rotateX(10deg);
    }
    
    /* Упрощенные анимации highlight-item для мобильных */
    .highlight-item:nth-child(1),
    .highlight-item:nth-child(2),
    .highlight-item:nth-child(3),
    .highlight-item:nth-child(4),
    .highlight-item:nth-child(5),
    .highlight-item:nth-child(6) {
        transform: translateY(50px) scale(0.9);
        transition-delay: 0.1s;
    }
    
    .highlight-item:nth-child(2) { transition-delay: 0.15s; }
    .highlight-item:nth-child(3) { transition-delay: 0.2s; }
    .highlight-item:nth-child(4) { transition-delay: 0.25s; }
    .highlight-item:nth-child(5) { transition-delay: 0.3s; }
    .highlight-item:nth-child(6) { transition-delay: 0.35s; }
    
    /* Упрощенные анимации компетенций для мобильных */
    .competencies:nth-child(1),
    .competencies:nth-child(2),
    .competencies:nth-child(3),
    .competencies:nth-child(4),
    .competencies:nth-child(5),
    .competencies:nth-child(6),
    .competencies:nth-child(7),
    .competencies:nth-child(8) {
        transform: translateY(40px) scale(0.95);
    }
    
    .key-competencies {
        transform: translateY(40px) scale(0.98);
    }
}

/* УЛУЧШЕННЫЕ HOVER ЭФФЕКТЫ */
.modern-card {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

.modern-card:hover {
    transform: translateY(-8px) scale(1.02) !important;
    box-shadow: 0 20px 40px rgba(59, 130, 246, 0.15) !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

.modern-card:hover .card-title {
    color: #3b82f6;
    transition: color 0.3s ease !important;
}

/* АНИМАЦИИ ДЛЯ HIGHLIGHT-ITEM */
.highlight-item {
    opacity: 0;
    transform: translateY(60px) scale(0.8);
    transition: all 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.highlight-item.animated {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Убираем автоматические CSS анимации - только transition для плавности */
.highlight-item:nth-child(1) {
    transform: translateY(60px) scale(0.8) rotateZ(-10deg);
}

.highlight-item:nth-child(2) {
    transform: translateY(80px) scale(0.7);
}

.highlight-item:nth-child(3) {
    transform: translateY(60px) scale(0.8) rotateZ(10deg);
}

.highlight-item:nth-child(4) {
    transform: translateY(70px) scale(0.9) rotateZ(-5deg);
}

.highlight-item:nth-child(5) {
    transform: translateY(90px) scale(0.6);
}

.highlight-item:nth-child(6) {
    transform: translateY(65px) scale(0.85) rotateZ(8deg);
}

/* Состояния после анимации - НЕ АВТОМАТИЧЕСКИЕ */
.highlight-item.animated:nth-child(1) {
    opacity: 1;
    transform: translateY(0) scale(1) rotateZ(0deg);
    transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.highlight-item.animated:nth-child(2) {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition: all 0.9s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.highlight-item.animated:nth-child(3) {
    opacity: 1;
    transform: translateY(0) scale(1) rotateZ(0deg);
    transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.highlight-item.animated:nth-child(4) {
    opacity: 1;
    transform: translateY(0) scale(1) rotateZ(0deg);
    transition: all 0.85s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.highlight-item.animated:nth-child(5) {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition: all 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.highlight-item.animated:nth-child(6) {
    opacity: 1;
    transform: translateY(0) scale(1) rotateZ(0deg);
    transition: all 0.9s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Красивые hover эффекты для highlight-item */
.highlight-item {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

.highlight-item:hover {
    transform: translateY(-10px) scale(1.05) !important;
    box-shadow: 0 15px 35px rgba(59, 130, 246, 0.2) !important;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

/* Анимации для иконок внутри highlight-item */
.highlight-item .card-icon,
.highlight-item .feature-icon {
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.highlight-item:hover .card-icon,
.highlight-item:hover .feature-icon {
    transform: scale(1.1) rotate(12deg);
}

/* Эффект блеска для иконок highlight-item - только при добавлении класса shine */
.highlight-item .card-icon::before,
.highlight-item .feature-icon::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: translateX(-100%) translateY(-100%) rotate(45deg);
    transition: transform 0.8s ease;
}

.highlight-item .card-icon.shine::before,
.highlight-item .feature-icon.shine::before {
    transform: translateX(100%) translateY(100%) rotate(45deg);
}

/* АНИМАЦИИ ДЛЯ КЛЮЧЕВЫХ КОМПЕТЕНЦИЙ */
.key-competencies {
    opacity: 0;
    transform: translateY(50px) scale(0.95);
    transition: all 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.key-competencies.animated {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Анимация заголовка секции компетенций */
.key-competencies h2,
.key-competencies h3 {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.key-competencies.animated h2,
.key-competencies.animated h3 {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.2s;
}

/* Анимации для отдельных компетенций */
.competencies {
    opacity: 0;
    transform: translateX(-60px) scale(0.9);
    transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    /* Фиксируем отображение текста */
    display: flex !important;
    align-items: flex-start !important;
    gap: 0.75rem !important;
    margin-bottom: 0.75rem !important;
    color: #4b5563 !important;
    line-height: 1.5 !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    text-align: left !important;
}

.competencies.animated {
    opacity: 1;
    transform: translateX(0) scale(1);
}

/* Красивые разные анимации для каждой компетенции */
.competencies:nth-child(1) {
    transform: translateX(-80px) rotateZ(-5deg) scale(0.8);
}

.competencies:nth-child(2) {
    transform: translateX(80px) rotateZ(5deg) scale(0.8);
}

.competencies:nth-child(3) {
    transform: translateY(60px) rotateX(-10deg) scale(0.85);
}

.competencies:nth-child(4) {
    transform: translateX(-60px) rotateY(-15deg) scale(0.9);
}

.competencies:nth-child(5) {
    transform: translateX(60px) rotateY(15deg) scale(0.9);
}

.competencies:nth-child(6) {
    transform: translateY(80px) rotateX(10deg) scale(0.85);
}

.competencies:nth-child(7) {
    transform: translateX(-50px) rotateZ(-3deg) scale(0.95);
}

.competencies:nth-child(8) {
    transform: translateX(50px) rotateZ(3deg) scale(0.95);
}

/* Состояния после анимации для каждой компетенции */
.competencies.animated:nth-child(1) {
    transform: translateX(0) rotateZ(0deg) scale(1);
}

.competencies.animated:nth-child(2) {
    transform: translateX(0) rotateZ(0deg) scale(1);
}

.competencies.animated:nth-child(3) {
    transform: translateY(0) rotateX(0deg) scale(1);
}

.competencies.animated:nth-child(4) {
    transform: translateX(0) rotateY(0deg) scale(1);
}

.competencies.animated:nth-child(5) {
    transform: translateX(0) rotateY(0deg) scale(1);
}

.competencies.animated:nth-child(6) {
    transform: translateY(0) rotateX(0deg) scale(1);
}

.competencies.animated:nth-child(7) {
    transform: translateX(0) rotateZ(0deg) scale(1);
}

.competencies.animated:nth-child(8) {
    transform: translateX(0) rotateZ(0deg) scale(1);
}

/* Hover эффекты для компетенций */
.competencies:hover {
    transform: translateY(-5px) scale(1.02) !important;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.15) !important;
    background: rgba(255, 255, 255, 0.5) !important;
    border-radius: 8px !important;
    padding: 0.5rem !important;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

/* Анимация иконок в компетенциях */
.competencies i {
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: inline-block;
    flex-shrink: 0 !important;
    margin-top: 0.25rem !important;
}

.competencies.animated i {
    animation: competencyIconSpin 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.5s;
}

.competencies:hover i {
    transform: scale(1.2) rotate(360deg);
    color: #3b82f6 !important;
}

/* Текст внутри компетенций */
.competencies > *:not(i) {
    flex: 1;
    text-align: left;
    line-height: 1.5;
    word-break: break-word;
}
.news-section {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.news-section.animated {
    opacity: 1;
    transform: translateY(0);
}

/* АНИМАЦИИ ДЛЯ КНОПОК */
.modern-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.modern-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.6s ease;
}

.modern-btn:hover::before {
    left: 100%;
}

.modern-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* СПЕЦИАЛЬНЫЕ ЭФФЕКТЫ ДЛЯ SLIDESHOW */
.slideshow {
    opacity: 0.3;
    transition: opacity 1s ease-out 2s;
}

.slideshow.enhanced {
    opacity: 0.4;
}