/* ENIOA Enhanced Animations & Effects */

/* Floating Animation for Hero Badge */
.animate-float {
    animation: floating 3s ease-in-out infinite;
}

@keyframes floating {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.badge-glow {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    filter: blur(20px);
    opacity: 0.5;
    z-index: -1;
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

/* Typing Effect */
.typing-effect {
    position: relative;
    display: inline-block;
}

.typing-effect::after {
    content: '|';
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Button Shine Effect */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Pulse Animation for CTA Button */
.pulse-animation {
    animation: pulse-scale 2s ease-in-out infinite;
}

@keyframes pulse-scale {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Hover Lift Effect */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

/* Counter Animation */
.counter-animate .stat-number {
    transition: all 0.5s ease;
}

/* Stat Icon Animation */
.stat-icon {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    animation: rotate-icon 10s linear infinite;
}

@keyframes rotate-icon {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Live Demo Preview */
.hero-demo-preview {
    margin-top: 3rem;
    animation: fade-in-up 1s ease-out 0.5s backwards;
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.demo-window {
    background: rgba(15, 15, 30, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    animation: window-entrance 0.8s ease-out;
}

@keyframes window-entrance {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.demo-header {
    padding: 1rem;
    background: rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
}

.demo-dots {
    display: flex;
    gap: 0.5rem;
}

.demo-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    animation: dot-pulse 1.5s ease-in-out infinite;
}

.demo-dots span:nth-child(1) { background: #ff5f56; animation-delay: 0s; }
.demo-dots span:nth-child(2) { background: #ffbd2e; animation-delay: 0.2s; }
.demo-dots span:nth-child(3) { background: #27c93f; animation-delay: 0.4s; }

@keyframes dot-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
}

.demo-title {
    font-weight: 600;
    font-size: 0.9rem;
}

.demo-chat {
    padding: 1.5rem;
    min-height: 120px;
}

.demo-message {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    margin-bottom: 0.75rem;
    max-width: 80%;
    animation: message-slide-in 0.4s ease-out;
}

@keyframes message-slide-in {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.demo-message.user {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    margin-left: auto;
    text-align: right;
}

.demo-message.ai {
    background: rgba(255,255,255,0.1);
    border: 1px solid var(--border);
}

.typing-indicator {
    display: inline-flex;
    gap: 4px;
    margin-right: 8px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    animation: typing-bounce 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) { animation-delay: 0s; }
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-10px); }
}

/* Floating Elements */
.floating-elements {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.float-icon {
    position: absolute;
    font-size: 2rem;
    opacity: 0.1;
    animation: float-around 20s infinite ease-in-out;
    animation-delay: var(--delay);
}

.float-icon:nth-child(1) { top: 10%; left: 10%; }
.float-icon:nth-child(2) { top: 20%; right: 15%; }
.float-icon:nth-child(3) { bottom: 15%; left: 20%; }
.float-icon:nth-child(4) { bottom: 25%; right: 10%; }
.float-icon:nth-child(5) { top: 50%; left: 5%; }

@keyframes float-around {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(30px, -30px) rotate(90deg); }
    50% { transform: translate(0, -60px) rotate(180deg); }
    75% { transform: translate(-30px, -30px) rotate(270deg); }
}

/* Section Tag */
.section-tag {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(255,255,255,0.1);
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    animation: tag-entrance 0.6s ease-out;
}

@keyframes tag-entrance {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Gradient Text Alt */
.gradient-text-alt {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {
    0%, 100% { filter: hue-rotate(0deg); }
    50% { filter: hue-rotate(20deg); }
}

/* Enhanced Feature Cards */
.hover-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.hover-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hover-card:hover::before {
    opacity: 1;
}

.hover-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 60px rgba(102, 126, 234, 0.3);
}

.feature-icon-wrapper {
    position: relative;
    margin-bottom: 1.5rem;
}

.icon-bg {
    position: absolute;
    inset: -10px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 50%;
    filter: blur(20px);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.hover-card:hover .icon-bg {
    opacity: 0.5;
    animation: icon-glow-pulse 2s ease-in-out infinite;
}

@keyframes icon-glow-pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.7; }
}

.feature-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.3rem 0.8rem;
    background: rgba(255,255,255,0.1);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
    animation: badge-pop 0.5s ease-out 0.3s backwards;
}

@keyframes badge-pop {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.special-card {
    position: relative;
    overflow: hidden;
}

.special-card::after {
    content: '✨';
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 1.5rem;
    animation: sparkle-twinkle 2s ease-in-out infinite;
}

@keyframes sparkle-twinkle {
    0%, 100% { opacity: 1; transform: scale(1) rotate(0deg); }
    50% { opacity: 0.5; transform: scale(1.2) rotate(180deg); }
}

/* Fade In Animation */
.animate-fade-in {
    animation: fade-in 1s ease-out 0.3s backwards;
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Stagger Animation for Feature Cards */
.features-grid .feature-card {
    animation: scale-in 0.5s ease-out backwards;
}

.features-grid .feature-card:nth-child(1) { animation-delay: 0.1s; }
.features-grid .feature-card:nth-child(2) { animation-delay: 0.2s; }
.features-grid .feature-card:nth-child(3) { animation-delay: 0.3s; }
.features-grid .feature-card:nth-child(4) { animation-delay: 0.4s; }
.features-grid .feature-card:nth-child(5) { animation-delay: 0.5s; }
.features-grid .feature-card:nth-child(6) { animation-delay: 0.6s; }
.features-grid .feature-card:nth-child(7) { animation-delay: 0.7s; }
.features-grid .feature-card:nth-child(8) { animation-delay: 0.8s; }

@keyframes scale-in {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Enhanced Stats */
.stat {
    position: relative;
}

.stat::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    transition: width 0.5s ease;
}

.stat:hover::after {
    width: 100%;
}

/* Form Enhancements */
.registration-form {
    animation: form-entrance 0.8s ease-out;
}

@keyframes form-entrance {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-group {
    animation: field-pop 0.4s ease-out backwards;
}

.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.15s; }
.form-group:nth-child(3) { animation-delay: 0.2s; }
.form-group:nth-child(4) { animation-delay: 0.25s; }
.form-group:nth-child(5) { animation-delay: 0.3s; }

@keyframes field-pop {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    transform: scale(1.02);
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
}

/* Success Message Animation */
.success-message {
    animation: success-pop 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes success-pop {
    0% {
        opacity: 0;
        transform: scale(0.5) rotate(-5deg);
    }
    50% {
        transform: scale(1.1) rotate(2deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

/* Loading State */
.btn-submit.loading {
    pointer-events: none;
    position: relative;
}

.btn-submit.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Scroll Reveal Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Mobile Enhancements */
@media (max-width: 768px) {
    .floating-elements {
        display: none;
    }
    
    .hero-demo-preview {
        margin-top: 2rem;
    }
    
    .demo-message {
        max-width: 90%;
    }
    
    .float-icon {
        font-size: 1.5rem;
    }
}
