/* ====================================
   Анимации для Happ Secure Access
   ==================================== */

/* Базовые анимации появления */
.animate-in {
    animation: fadeInUp 0.6s ease-out forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Анимация для карточек с задержкой */
.feature-card,
.platform-card,
.testimonial-card,
.pricing-card {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.feature-card.animate-in,
.platform-card.animate-in,
.testimonial-card.animate-in,
.pricing-card.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Задержки для последовательного появления */
.feature-card:nth-child(1) { transition-delay: 0.1s; }
.feature-card:nth-child(2) { transition-delay: 0.2s; }
.feature-card:nth-child(3) { transition-delay: 0.3s; }
.feature-card:nth-child(4) { transition-delay: 0.4s; }
.feature-card:nth-child(5) { transition-delay: 0.5s; }
.feature-card:nth-child(6) { transition-delay: 0.6s; }

/* Пульсация для кнопок */
@keyframes pulse-button {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.btn-hero:hover,
.btn-cta:hover {
    animation: pulse-button 1s infinite;
}

/* Вращение иконок при hover */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.feature-icon:hover {
    animation: rotate 0.6s ease-in-out;
}

/* Анимация градиента */
@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.gradient-text,
.brand-highlight {
    background-size: 200% auto;
    animation: gradient-shift 3s ease infinite;
}

/* Эффект свечения */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(99, 102, 241, 0.6);
    }
}

.phone-mockup {
    animation: glow 3s ease-in-out infinite;
}

/* Плавающее движение */
@keyframes float-gentle {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

.hero-visual {
    animation: float-gentle 6s ease-in-out infinite;
}

/* Анимация для navbar при скролле */
.navbar.scrolled {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Hover эффект для карточек */
.feature-card,
.platform-card,
.pricing-card,
.testimonial-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-card:hover,
.platform-card:hover,
.pricing-card:hover,
.testimonial-card:hover {
    transform: translateY(-10px);
}

/* Анимация для mobile menu */
.nav-menu.active {
    animation: slideDown 0.3s ease-out;
}

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

/* Эффект ripple при клике */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
}

.btn:active::after {
    width: 100px;
    height: 100px;
    animation: ripple 0.6s ease-out;
}

/* Shimmer эффект для загрузки */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.loading-shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* Bounce анимация для иконок */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.feature-icon i {
    display: inline-block;
    transition: all 0.3s ease;
}

.feature-card:hover .feature-icon i {
    animation: bounce 1s;
}

/* Эффект typewriter для текста */
@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

.typewriter-effect {
    overflow: hidden;
    border-right: 3px solid var(--primary-color);
    white-space: nowrap;
    animation: typewriter 3s steps(40) 1s 1 normal both,
               blink 0.75s step-end infinite;
}

@keyframes blink {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: var(--primary-color);
    }
}

/* Shake анимация для уведомлений */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-10px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(10px);
    }
}

.shake {
    animation: shake 0.5s;
}

/* Fade in для модальных окон */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal {
    animation: fadeIn 0.3s ease-in;
}

/* Slide up для toast уведомлений */
@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.toast {
    animation: slideUp 0.3s ease-out;
}

/* Responsive анимации */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}