/* ============================================
   CloudAcropolis - Cyber/Tech Animations
   ============================================ */

/* ============================================
   Keyframe Definitions
   ============================================ */

/* Grid Pulse Animation */
@keyframes gridPulse {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.02);
    }
}

/* Glow Pulse Animation */
@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 10px rgba(8, 145, 178, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(8, 145, 178, 0.6);
    }
}

/* Data Flow Animation */
@keyframes dataFlow {
    0% {
        transform: translateX(-100%);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Server Blink Animation */
@keyframes serverBlink {
    0%, 100% {
        opacity: 1;
        background-color: #10b981;
    }
    50% {
        opacity: 0.3;
        background-color: #10b981;
    }
}

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

/* Fade In Left Animation */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Fade In Right Animation */
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Fade In Down Animation */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Zoom In Animation */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Slide In Up Animation */
@keyframes slideInUp {
    from {
        transform: translateY(100%);
        visibility: visible;
    }
    to {
        transform: translateY(0);
    }
}

/* Bounce In Animation */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Cyber Scan Animation */
@keyframes cyberScan {
    0% {
        transform: translateY(-100%);
    }
    100% {
        transform: translateY(100%);
    }
}

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

/* Float Animation */
@keyframes floatAnimation {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Pulse Scale Animation */
@keyframes pulseScale {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Shimmer Animation */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Type Writer Animation */
@keyframes typeWriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

/* Blink Cursor Animation */
@keyframes blinkCursor {
    0%, 100% {
        border-color: transparent;
    }
    50% {
        border-color: #0891b2;
    }
}

/* ============================================
   Animation Utility Classes
   ============================================ */

/* Grid Pulse */
.animate-grid-pulse {
    animation: gridPulse 4s ease-in-out infinite;
}

/* Glow Pulse */
.animate-glow-pulse {
    animation: glowPulse 2s ease-in-out infinite;
}

/* Data Flow */
.animate-data-flow {
    animation: dataFlow 3s linear infinite;
}

/* Server Blink */
.animate-server-blink {
    animation: serverBlink 1s ease-in-out infinite;
}

/* Fade Animations */
.animate-fadeInUp {
    animation: fadeInUp 0.6s ease-out forwards;
}

.animate-fadeInLeft {
    animation: fadeInLeft 0.6s ease-out forwards;
}

.animate-fadeInRight {
    animation: fadeInRight 0.6s ease-out forwards;
}

.animate-fadeInDown {
    animation: fadeInDown 0.6s ease-out forwards;
}

/* Zoom In */
.animate-zoomIn {
    animation: zoomIn 0.5s ease-out forwards;
}

/* Bounce In */
.animate-bounceIn {
    animation: bounceIn 0.8s ease-out forwards;
}

/* Float */
.animate-float {
    animation: floatAnimation 6s ease-in-out infinite;
}

/* Rotate */
.animate-rotate {
    animation: rotate 10s linear infinite;
}

/* Pulse Scale */
.animate-pulse-scale {
    animation: pulseScale 2s ease-in-out infinite;
}

/* Shimmer */
.animate-shimmer {
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: shimmer 2s linear infinite;
}

/* ============================================
   WOW.js Integration Classes
   ============================================ */

/* Base class for WOW.js elements */
.wow {
    visibility: hidden;
}

/* Fade animations for WOW.js */
.wow.fadeInUp {
    animation-name: fadeInUp;
}

.wow.fadeInDown {
    animation-name: fadeInDown;
}

.wow.fadeInLeft {
    animation-name: fadeInLeft;
}

.wow.fadeInRight {
    animation-name: fadeInRight;
}

.wow.fadeIn {
    animation-name: fadeIn;
}

.wow.zoomIn {
    animation-name: zoomIn;
}

.wow.bounceIn {
    animation-name: bounceIn;
}

.wow.slideInUp {
    animation-name: slideInUp;
}

/* Fade In base animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ============================================
   Animation Delay Utilities
   ============================================ */
.delay-100 {
    animation-delay: 0.1s;
}

.delay-200 {
    animation-delay: 0.2s;
}

.delay-300 {
    animation-delay: 0.3s;
}

.delay-400 {
    animation-delay: 0.4s;
}

.delay-500 {
    animation-delay: 0.5s;
}

.delay-600 {
    animation-delay: 0.6s;
}

.delay-700 {
    animation-delay: 0.7s;
}

.delay-800 {
    animation-delay: 0.8s;
}

.delay-900 {
    animation-delay: 0.9s;
}

.delay-1000 {
    animation-delay: 1s;
}

/* ============================================
   Animation Duration Utilities
   ============================================ */
.duration-fast {
    animation-duration: 0.3s;
}

.duration-normal {
    animation-duration: 0.6s;
}

.duration-slow {
    animation-duration: 1s;
}

.duration-slower {
    animation-duration: 1.5s;
}

.duration-slowest {
    animation-duration: 2s;
}

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

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(8, 145, 178, 0.15);
}

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

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(8, 145, 178, 0.4);
}

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-rotate {
    transition: transform 0.5s ease;
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

/* ============================================
   Scroll-Triggered Animations (CSS only)
   ============================================ */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

.scroll-reveal-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

.scroll-reveal-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* ============================================
   Loading Animations
   ============================================ */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: #0891b2;
    border-radius: 50%;
    animation: rotate 1s linear infinite;
}

.loading-dots {
    display: flex;
    gap: 0.5rem;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: #0891b2;
    border-radius: 50%;
    animation: pulseScale 0.6s ease-in-out infinite;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

/* Cyber Loading Bar */
.loading-bar {
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.loading-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 30%;
    background: linear-gradient(135deg, #0891b2, #0e7490);
    animation: dataFlow 1.5s ease-in-out infinite;
}

/* ============================================
   Cyber-specific Effects
   ============================================ */

/* Scan Line Effect */
.cyber-scanline {
    position: relative;
    overflow: hidden;
}

.cyber-scanline::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #0891b2, transparent);
    animation: cyberScan 3s linear infinite;
}

/* Glitch Effect */
@keyframes glitch {
    0%, 100% {
        transform: translate(0);
    }
    20% {
        transform: translate(-2px, 2px);
    }
    40% {
        transform: translate(-2px, -2px);
    }
    60% {
        transform: translate(2px, 2px);
    }
    80% {
        transform: translate(2px, -2px);
    }
}

.cyber-glitch {
    animation: glitch 0.5s ease-in-out infinite;
}

.cyber-glitch:hover {
    animation: glitch 0.2s ease-in-out infinite;
}

/* Neon Flicker */
@keyframes neonFlicker {
    0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
        text-shadow:
            0 0 5px #0891b2,
            0 0 10px #0891b2,
            0 0 20px #0891b2,
            0 0 40px #06b6d4;
    }
    20%, 24%, 55% {
        text-shadow: none;
    }
}

.cyber-neon {
    animation: neonFlicker 2s ease-in-out infinite;
}

/* Border Animation */
@keyframes borderMove {
    0% {
        background-position: 0% 0%;
    }
    100% {
        background-position: 100% 100%;
    }
}

.cyber-border {
    position: relative;
}

.cyber-border::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #0891b2, #0e7490, #2563eb, #7c3aed);
    background-size: 400% 400%;
    border-radius: inherit;
    z-index: -1;
    animation: borderMove 4s ease infinite;
}

/* ============================================
   Service Page Special Animations
   ============================================ */

/* Floating Icon Container */
.floating-icon {
    animation: floatAnimation 6s ease-in-out infinite;
    display: inline-block;
}

.floating-icon--slow {
    animation: floatAnimation 8s ease-in-out infinite;
}

.floating-icon--fast {
    animation: floatAnimation 4s ease-in-out infinite;
}

/* Icon with Glow */
.icon-glow {
    position: relative;
}

.icon-glow::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    background: radial-gradient(circle, rgba(8, 145, 178, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    animation: glowPulse 3s ease-in-out infinite;
    z-index: -1;
}

/* Server Status Lights */
.server-lights {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
}

.server-light {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    animation: serverBlink 1.5s ease-in-out infinite;
}

.server-light:nth-child(2) {
    animation-delay: 0.3s;
}

.server-light:nth-child(3) {
    animation-delay: 0.6s;
}

.server-light--warning {
    background: #f59e0b;
}

.server-light--blue {
    background: #0891b2;
}

/* Data Flow Line */
.data-flow-line {
    position: relative;
    height: 4px;
    background: linear-gradient(90deg, #e2e8f0, #e2e8f0);
    border-radius: 2px;
    overflow: hidden;
    margin: 2rem 0;
}

.data-flow-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: -50%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, #0891b2, #06b6d4, transparent);
    animation: dataFlow 2s linear infinite;
}

/* Animated Hero Icon - Large centered icon with effects */
.hero-icon-animated {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, rgba(8, 145, 178, 0.1) 0%, rgba(14, 116, 144, 0.1) 100%);
    border-radius: 50%;
    animation: floatAnimation 6s ease-in-out infinite;
}

.hero-icon-animated i {
    font-size: 5rem;
    color: #0891b2;
}

.hero-icon-animated::before {
    content: '';
    position: absolute;
    inset: -10px;
    border: 2px solid rgba(8, 145, 178, 0.2);
    border-radius: 50%;
    animation: pulseScale 3s ease-in-out infinite;
}

.hero-icon-animated::after {
    content: '';
    position: absolute;
    inset: -20px;
    border: 1px solid rgba(8, 145, 178, 0.1);
    border-radius: 50%;
    animation: pulseScale 3s ease-in-out infinite 0.5s;
}

/* Animated Stats Numbers */
.stat-number-animated {
    position: relative;
    display: inline-block;
}

.stat-number-animated::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, #0891b2, transparent);
    animation: shimmer 2s ease-in-out infinite;
}

