/* Animation Keyframes */
@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes dataStream {
    from { background-position: 0 0; }
    to { background-position: 0 1000px; }
}

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

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

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

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

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

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

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

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Animation Classes */
.pulse-animation {
    animation: pulse 2s infinite ease-in-out;
}

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

.fade-in {
    animation: fadeIn 1s ease-out forwards;
}

.slide-in-right {
    animation: slideInRight 0.5s ease-out forwards;
}

.slide-in-left {
    animation: slideInLeft 0.5s ease-out forwards;
}

.slide-in-up {
    animation: slideInUp 0.5s ease-out forwards;
}

.blink-animation {
    animation: blink 2s infinite;
}

/* Staggered Animations */
.stagger-fade-in > * {
    opacity: 0;
}

.stagger-fade-in > *:nth-child(1) { animation: fadeIn 0.5s 0.1s ease-out forwards; }
.stagger-fade-in > *:nth-child(2) { animation: fadeIn 0.5s 0.2s ease-out forwards; }
.stagger-fade-in > *:nth-child(3) { animation: fadeIn 0.5s 0.3s ease-out forwards; }
.stagger-fade-in > *:nth-child(4) { animation: fadeIn 0.5s 0.4s ease-out forwards; }
.stagger-fade-in > *:nth-child(5) { animation: fadeIn 0.5s 0.5s ease-out forwards; }
.stagger-fade-in > *:nth-child(6) { animation: fadeIn 0.5s 0.6s ease-out forwards; }
.stagger-fade-in > *:nth-child(7) { animation: fadeIn 0.5s 0.7s ease-out forwards; }
.stagger-fade-in > *:nth-child(8) { animation: fadeIn 0.5s 0.8s ease-out forwards; }

/* Page Transition Animations */
.page-transition-out {
    animation: fadeOut 0.5s ease-out forwards;
}

.page-transition-in {
    animation: fadeIn 0.5s ease-out forwards;
}

/* Robot Animation */
.robot-wave {
    transform-origin: 70% 80%;
    animation: wave 2s infinite ease-in-out;
}

@keyframes wave {
    0% { transform: rotate(0deg); }
    10% { transform: rotate(14deg); }
    20% { transform: rotate(-8deg); }
    30% { transform: rotate(14deg); }
    40% { transform: rotate(-4deg); }
    50% { transform: rotate(10deg); }
    60% { transform: rotate(0deg); }
    100% { transform: rotate(0deg); }
}

/* Typing Animation */
.typing-animation::after {
    content: '|';
    animation: blink 1s infinite;
}

/* Highlight Animation */
.highlight-animation {
    position: relative;
}

.highlight-animation::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30%;
    background-color: rgba(255, 102, 0, 0.3);
    z-index: -1;
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.5s ease-out;
}

.highlight-animation:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

/* Button Animations */
.btn-pulse {
    animation: btnPulse 2s infinite;
}

@keyframes btnPulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 102, 0, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255, 102, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 102, 0, 0); }
}

/* Loading Animation */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 102, 204, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s infinite linear;
}

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

/* Progress Bar Animation */
.progress-bar {
    height: 4px;
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    width: 0%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: width 0.3s ease-out;
}

/* Scroll Animation */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 50px;
    border: 2px solid white;
    border-radius: 15px;
}

.scroll-indicator::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    width: 6px;
    height: 6px;
    margin-left: -3px;
    background-color: white;
    border-radius: 50%;
    animation: scrollDown 2s infinite;
}

@keyframes scrollDown {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(20px); opacity: 0; }
}

/* 3D Card Effect */
.card-3d {
    perspective: 1000px;
    transform-style: preserve-3d;
    transition: transform 0.6s;
}

.card-3d:hover {
    transform: rotateY(10deg) rotateX(5deg);
}

.card-3d::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 50%);
    pointer-events: none;
    z-index: 1;
}

/* Parallax Effect */
.parallax-container {
    overflow: hidden;
    position: relative;
}

.parallax-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: transform 0.1s ease-out;
}

.parallax-layer-1 { z-index: 1; }
.parallax-layer-2 { z-index: 2; }
.parallax-layer-3 { z-index: 3; }

/* Data Visualization Animation */
@keyframes dataGrow {
    from { height: 0; }
    to { height: var(--target-height); }
}

.data-bar {
    background: linear-gradient(to top, var(--primary-color), var(--secondary-color));
    width: 30px;
    border-radius: 4px 4px 0 0;
    margin: 0 5px;
    animation: dataGrow 1.5s ease-out forwards;
    opacity: 0.8;
}

.data-bar:hover {
    opacity: 1;
    filter: brightness(1.2);
}

/* Robot Movement Animation */
@keyframes robotMove {
    0% { transform: translateX(-50px); opacity: 0; }
    10% { transform: translateX(0); opacity: 1; }
    20% { transform: translateY(-10px); }
    30% { transform: translateY(0); }
    40% { transform: rotate(10deg); }
    50% { transform: rotate(-10deg); }
    60% { transform: rotate(0); }
    70% { transform: scale(1.1); }
    80% { transform: scale(0.9); }
    90% { transform: scale(1); }
    100% { transform: translateX(50px); opacity: 0; }
}

.robot-move {
    animation: robotMove 5s ease-in-out;
}

/* Scroll-triggered animations */
.pre-animation {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

/* Staggered animation for list items */
.feature-list li.pre-animation:nth-child(1) { transition-delay: 0.1s; }
.feature-list li.pre-animation:nth-child(2) { transition-delay: 0.2s; }
.feature-list li.pre-animation:nth-child(3) { transition-delay: 0.3s; }
.feature-list li.pre-animation:nth-child(4) { transition-delay: 0.4s; }
.feature-list li.pre-animation:nth-child(5) { transition-delay: 0.5s; }
.feature-list li.pre-animation:nth-child(6) { transition-delay: 0.6s; }