/**
 * AMMOcoin Animation Styles
 * Version: 1.1.0 Emergency Release
 *
 * Custom animations and transitions for AMMOcoin Astra website
 * Maintains original Mobirise feel with enhanced interactions
 */

/* Base Animation Classes */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-on-scroll.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Fade In Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide Animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scale Animations */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Specific Component Animations */

/* Hero Section Animations */
.hero-section {
    animation: fadeIn 1s ease-out;
}

.hero-title {
    animation: fadeInUp 1s ease-out 0.2s both;
}

.hero-subtitle {
    animation: fadeInUp 1s ease-out 0.4s both;
}

.hero-description {
    animation: fadeInUp 1s ease-out 0.6s both;
}

.hero-buttons {
    animation: fadeInUp 1s ease-out 0.8s both;
}

/* Card Animations */
.feature-card,
.doc-card,
.guide-card,
.download-card {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-card.animate-in,
.doc-card.animate-in,
.guide-card.animate-in,
.download-card.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger animations for grids */
.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; }

/* Button Hover Animations */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

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

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(50, 205, 50, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #32cd32 0%, #28a428 100%);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #4a4a4a 0%, #2a2a2a 100%);
    color: #32cd32;
}

/* Download Button Animations */
.download-button {
    transition: all 0.3s ease;
}

.download-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(50, 205, 50, 0.4);
}

.download-button:hover .download-arrow {
    animation: bounce 0.6s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-3px);
    }
    60% {
        transform: translateY(-1px);
    }
}

/* Statistics Counter Animation */
.stat-value {
    transition: all 0.3s ease;
}

.stat-value.updated {
    animation: pulse 1s ease-in-out;
    color: #32cd32;
}

/* Emergency Banner Animations */
.emergency-banner {
    animation: slideDown 0.5s ease-out;
}

.emergency-notification {
    animation: slideDown 0.5s ease-out;
}

/* Modal Animations */
.security-reminder-modal {
    animation: fadeIn 0.3s ease-out;
}

.modal-container {
    animation: scaleIn 0.3s ease-out;
}

/* Loading Animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #333;
    border-radius: 50%;
    border-top-color: #32cd32;
    animation: spin 1s ease-in-out infinite;
}

/* Progress Bar Animation */
@keyframes progressFill {
    from {
        width: 0%;
    }
    to {
        width: var(--progress-width, 100%);
    }
}

.progress-bar {
    animation: progressFill 2s ease-out;
}

/* Tooltip Animations */
.tooltip {
    animation: fadeIn 0.2s ease-out;
}

/* Message Notification Animations */
.message-notification {
    animation: slideDown 0.3s ease-out;
}

/* Simplicity Page Specific Animations */
.demo-step {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.demo-step.animate-in {
    opacity: 1;
    transform: scale(1);
}

.demo-arrow {
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.3s ease;
}

.demo-arrow.animate-in {
    opacity: 1;
    transform: translateX(0);
}

.comparison-row {
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.5s ease;
}

.comparison-row.animate-in {
    opacity: 1;
    transform: translateX(0);
}

/* Step Cards Animation */
.step-card {
    opacity: 0;
    transform: translateY(40px) rotateY(10deg);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.step-card.animate-in {
    opacity: 1;
    transform: translateY(0) rotateY(0);
}

.step-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 35px rgba(50, 205, 50, 0.2);
}

/* Navigation Menu Animations */
.mobile-menu {
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu.active {
    transform: translateX(0);
}

.mobile-menu li {
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.3s ease;
}

.mobile-menu.active li {
    opacity: 1;
    transform: translateX(0);
}

.mobile-menu.active li:nth-child(1) { transition-delay: 0.1s; }
.mobile-menu.active li:nth-child(2) { transition-delay: 0.15s; }
.mobile-menu.active li:nth-child(3) { transition-delay: 0.2s; }
.mobile-menu.active li:nth-child(4) { transition-delay: 0.25s; }
.mobile-menu.active li:nth-child(5) { transition-delay: 0.3s; }

/* Scroll Progress Indicator */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #32cd32 0%, #28a428 100%);
    z-index: 9999;
    transition: width 0.1s ease;
}

/* Parallax Elements */
.parallax-element {
    transition: transform 0.1s ease-out;
}

/* Hover Effects for Interactive Elements */
.interactive-hover {
    transition: all 0.3s ease;
}

.interactive-hover:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

/* Focus Animations */
.focus-animation:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(50, 205, 50, 0.3);
    animation: pulse 0.6s ease-in-out;
}

/* Text Reveal Animation */
@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

.typewriter {
    overflow: hidden;
    border-right: 2px solid #32cd32;
    white-space: nowrap;
    animation: typewriter 2s steps(40, end), blink 0.75s step-end infinite;
}

@keyframes blink {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: #32cd32;
    }
}

/* Responsive Animation Adjustments */
@media (max-width: 768px) {
    /* Reduce motion for mobile devices */
    .animate-on-scroll {
        transform: translateY(15px);
        transition-duration: 0.4s;
    }

    .btn:hover {
        transform: none;
    }

    .step-card:hover {
        transform: none;
    }

    /* Disable parallax on mobile */
    .parallax-element {
        transform: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    /* Respect user's motion preferences */
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .animate-on-scroll {
        opacity: 1;
        transform: none;
    }
}

/* Dark/Light Theme Transitions */
.theme-transition {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Performance Optimizations */
.gpu-accelerated {
    transform: translateZ(0);
    will-change: transform;
}

/* Animation States */
.pause-animations * {
    animation-play-state: paused !important;
}

.resume-animations * {
    animation-play-state: running !important;
}