/* RAI² Page - Modern AI Animations & Styles */

/* ============================================
   FONT DEFINITIONS
   ============================================ */
.ai-font-heading {
    font-family: 'Space Grotesk', sans-serif;
}

.ai-font-body {
    font-family: 'Inter', sans-serif;
}

.ai-font-mono {
    font-family: 'JetBrains Mono', monospace;
}

/* ============================================
   GLASSMORPHISM EFFECTS
   ============================================ */
.glass-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(155, 89, 182, 0.3);
    transform: translateY(-5px);
    box-shadow: 0 25px 50px -12px rgba(155, 89, 182, 0.25);
}

.glass-card-strong {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 24px;
}

/* ============================================
   GLOW EFFECTS
   ============================================ */
.glow-purple {
    box-shadow: 0 0 30px rgba(155, 89, 182, 0.3);
}

.glow-purple-hover:hover {
    box-shadow: 0 0 40px rgba(155, 89, 182, 0.5), 0 0 80px rgba(155, 89, 182, 0.2);
}

.text-glow {
    text-shadow: 0 0 30px rgba(155, 89, 182, 0.5);
}

/* ============================================
   ANIMATED GRADIENT BACKGROUND
   ============================================ */
.gradient-animate {
    background: linear-gradient(-45deg, #0a0a1a, #1a0a2e, #0a1a2e, #1a1a3e);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

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

/* Mesh gradient overlay */
.mesh-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 20% 30%, rgba(155, 89, 182, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(29, 62, 115, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(76, 175, 80, 0.05) 0%, transparent 60%);
    pointer-events: none;
}

/* ============================================
   TYPEWRITER EFFECT
   ============================================ */
.typewriter {
    overflow: hidden;
    border-right: 3px solid rgba(155, 89, 182, 0.8);
    white-space: nowrap;
    animation: 
        typing 3s steps(40, end),
        blink-caret 0.75s step-end infinite;
}

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

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: rgba(155, 89, 182, 0.8); }
}

/* ============================================
   SCROLL REVEAL ANIMATIONS
   ============================================ */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-scale.active {
    opacity: 1;
    transform: scale(1);
}

