/* animations.css - Enhanced Edition */

/* ═══════════════════════════════════════════════════════════
   БАЗОВЫЕ НАСТРОЙКИ
   ═══════════════════════════════════════════════════════════ */

* {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

h1, h2, h3, .nav-logo, .box-logo {
    font-family: 'Inter', sans-serif;
    font-weight: 900;
    letter-spacing: -0.02em;
}

.hero h1 {
    letter-spacing: -0.03em;
}

*:focus {
    outline: none !important;
    box-shadow: none !important;
}

*:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

/* ═══════════════════════════════════════════════════════════
   ПОЯВЛЕНИЕ СТРАНИЦЫ
   ═══════════════════════════════════════════════════════════ */

body {
    opacity: 1;
    animation: pageIn 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes pageIn {
    from { 
        opacity: 0;
        transform: scale(0.98);
    }
    to { 
        opacity: 1;
        transform: scale(1);
    }
}

/* Nav всегда на месте и всегда видимый */
nav {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
    opacity: 1 !important;
    animation: navSlideDown 0.8s cubic-bezier(0.16, 1, 0.3, 1) !important;
    animation-fill-mode: forwards !important;
}

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

/* ═══════════════════════════════════════════════════════════
   REVEAL АНИМАЦИИ (Scroll-triggered)
   ═══════════════════════════════════════════════════════════ */

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
    will-change: auto;
}

/* Stagger эффект для последовательного появления */
.reveal:nth-child(1) { transition-delay: 0.1s; }
.reveal:nth-child(2) { transition-delay: 0.2s; }
.reveal:nth-child(3) { transition-delay: 0.3s; }
.reveal:nth-child(4) { transition-delay: 0.4s; }
.reveal:nth-child(5) { transition-delay: 0.5s; }
.reveal:nth-child(6) { transition-delay: 0.6s; }
.reveal:nth-child(7) { transition-delay: 0.7s; }
.reveal:nth-child(8) { transition-delay: 0.8s; }

/* ═══════════════════════════════════════════════════════════
   КНОПКИ - Продвинутые эффекты
   ═══════════════════════════════════════════════════════════ */

button, .btn-submit, .btn-card {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

button:hover, .btn-submit:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.btn-card:hover {
    /* Стили определены в inline CSS index.html */
}

button:active, .btn-submit:active {
    transform: translateY(-1px) scale(0.98) !important;
    transition: all 0.1s ease;
}

/* Специальная обработка для btn-buy */
.btn-buy {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* Анимированный градиент для главной кнопки */
.btn-buy::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.3), 
        transparent);
    transition: left 0.5s ease;
    pointer-events: none;
    z-index: 1;
}

.btn-buy:hover::before {
    left: 100%;
}

.btn-buy:hover {
    transform: translateY(-2px) scale(1.01) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4) !important;
}

/* Пульсирующее свечение */
@keyframes buttonGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.1),
                    0 0 40px rgba(255, 255, 255, 0.05);
    }
    50% {
        box-shadow: 0 0 30px rgba(255, 255, 255, 0.2),
                    0 0 60px rgba(255, 255, 255, 0.1);
    }
}

/* ═══════════════════════════════════════════════════════════
   ИНПУТЫ - Современные эффекты
   ═══════════════════════════════════════════════════════════ */

input {
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

input:focus {
    transform: translateY(-2px);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06),
                0 8px 24px rgba(0, 0, 0, 0.4);
}

input:hover:not(:focus) {
    border-color: #2a2a2a;
    transform: translateY(-1px);
}

/* ═══════════════════════════════════════════════════════════
   КАРТОЧКИ PRICING - 3D эффекты
   ═══════════════════════════════════════════════════════════ */

.card {
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
    will-change: transform;
    transform-style: preserve-3d;
}

.card:hover {
    /* Стили определены в inline CSS index.html */
}

/* Эффект ::before для карточек отключен - мешает видимости контента */
/*
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), 
                rgba(255, 255, 255, 0.03) 0%, 
                transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 16px;
    pointer-events: none;
    z-index: 0;
}

.card:hover::before {
    opacity: 1;
}
*/

/* Featured карточка с особым эффектом */
.card.featured {
    animation: featuredPulse 3s ease-in-out infinite;
}