/* Cyber Card Hover Enhancement */
.service-card-animated {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card-animated:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(8, 145, 178, 0.2);
}

.service-card-animated:hover .service-card__icon {
    animation: bounceIn 0.6s ease-out;
    background: linear-gradient(135deg, #0891b2, #0e7490);
}

.service-card-animated:hover .service-card__icon i {
    color: white;
}

/* Network Connection Animation */
.network-pulse {
    position: relative;
}

.network-pulse::before,
.network-pulse::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid rgba(8, 145, 178, 0.5);
    border-radius: 50%;
    animation: pulseScale 2s ease-out infinite;
}

.network-pulse::before {
    width: 100%;
    height: 100%;
}

.network-pulse::after {
    width: 140%;
    height: 140%;
    animation-delay: 0.5s;
}

/* Orbiting Elements */
@keyframes orbit {
    from {
        transform: rotate(0deg) translateX(80px) rotate(0deg);
    }
    to {
        transform: rotate(360deg) translateX(80px) rotate(-360deg);
    }
}

.orbit-container {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto;
}

.orbit-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #0891b2, #0e7490);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.orbit-center i {
    color: white;
    font-size: 2rem;
}

.orbit-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 160px;
    height: 160px;
    border: 1px dashed rgba(8, 145, 178, 0.3);
    border-radius: 50%;
}

