/* Background Animations */
.hero-background {
    position: relative;
    overflow: hidden;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 102, 255, 0.3) 0%, transparent 70%);
    filter: blur(40px);
    animation: float 6s ease-in-out infinite;
}

.orb-1 {
    width: 300px;
    height: 300px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.orb-2 {
    width: 200px;
    height: 200px;
    top: 60%;
    right: 20%;
    background: radial-gradient(circle, rgba(0, 204, 255, 0.25) 0%, transparent 70%);
    animation-delay: 2s;
}

.orb-3 {
    width: 150px;
    height: 150px;
    bottom: 20%;
    left: 60%;
    background: radial-gradient(circle, rgba(102, 51, 255, 0.2) 0%, transparent 70%);
    animation-delay: 4s;
}

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

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

/* Terminal Demo Animations */
.terminal-demo {
    animation: fadeInUp 0.8s ease-out;
}

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

/* Scroll-triggered animations - simplified to prevent hiding content */
.fade-in {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.3s ease-out;
}

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

/* Ensure hero section is always visible */
.hero,
.hero * {
    opacity: 1 !important;
    transform: none !important;
}

/* Ensure all sections are always visible */
section {
    opacity: 1 !important;
    transform: none !important;
}

.slide-in-left {
    opacity: 1;
    transform: translateX(0);
    transition: all 0.3s ease-out;
}

.slide-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-right {
    opacity: 1;
    transform: translateX(0);
    transition: all 0.3s ease-out;
}

.slide-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Service status animations */
.service-status.running::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
    margin-right: 0.5rem;
    animation: pulse 2s infinite;
}

/* Feature card hover effects */
.feature-card {
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 102, 255, 0.1) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

/* Button hover animations */
.btn {
    position: relative;
    overflow: hidden;
}

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

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

/* Stagger animations for grids - removed automatic delays to prevent flickering */
.features-grid .feature-card,
.examples-grid .example-card {
    opacity: 1;
    transform: none;
}

/* Progress bar animation */
@keyframes progressLoad {
    0% { width: 0%; }
    100% { width: 100%; }
}

.progress-bar {
    height: 2px;
    background: linear-gradient(90deg, #0066ff, #00ccff);
    animation: progressLoad 2s ease-out;
}

/* Loading dots animation */
.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(5, end) infinite;
}

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

/* Hover effects for service items */
.service-item {
    transition: all 0.2s ease;
}

.service-item:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(4px);
}

/* Glow effect for active elements */
.glow {
    box-shadow: 0 0 20px rgba(0, 102, 255, 0.4);
}

/* Smooth scroll animations */
html {
    scroll-behavior: smooth;
}

/* Parallax effect for background orbs */
@media (prefers-reduced-motion: no-preference) {
    .gradient-orb {
        animation: float 8s ease-in-out infinite;
    }
    
    .orb-1 { animation-duration: 8s; }
    .orb-2 { animation-duration: 10s; }
    .orb-3 { animation-duration: 12s; }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .gradient-orb,
    .terminal-demo,
    .fade-in,
    .slide-in-left,
    .slide-in-right,
    .feature-card,
    .example-card {
        animation: none;
        transition: none;
    }
    
    .status-dot {
        animation: none;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* Mobile-specific animations */
@media (max-width: 768px) {
    .gradient-orb {
        display: none;
    }
    
    .hero-content {
        animation: fadeInUp 0.8s ease-out;
    }
    
    .features-grid .feature-card,
    .examples-grid .example-card {
        animation-delay: 0s;
    }
}

/* Dark mode transitions */
@media (prefers-color-scheme: dark) {
    * {
        transition: background-color 0.3s ease, color 0.3s ease;
    }
}

/* Focus animations for accessibility */
.btn:focus,
.nav-link:focus,
.copy-btn:focus {
    outline: 2px solid #00ccff;
    outline-offset: 2px;
    transition: outline 0.2s ease;
}

/* Loading state animations */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Code block syntax highlighting animation */
.code-block {
    position: relative;
}

.code-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, #00ccff, #0066ff);
    border-radius: 0 2px 2px 0;
    animation: codeHighlight 2s ease-in-out infinite alternate;
}

@keyframes codeHighlight {
    0% { opacity: 0.5; transform: scaleY(0.8); }
    100% { opacity: 1; transform: scaleY(1); }
}

/* Interactive terminal cursor */
.terminal-cursor {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background: #00ccff;
    animation: blink 1s infinite;
    margin-left: 2px;
}

/* Smooth entrance for stats */
.hero-stats .stat {
    animation: fadeInUp 0.6s ease-out both;
}

.hero-stats .stat:nth-child(1) { animation-delay: 0.2s; }
.hero-stats .stat:nth-child(2) { animation-delay: 0.4s; }
.hero-stats .stat:nth-child(3) { animation-delay: 0.6s; }

/* Success animation for copy button */
.copy-btn.copied {
    color: #10b981;
    transform: scale(1.1);
    transition: all 0.2s ease;
}

.copy-btn.copied::after {
    content: '✓';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    animation: fadeOut 1s ease-out forwards;
}

@keyframes fadeOut {
    0% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}