.card.featured:hover {
    /* Стили определены в inline CSS index.html */
}

@keyframes featuredPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
    50% {
        box-shadow: 0 0 30px 2px rgba(255, 255, 255, 0.08);
    }
}

/* ═══════════════════════════════════════════════════════════
   INFO БЛОКИ - Плавные переходы
   ═══════════════════════════════════════════════════════════ */

.info-block, .sub-block {
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.info-block:hover, .sub-block:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.info-block::after, .sub-block::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.03), 
        transparent);
    transition: left 0.6s ease;
}

.info-block:hover::after, .sub-block:hover::after {
    left: 100%;
}

.info-row {
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.info-row:hover {
    background: rgba(255, 255, 255, 0.03);
    padding-left: 2rem;
    transform: translateX(8px);
}

/* ═══════════════════════════════════════════════════════════
   NAV - Анимированная навигация
   ═══════════════════════════════════════════════════════════ */

nav {
    position: fixed !important;
    top: 0 !important;
    transform: none !important;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* Убрали nav:hover чтобы сохранить полупрозрачность из index.html */

/* Анимация для nav кнопок (исключая логотип) */
nav .nav-links a {
    position: relative;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Убрали ::after эффект для nav ссылок, чтобы не мешать стилям из index.html */

/* ═══════════════════════════════════════════════════════════
   ЛОГОТИП - МАКСИМАЛЬНАЯ ЗАЩИТА (НИКОГДА НЕ ПРОПАДАЕТ!)
   ═══════════════════════════════════════════════════════════ */

.nav-logo,
a.nav-logo,
nav .nav-logo,
nav a.nav-logo {
    transition: color 0.3s ease !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: inline-block !important;
    position: relative !important;
    z-index: 1000 !important;
    color: var(--text-primary) !important;
    pointer-events: auto !important;
}

/* КРИТИЧНО: Логотип НЕ меняется при наведении */
.nav-logo:hover,
.nav-logo:focus,
.nav-logo:active,
.nav-logo:visited,
a.nav-logo:hover,
a.nav-logo:focus,
a.nav-logo:active,
a.nav-logo:visited,
nav .nav-logo:hover,
nav .nav-logo:focus,
nav .nav-logo:active,
nav .nav-logo:visited,
nav a.nav-logo:hover,
nav a.nav-logo:focus,
nav a.nav-logo:active,
nav a.nav-logo:visited {
    opacity: 1 !important;
    visibility: visible !important;
    display: inline-block !important;
    transform: none !important;
    filter: none !important;
    text-shadow: none !important;
    color: var(--text-primary) !important;
    background: transparent !important;
    pointer-events: auto !important;
    transition: color 0.3s ease !important;
    animation: none !important;
}

/* Дополнительная защита от любых hover эффектов */
.nav-logo::before,
.nav-logo::after,
a.nav-logo::before,
a.nav-logo::after {
    display: none !important;
    content: none !important;
}

/* ═══════════════════════════════════════════════════════════
   FEATURE ITEMS
   ═══════════════════════════════════════════════════════════ */

.feature-item {
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.feature-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.05) 0%, 
        transparent 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    border-radius: 12px;
}

.feature-item:hover::before {
    opacity: 1;
}

.feature-item:hover {
    transform: translateX(12px) translateY(-4px);
    background: rgba(255, 255, 255, 0.02);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.feature-item .tag {
    transition: all 0.3s ease;
}

.feature-item:hover .tag {
    color: #888;
    letter-spacing: 0.35em;
}

/* ═══════════════════════════════════════════════════════════
   HERO СЕКЦИЯ - Эпичное появление
   ═══════════════════════════════════════════════════════════ */

.hero h1 {
    animation: heroIn 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    text-shadow: 0 0 80px rgba(255, 255, 255, 0.1),
                 0 4px 0 #000,
                 0 8px 20px rgba(0, 0, 0, 0.5);
}

@keyframes heroIn {
    from {
        opacity: 0;
        transform: translateY(60px) scale(0.9);
        letter-spacing: 0.5em;
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        letter-spacing: 0.15em;
    }
}

/* Пульсирующий текст */
.hero h1:hover {
    transform: scale(1.02);
    text-shadow: 0 0 120px rgba(255, 255, 255, 0.2),
                 0 4px 0 #000,
                 0 12px 30px rgba(0, 0, 0, 0.6);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), text-shadow 0.4s ease;
}

/* ═══════════════════════════════════════════════════════════
   SCROLL ARROW - Улучшенная анимация
   ═══════════════════════════════════════════════════════════ */

.scroll-arrow {
    animation: bounceImproved 2.5s cubic-bezier(0.4, 0, 0.2, 1) infinite !important;
    will-change: transform;
    transition: all 0.3s ease;
}

.scroll-arrow:hover {
    transform: translateY(4px) scale(1.2);
    color: #aaa;
}

@keyframes bounceImproved {
    0%, 100% { 
        transform: translateY(0);
        opacity: 0.6;
    }
    50% { 
        transform: translateY(12px);
        opacity: 1;
    }
}

/* ═══════════════════════════════════════════════════════════
   PAGE TRANSITION - Уход со страницы
   ═══════════════════════════════════════════════════════════ */

.page-leaving {
    animation: pageOut 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* ═══════════════════════════════════════════════════════════
   RIPPLE ЭФФЕКТ - Улучшенный
   ═══════════════════════════════════════════════════════════ */

.btn-submit, .btn-buy, .btn-card {
    position: relative;
    overflow: hidden;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, 
        rgba(255, 255, 255, 0.3) 0%, 
        rgba(255, 255, 255, 0.1) 50%, 
        transparent 100%);
    transform: scale(0);
    animation: rippleAnim 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

@keyframes rippleAnim {
    to { 
        transform: scale(5);
        opacity: 0;
    }
}

/* ═══════════════════════════════════════════════════════════
   ДОПОЛНИТЕЛЬНЫЕ ЭФФЕКТЫ
   ═══════════════════════════════════════════════════════════ */

/* Плавающая анимация для аватара */
.avatar {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-8px) rotate(2deg);
    }
    75% {
        transform: translateY(-4px) rotate(-2deg);
    }
}

/* Анимация для badge */
.hero-badge {
    animation: badgeSlide 1s cubic-bezier(0.16, 1, 0.3, 1) 0.5s backwards;
}

@keyframes badgeSlide {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Градиентная анимация для фона карточек */
@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.gradient-bg {
    background: linear-gradient(135deg, #0a0a0a, #1a1a1a, #0a0a0a);
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
}

/* Мерцающие звезды для фона */
@keyframes twinkle {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

.star {
    animation: twinkle 3s ease-in-out infinite;
}

.star:nth-child(2n) {
    animation-delay: 0.5s;
    animation-duration: 4s;
}

.star:nth-child(3n) {
    animation-delay: 1s;
    animation-duration: 5s;
}

/* Эффект печатной машинки (опционально) */
@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

.typewriter {
    overflow: hidden;
    white-space: nowrap;
    animation: typing 2s steps(40) 1s forwards;
}

/* Scroll progress bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #fff, #888);
    transform-origin: left;
    z-index: 99;
    transition: transform 0.1s ease;
    pointer-events: none;
}

/* Parallax эффект */
.parallax {
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Hover эффект для изображений */
img {
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

img:hover {
    transform: scale(1.05);
    filter: brightness(1.1) contrast(1.1);
}

/* Анимация для scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0a0a0a;
}

::-webkit-scrollbar-thumb {
    background: #1e1e1e;
    border-radius: 4px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: #2a2a2a;
}

/* Анимация появления для списков */
.list-item {
    animation: listSlideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.list-item:nth-child(1) { animation-delay: 0.1s; }
.list-item:nth-child(2) { animation-delay: 0.2s; }
.list-item:nth-child(3) { animation-delay: 0.3s; }
.list-item:nth-child(4) { animation-delay: 0.4s; }
.list-item:nth-child(5) { animation-delay: 0.5s; }

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

/* Эффект свечения при наведении на текст */
.glow-text:hover {
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5),
                 0 0 40px rgba(255, 255, 255, 0.3);
    transition: text-shadow 0.3s ease;
}

/* Rotate анимация для иконок */
.rotate-on-hover {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.rotate-on-hover:hover {
    transform: rotate(360deg);
}

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

.shake {
    animation: shake 0.5s ease;
}

/* Fade in up для элементов */
.fade-in-up {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

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