.orbit-item {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    background: white;
    border: 2px solid #0891b2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: orbit 10s linear infinite;
    box-shadow: 0 4px 15px rgba(8, 145, 178, 0.2);
}

.orbit-item:nth-child(2) {
    animation-delay: -2.5s;
}

.orbit-item:nth-child(3) {
    animation-delay: -5s;
}

.orbit-item:nth-child(4) {
    animation-delay: -7.5s;
}

.orbit-item i {
    font-size: 0.8rem;
    color: #0891b2;
}

/* Typing effect for headings */
.typing-effect {
    overflow: hidden;
    border-right: 2px solid #0891b2;
    white-space: nowrap;
    animation: typeWriter 3s steps(40, end), blinkCursor 0.75s step-end infinite;
}

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

/* ============================================
   SVG Diagram Animations
   ============================================ */

/* SVG Diagram Container */
.svg-diagram {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 16px;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.svg-diagram::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 20% 80%, rgba(8, 145, 178, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(14, 116, 144, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

/* Data Packet Animation */
@keyframes dataPacket {
    0% {
        offset-distance: 0%;
        opacity: 0;
    }
    5% {
        opacity: 1;
    }
    95% {
        opacity: 1;
    }
    100% {
        offset-distance: 100%;
        opacity: 0;
    }
}

.data-packet {
    offset-rotate: 0deg;
    animation: dataPacket 3s linear infinite;
}

.data-packet:nth-child(2) { animation-delay: 0.5s; }
.data-packet:nth-child(3) { animation-delay: 1s; }
.data-packet:nth-child(4) { animation-delay: 1.5s; }
.data-packet:nth-child(5) { animation-delay: 2s; }

/* Server Pulse Animation */
@keyframes serverPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
    }
}

.svg-server-pulse {
    animation: serverPulse 2s ease-in-out infinite;
    transform-origin: center;
}

/* Cloud Float Animation */
@keyframes cloudFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.svg-cloud-float {
    animation: cloudFloat 4s ease-in-out infinite;
}

/* Scale Up/Down Animation for Resources */
@keyframes scaleResource {
    0%, 100% {
        transform: scaleY(0.6);
    }
    50% {
        transform: scaleY(1);
    }
}

.svg-scale-resource {
    animation: scaleResource 3s ease-in-out infinite;
    transform-origin: bottom;
}

/* Connection Line Dash Animation */
@keyframes dashMove {
    to {
        stroke-dashoffset: -20;
    }
}

.svg-dash-animate {
    stroke-dasharray: 10, 5;
    animation: dashMove 1s linear infinite;
}

/* Glow Filter Animation */
@keyframes glowFilterPulse {
    0%, 100% {
        filter: drop-shadow(0 0 3px rgba(8, 145, 178, 0.3));
    }
    50% {
        filter: drop-shadow(0 0 10px rgba(8, 145, 178, 0.6));
    }
}

.svg-glow-animate {
    animation: glowFilterPulse 2s ease-in-out infinite;
}

/* Traffic Flow Dots */
@keyframes trafficDot {
    0% {
        transform: translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateX(100px);
        opacity: 0;
    }
}

.svg-traffic-dot {
    animation: trafficDot 2s linear infinite;
}

/* Failover Animation */
@keyframes failover {
    0%, 45% {
        fill: #10b981;
        opacity: 1;
    }
    50%, 95% {
        fill: #ef4444;
        opacity: 0.5;
    }
    100% {
        fill: #10b981;
        opacity: 1;
    }
}

.svg-failover-demo {
    animation: failover 6s ease-in-out infinite;
}

/* Replication Animation */
@keyframes replicate {
    0% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
}

.svg-replicate {
    animation: replicate 2s ease-in-out infinite;
}

.svg-replicate:nth-child(2) { animation-delay: 0.3s; }
.svg-replicate:nth-child(3) { animation-delay: 0.6s; }

/* Shield Protection Animation */
@keyframes shieldPulse {
    0%, 100% {
        stroke-width: 2;
        stroke-opacity: 0.5;
    }
    50% {
        stroke-width: 4;
        stroke-opacity: 1;
    }
}

.svg-shield-pulse {
    animation: shieldPulse 2s ease-in-out infinite;
}

/* Backup Flow Animation */
@keyframes backupFlow {
    0% {
        stroke-dashoffset: 100;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

.svg-backup-flow {
    stroke-dasharray: 100;
    animation: backupFlow 2s ease-in-out infinite;
}

/* Icon Bounce in SVG */
@keyframes svgIconBounce {
    0%, 100% {
        transform: translateY(0);
    }
    25% {
        transform: translateY(-5px);
    }
    75% {
        transform: translateY(3px);
    }
}

.svg-icon-bounce {
    animation: svgIconBounce 2s ease-in-out infinite;
}

/* Status Indicator Blink */
@keyframes statusBlink {
    0%, 100% {
        fill: #10b981;
    }
    50% {
        fill: #34d399;
    }
}

.svg-status-ok {
    animation: statusBlink 1.5s ease-in-out infinite;
}

/* Rotate for sync icons */
@keyframes svgRotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.svg-rotate {
    animation: svgRotate 3s linear infinite;
    transform-origin: center;
}

/* ============================================
   Reduced Motion Support
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .wow {
        visibility: visible !important;
        animation: none !important;
    }

    .scroll-reveal,
    .scroll-reveal-left,
    .scroll-reveal-right {
        opacity: 1 !important;
        transform: none !important;
    }
}