/* Staggered animations for children */
.stagger-children > * {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.stagger-children.active > *:nth-child(1) { transition-delay: 0.1s; opacity: 1; transform: translateY(0); }
.stagger-children.active > *:nth-child(2) { transition-delay: 0.2s; opacity: 1; transform: translateY(0); }
.stagger-children.active > *:nth-child(3) { transition-delay: 0.3s; opacity: 1; transform: translateY(0); }
.stagger-children.active > *:nth-child(4) { transition-delay: 0.4s; opacity: 1; transform: translateY(0); }
.stagger-children.active > *:nth-child(5) { transition-delay: 0.5s; opacity: 1; transform: translateY(0); }
.stagger-children.active > *:nth-child(6) { transition-delay: 0.6s; opacity: 1; transform: translateY(0); }

/* ============================================
   FLOATING ANIMATION
   ============================================ */
.float {
    animation: float 6s ease-in-out infinite;
}

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

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

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

/* ============================================
   PULSE ANIMATIONS
   ============================================ */
.pulse {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.pulse-glow {
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(155, 89, 182, 0.3); }
    50% { box-shadow: 0 0 40px rgba(155, 89, 182, 0.6); }
}

/* ============================================
   SHIMMER EFFECT (for CTAs)
   ============================================ */
.shimmer {
    position: relative;
    overflow: hidden;
}

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

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

/* ============================================
   3D TILT HOVER EFFECT
   ============================================ */
.tilt-card {
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

.tilt-card:hover {
    transform: perspective(1000px) rotateX(5deg) rotateY(-5deg);
}

/* ============================================
   PARTICLE DOTS BACKGROUND
   ============================================ */
.particle-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(155, 89, 182, 0.3);
    border-radius: 50%;
    animation: particleFloat 20s infinite;
}

@keyframes particleFloat {
    0%, 100% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% {
        transform: translateY(-100vh) rotate(720deg);
        opacity: 0;
    }
}

/* ============================================
   NUMBER COUNTER STYLING
   ============================================ */
.counter-number {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* ============================================
   BUTTON EFFECTS
   ============================================ */
.btn-ai {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #9B59B6, #8E44AD);
    border: none;
    padding: 15px 35px;
    border-radius: 12px;
    color: white;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-ai:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(155, 89, 182, 0.4);
}

.btn-ai-outline {
    background: transparent;
    border: 2px solid rgba(155, 89, 182, 0.5);
    padding: 13px 33px;
}

.btn-ai-outline:hover {
    background: rgba(155, 89, 182, 0.1);
    border-color: #9B59B6;
}

/* ============================================
   GRADIENT TEXT
   ============================================ */
.gradient-text {
    background: linear-gradient(135deg, #9B59B6, #E74C3C, #9B59B6);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientText 5s ease infinite;
}

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

/* ============================================
   GRID BACKGROUND PATTERN
   ============================================ */
.grid-pattern {
    background-image: 
        linear-gradient(rgba(155, 89, 182, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(155, 89, 182, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 768px) {
    .typewriter {
        white-space: normal;
        border-right: none;
        animation: none;
    }
    
    .glass-card:hover {
        transform: none;
    }
    
    .tilt-card:hover {
        transform: none;
    }
}

/* ============================================
   REDUCED MOTION PREFERENCE
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .typewriter,
    .float,
    .pulse,
    .shimmer::after,
    .gradient-animate,
    .particle {
        animation: none;
    }
    
    .reveal,
    .reveal-left,
    .reveal-right,
    .reveal-scale {
        opacity: 1;
        transform: none;
    }
}

/* ============================================
   SECUREDX - CYBERSECURITY ANIMATIONS
   ============================================ */

/* Matrix rain effect background */
.cyber-matrix-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
}

.matrix-column {
    position: absolute;
    top: -100%;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 14px;
    color: #00FF88;
    text-shadow: 0 0 10px #00FF88;
    writing-mode: vertical-rl;
    animation: matrixFall linear infinite;
    opacity: 0.3;
}

@keyframes matrixFall {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }
    10% {
        opacity: 0.3;
    }
    90% {
        opacity: 0.3;
    }
    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}

/* Scanning line effect */
.cyber-scan-line {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #00FF88, transparent);
    animation: scanLine 4s linear infinite;
    opacity: 0.5;
}

@keyframes scanLine {
    0% { top: 0; }
    100% { top: 100%; }
}

/* Glitch text effect */
.cyber-glitch {
    position: relative;
    animation: glitch 3s infinite;
}

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

.cyber-glitch::before {
    left: 2px;
    text-shadow: -2px 0 #ff0000;
    clip: rect(24px, 550px, 90px, 0);
    animation: glitchAnim 2s infinite linear alternate-reverse;
}

.cyber-glitch::after {
    left: -2px;
    text-shadow: -2px 0 #00ffff;
    clip: rect(85px, 550px, 140px, 0);
    animation: glitchAnim2 2s infinite linear alternate-reverse;
}

@keyframes glitch {
    0%, 90%, 100% { opacity: 1; }
    91% { opacity: 0.8; }
    92% { opacity: 1; }
    93% { opacity: 0.9; }
}

@keyframes glitchAnim {
    0% { clip: rect(42px, 9999px, 44px, 0); }
    5% { clip: rect(12px, 9999px, 59px, 0); }
    10% { clip: rect(48px, 9999px, 29px, 0); }
    15% { clip: rect(42px, 9999px, 73px, 0); }
    20% { clip: rect(63px, 9999px, 27px, 0); }
    25% { clip: rect(34px, 9999px, 55px, 0); }
    30% { clip: rect(86px, 9999px, 73px, 0); }
    35% { clip: rect(20px, 9999px, 20px, 0); }
    40% { clip: rect(26px, 9999px, 60px, 0); }
    45% { clip: rect(25px, 9999px, 66px, 0); }
    50% { clip: rect(57px, 9999px, 98px, 0); }
    55% { clip: rect(5px, 9999px, 46px, 0); }
    60% { clip: rect(82px, 9999px, 31px, 0); }
    65% { clip: rect(54px, 9999px, 27px, 0); }
    70% { clip: rect(28px, 9999px, 99px, 0); }
    75% { clip: rect(45px, 9999px, 69px, 0); }
    80% { clip: rect(23px, 9999px, 85px, 0); }
    85% { clip: rect(54px, 9999px, 84px, 0); }
    90% { clip: rect(45px, 9999px, 47px, 0); }
    95% { clip: rect(37px, 9999px, 20px, 0); }
    100% { clip: rect(4px, 9999px, 91px, 0); }
}

@keyframes glitchAnim2 {
    0% { clip: rect(65px, 9999px, 100px, 0); }
    5% { clip: rect(52px, 9999px, 74px, 0); }
    10% { clip: rect(79px, 9999px, 85px, 0); }
    15% { clip: rect(75px, 9999px, 5px, 0); }
    20% { clip: rect(67px, 9999px, 61px, 0); }
    25% { clip: rect(14px, 9999px, 79px, 0); }
    30% { clip: rect(1px, 9999px, 66px, 0); }
    35% { clip: rect(86px, 9999px, 30px, 0); }
    40% { clip: rect(23px, 9999px, 98px, 0); }
    45% { clip: rect(85px, 9999px, 72px, 0); }
    50% { clip: rect(71px, 9999px, 75px, 0); }
    55% { clip: rect(2px, 9999px, 48px, 0); }
    60% { clip: rect(30px, 9999px, 16px, 0); }
    65% { clip: rect(59px, 9999px, 50px, 0); }
    70% { clip: rect(41px, 9999px, 62px, 0); }
    75% { clip: rect(2px, 9999px, 82px, 0); }
    80% { clip: rect(47px, 9999px, 73px, 0); }
    85% { clip: rect(3px, 9999px, 27px, 0); }
    90% { clip: rect(26px, 9999px, 55px, 0); }
    95% { clip: rect(42px, 9999px, 25px, 0); }
    100% { clip: rect(38px, 9999px, 49px, 0); }
}

/* Cyber grid moving */
.cyber-grid {
    background-image: 
        linear-gradient(rgba(0, 255, 136, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 136, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% { background-position: 0 0; }
    100% { background-position: 40px 40px; }
}

/* Terminal typing cursor */
.cyber-cursor {
    display: inline-block;
    width: 10px;
    height: 20px;
    background: #00FF88;
    animation: cursorBlink 1s step-end infinite;
    vertical-align: middle;
    margin-left: 2px;
}

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

/* Data stream effect */
.cyber-data-stream {
    position: absolute;
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, 
        transparent 0%,
        #00FF88 20%,
        #00FF88 80%,
        transparent 100%
    );
    animation: dataStream 2s linear infinite;
    opacity: 0.3;
}

@keyframes dataStream {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}

/* Hexagon background pattern */
.cyber-hex-pattern {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='49' viewBox='0 0 28 49'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%2300ff88' fill-opacity='0.03'%3E%3Cpath d='M13.99 9.25l13 7.5v15l-13 7.5L1 31.75v-15l12.99-7.5zM3 17.9v12.7l10.99 6.34 11-6.35V17.9l-11-6.34L3 17.9zM0 15l12.98-7.5V0h-2v6.35L0 12.69v2.3zm0 18.5L12.98 41v8h-2v-6.85L0 35.81v-2.3zM15 0v7.5L27.99 15H28v-2.31h-.01L17 6.35V0h-2zm0 49v-8l12.99-7.5H28v2.31h-.01L17 42.15V49h-2z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* Shield pulse animation */
.cyber-shield-pulse {
    animation: shieldPulse 2s ease-in-out infinite;
}

@keyframes shieldPulse {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 40px rgba(0, 255, 136, 0.6), 0 0 60px rgba(0, 255, 136, 0.3);
        transform: scale(1.02);
    }
}

/* Lock icon animation */
.cyber-lock-secure {
    animation: lockSecure 3s ease-in-out infinite;
}

@keyframes lockSecure {
    0%, 100% { color: #00FF88; }
    50% { color: #00D4FF; text-shadow: 0 0 20px rgba(0, 212, 255, 0.5); }
}

/* Binary code background */
.cyber-binary {
    position: absolute;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: rgba(0, 255, 136, 0.1);
    white-space: nowrap;
    animation: binaryScroll 30s linear infinite;
}

@keyframes binaryScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Radar sweep effect */
.cyber-radar {
    position: relative;
    overflow: hidden;
}

.cyber-radar::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        rgba(0, 255, 136, 0.3) 30deg,
        transparent 60deg
    );
    transform-origin: 0 0;
    animation: radarSweep 4s linear infinite;
}

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

/* Security alert flash */
.cyber-alert {
    animation: alertFlash 2s ease-in-out infinite;
}

@keyframes alertFlash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Terminal window glow */
.cyber-terminal {
    box-shadow: 
        0 0 20px rgba(0, 255, 136, 0.2),
        inset 0 0 60px rgba(0, 255, 136, 0.03);
    border: 1px solid rgba(0, 255, 136, 0.2);
}

.cyber-terminal:hover {
    box-shadow: 
        0 0 30px rgba(0, 255, 136, 0.3),
        inset 0 0 80px rgba(0, 255, 136, 0.05);
}

/* Green glow variations */
.glow-green {
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.3);
}

.glow-green-hover:hover {
    box-shadow: 0 0 40px rgba(0, 255, 136, 0.5), 0 0 80px rgba(0, 255, 136, 0.2);
}

.text-glow-green {
    text-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
}

/* Cyber button */
.btn-cyber {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #00FF88, #00D4FF);
    border: none;
    padding: 15px 35px;
    border-radius: 8px;
    color: #0a0a0a;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cyber::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: cyberShimmer 3s infinite;
}

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

.btn-cyber:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(0, 255, 136, 0.4);
}

/* Encrypted text reveal */
.cyber-encrypt {
    position: relative;
}

.cyber-encrypt::before {
    content: attr(data-encrypted);
    position: absolute;
    top: 0;
    left: 0;
    color: #00FF88;
    overflow: hidden;
    animation: encryptReveal 5s steps(20) infinite;
}

@keyframes encryptReveal {
    0%, 100% { width: 0; }
    50% { width: 100%; }
}

/* Firewall blocks animation */
.cyber-firewall {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
}

.firewall-block {
    width: 100%;
    aspect-ratio: 1;
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid rgba(0, 255, 136, 0.2);
    animation: firewallPulse 2s ease-in-out infinite;
}

.firewall-block:nth-child(odd) {
    animation-delay: 0.5s;
}

@keyframes firewallPulse {
    0%, 100% { background: rgba(0, 255, 136, 0.1); }
    50% { background: rgba(0, 255, 136, 0.3); }
}

/* Connection nodes */
.cyber-node {
    width: 12px;
    height: 12px;
    background: #00FF88;
    border-radius: 50%;
    position: relative;
    animation: nodePulse 2s ease-in-out infinite;
}

.cyber-node::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    border: 2px solid rgba(0, 255, 136, 0.3);
    border-radius: 50%;
    animation: nodeRing 2s ease-out infinite;
}

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

@keyframes nodeRing {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(2); opacity: 0; }
}

/* Secure connection line */
.cyber-connection {
    height: 2px;
    background: linear-gradient(90deg, 
        transparent,
        #00FF88 20%,
        #00FF88 80%,
        transparent
    );
    position: relative;
    overflow: hidden;
}

.cyber-connection::after {
    content: '';
    position: absolute;
    top: 0;
    left: -50%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, white, transparent);
    animation: connectionFlow 2s linear infinite;
}

@keyframes connectionFlow {
    0% { left: -50%; }
    100% { left: 150%; }
}
