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

@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes grid-move {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(50px, 50px);
    }
}

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

@keyframes radarPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.7;
    }
}

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

@keyframes glitchEffect {
    0%, 90%, 100% {
        transform: translate(0);
    }
    10% {
        transform: translate(-2px, -2px);
    }
    20% {
        transform: translate(2px, 2px);
    }
    30% {
        transform: translate(-2px, 2px);
    }
    40% {
        transform: translate(2px, -2px);
    }
    50% {
        transform: translate(-2px, -2px);
    }
    60% {
        transform: translate(2px, 2px);
    }
    70% {
        transform: translate(-2px, 2px);
    }
    80% {
        transform: translate(2px, -2px);
    }
}

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

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

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

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(50px);
    }
    50% {
        opacity: 1;
        transform: scale(1.05) translateY(-10px);
    }
    70% {
        transform: scale(0.9) translateY(0);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Radar Animation System */
.radar-animation {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 400px;
    opacity: 0.6;
}

.radar-circle {
    position: absolute;
    border: 1px solid var(--color-radar-primary);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.radar-circle-1 {
    width: 100px;
    height: 100px;
    animation: radarPulse 3s ease-in-out infinite;
}

.radar-circle-2 {
    width: 200px;
    height: 200px;
    animation: radarPulse 3s ease-in-out infinite 0.5s;
}

.radar-circle-3 {
    width: 300px;
    height: 300px;
    animation: radarPulse 3s ease-in-out infinite 1s;
}

.radar-sweep {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--color-radar-sweep), var(--color-radar-primary));
    transform-origin: 0 50%;
    animation: radarSweep 4s linear infinite;
}

.radar-dot {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--color-radar-secondary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--color-radar-secondary);
}

.radar-dot-1 {
    top: 30%;
    left: 60%;
    animation: dotBlink 2s infinite;
}

.radar-dot-2 {
    top: 70%;
    left: 40%;
    animation: dotBlink 2s infinite 0.7s;
}

.radar-dot-3 {
    top: 50%;
    left: 75%;
    animation: dotBlink 2s infinite 1.4s;
}

/* Glitch Effect */
.glitch-effect {
    position: relative;
    display: inline-block;
}

.glitch-effect:hover {
    animation: glitchEffect 0.5s;
}

.glitch-effect::before,
.glitch-effect::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
}

.glitch-effect::before {
    color: #ff0000;
    animation: glitchEffect 0.5s infinite;
    clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
}

.glitch-effect::after {
    color: #00ffff;
    animation: glitchEffect 0.5s infinite reverse;
    clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
}

.glitch-effect:hover::before,
.glitch-effect:hover::after {
    opacity: 0.8;
}

/* Loading Animations */
.loading-pulse {
    animation: radarPulse 2s ease-in-out infinite;
}

.loading-spin {
    animation: radarSweep 1s linear infinite;
}

/* Staggered Animations */
.stagger-animation > * {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
}

.stagger-animation > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-animation > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-animation > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-animation > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-animation > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-animation > *:nth-child(6) { animation-delay: 0.6s; }

/* Hover Animations */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.5);
}

/* Scroll Animations */
.scroll-fade {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

.scroll-slide-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

.scroll-slide-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

/* Number Counter Animation */
.counter-number {
    animation: numberCount 2s ease-out;
}

/* Particle System */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--color-accent);
    border-radius: 50%;
    opacity: 0.7;
}

/* Matrix-style Background */
.matrix-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.1;
}

.matrix-column {
    position: absolute;
    top: -100%;
    font-family: var(--font-primary);
    font-size: 14px;
    color: var(--color-success);
    animation: matrix-fall linear infinite;
}

@keyframes matrix-fall {
    to {
        top: 100%;
    }
}

/* Responsive Animation Controls */
@media (prefers-reduced-motion: reduce) {
    *,
    ::before,
    ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (max-width: 768px) {
    .radar-animation {
        width: 300px;
        height: 300px;
    }
    
    .radar-circle-3 {
        width: 250px;
        height: 250px;
    }
    
    .radar-sweep {
        width: 125px;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--color-accent);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-success);
}


/* Military Equipment Background */
.military-background {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    opacity: 0.2; /* Subtle but visible */
    background: url('../images/military-background.jpg') no-repeat center right;
    background-size: cover;
    background-attachment: fixed;
    /* Apply cyan tint to match website colors */
    filter: 
        sepia(100%) 
        saturate(200%) 
        hue-rotate(158deg) 
        brightness(0.7) 
        contrast(1.3);
    animation: militaryMove 12s ease-in-out infinite alternate;
    z-index: 0;
}

@keyframes militaryMove {
    0% {
        transform: scale(1) translateX(0px);
        opacity: 0.2;
    }
    100% {
        transform: scale(1.08) translateX(-40px);
        opacity: 0.35;
    }
}

/* Ensure radar animation stays on top of military background */
.radar-animation {
    z-index: 1;
}

/* Hero content stays on top */
.hero-content {
    position: relative;
    z-index: 3;
}

/* Responsive military background */
@media (max-width: 768px) {
    .military-background {
        opacity: 0.15; /* More subtle on mobile */
        background-position: center center;
        background-attachment: scroll; /* Better performance on mobile */
    }
    
    @keyframes militaryMove {
        0% {
            transform: scale(1) translateY(0px);
            opacity: 0.15;
        }
        100% {
            transform: scale(1.05) translateY(-20px);
            opacity: 0.25;
        }
    }
}

/* Dark overlay to ensure text readability */
.hero-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg, 
        rgba(15, 20, 25, 0.7) 0%, 
        rgba(26, 35, 50, 0.5) 50%, 
        rgba(15, 20, 25, 0.8) 100%
    );
    z-index: 2;
}
