/**
 * GreyNED Animations
 * All animation keyframes and movement definitions
 */

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

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes gridFlow {
    0% { transform: translate(0, 0); }
    100% { transform: translate(100px, 100px); }
}

@keyframes floatDrone {
    0%, 100% { 
        transform: translateY(0) rotate(0deg);
        opacity: 0.3;
    }
    50% { 
        transform: translateY(-30px) rotate(10deg);
        opacity: 0.8;
    }
}

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

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

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

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

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

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

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

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(0, 255, 136, 0.6);
    }
}

@keyframes blueShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes redShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes yellowShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Hero Section Animations */
.hero-title {
    animation: gradientShift 4s ease-in-out infinite;
}

.hero-grid {
    animation: gridFlow 20s linear infinite;
}

.floating-drone {
    position: absolute;
    width: 60px;
    height: 60px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    animation: floatDrone 8s ease-in-out infinite;
    opacity: 0.6;
}

.floating-drone:nth-child(1) {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.floating-drone:nth-child(2) {
    top: 60%;
    right: 10%;
    animation-delay: 2s;
}

.floating-drone:nth-child(3) {
    top: 80%;
    left: 30%;
    animation-delay: 4s;
}

/* Button Animations */
.cta-button::before,
.btn-primary::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.6s ease;
}

.cta-button:hover::before,
.btn-primary:hover::before {
    left: 100%;
}

/* Card Hover Animations */
.project-card::before,
.capability-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 136, 0.1), transparent);
    transition: left 0.8s ease;
}

.project-card:hover::before,
.capability-card:hover::before {
    left: 100%;
}

/* Loading Animations */
.loading-ring {
    animation: spin 1s linear infinite;
}

.loading-ring:nth-child(2) {
    animation-duration: 0.8s;
    animation-direction: reverse;
}

/* Staggered Animations for Grid Items */
.projects-grid .project-card:nth-child(1),
.capabilities-grid .capability-card:nth-child(1) {
    animation-delay: 0.1s;
}

.projects-grid .project-card:nth-child(2),
.capabilities-grid .capability-card:nth-child(2) {
    animation-delay: 0.2s;
}

.projects-grid .project-card:nth-child(3),
.capabilities-grid .capability-card:nth-child(3) {
    animation-delay: 0.3s;
}

.projects-grid .project-card:nth-child(4),
.capabilities-grid .capability-card:nth-child(4) {
    animation-delay: 0.4s;
}

.projects-grid .project-card:nth-child(5),
.capabilities-grid .capability-card:nth-child(5) {
    animation-delay: 0.5s;
}

.projects-grid .project-card:nth-child(6),
.capabilities-grid .capability-card:nth-child(6) {
    animation-delay: 0.6s;
}

/* Technology Grid Animation */
.tech-grid .tech-item {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}

.tech-grid .tech-item:nth-child(1) { animation-delay: 0.1s; }
.tech-grid .tech-item:nth-child(2) { animation-delay: 0.2s; }
.tech-grid .tech-item:nth-child(3) { animation-delay: 0.3s; }
.tech-grid .tech-item:nth-child(4) { animation-delay: 0.4s; }
.tech-grid .tech-item:nth-child(5) { animation-delay: 0.5s; }
.tech-grid .tech-item:nth-child(6) { animation-delay: 0.6s; }
.tech-grid .tech-item:nth-child(7) { animation-delay: 0.7s; }
.tech-grid .tech-item:nth-child(8) { animation-delay: 0.8s; }
.tech-grid .tech-item:nth-child(9) { animation-delay: 0.9s; }
.tech-grid .tech-item:nth-child(10) { animation-delay: 1.0s; }
.tech-grid .tech-item:nth-child(11) { animation-delay: 1.1s; }
.tech-grid .tech-item:nth-child(12) { animation-delay: 1.2s; }

/* Contact Form Animations */
.form-group {
    animation: fadeInLeft 0.6s ease forwards;
    opacity: 0;
}

.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.2s; }
.form-group:nth-child(3) { animation-delay: 0.3s; }
.form-group:nth-child(4) { animation-delay: 0.4s; }
.form-group:nth-child(5) { animation-delay: 0.5s; }
.form-group:nth-child(6) { animation-delay: 0.6s; }
.form-group:nth-child(7) { animation-delay: 0.7s; }
.form-group:nth-child(8) { animation-delay: 0.8s; }

.submit-btn.loading .btn-loader {
    animation: spin 1s linear infinite;
}

/* Hover Glow Effects */
.cta-button:hover {
    animation: glow 2s ease-in-out infinite;
}

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

.project-card:hover .project-tag {
    animation: pulse 1s ease-in-out infinite;
}

/* Navbar Animation */
.nav {
    animation: slideInDown 0.8s ease forwards;
}

/* Responsive Animation Adjustments */
@media (max-width: 768px) {
    .floating-drone {
        animation-duration: 6s;
    }
    
    .hero-grid {
        animation-duration: 15s;
    }
    
    /* Reduce animations on mobile for performance */
    .project-card::before,
    .capability-card::before {
        display: none;
    }
}

/* Accessibility - Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .hero-title,
    .hero-grid,
    .floating-drone,
    .loading-ring {
        animation: none !important;
    }
}