/**
 * VeriSight Spectacular Custom Effects
 * VeriSight Analytics specific animations and enhancements
 * Advanced visual effects and interactions
 */

/* ===========================
   VeriSight Brand Effects
   =========================== */
.verisight-hero-gradient {
  background: linear-gradient(135deg,
    #6366f1 0%,
    #8b5cf6 25%,
    #06b6d4 50%,
    #14b8a6 75%,
    #22c55e 100%);
  background-size: 300% 300%;
  animation: verisight-gradient-shift 20s ease infinite;
}

@keyframes verisight-gradient-shift {
  0% { background-position: 0% 50%; }
  25% { background-position: 50% 100%; }
  50% { background-position: 100% 50%; }
  75% { background-position: 50% 0%; }
  100% { background-position: 0% 50%; }
}

/* ===========================
   Network Visualization Effect
   =========================== */
.network-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.network-node {
  position: absolute;
  width: 6px;
  height: 6px;
  background: var(--ui-primary);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
  animation: node-pulse 3s ease-in-out infinite;
}

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

.network-line {
  position: absolute;
  height: 1px;
  background: linear-gradient(90deg,
    transparent,
    rgba(99, 102, 241, 0.3),
    transparent);
  transform-origin: left center;
  animation: line-pulse 4s ease-in-out infinite;
}

@keyframes line-pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.8; }
}

/* ===========================
   Data Flow Animation
   =========================== */
.data-flow-container {
  position: relative;
  overflow: hidden;
}

.data-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--healthcare-teal);
  border-radius: 50%;
  animation: data-flow 3s linear infinite;
}

@keyframes data-flow {
  0% {
    transform: translateX(-100px) translateY(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateX(calc(100vw + 100px)) translateY(30px);
    opacity: 0;
  }
}

/* ===========================
   Healthcare Dashboard Effects
   =========================== */
.dashboard-metric {
  position: relative;
  background: linear-gradient(135deg,
    rgba(20, 184, 166, 0.1) 0%,
    rgba(139, 92, 246, 0.05) 100%);
  border: 1px solid rgba(20, 184, 166, 0.2);
  border-radius: 16px;
  padding: 24px;
  overflow: hidden;
}

.dashboard-metric::before {
  content: '';
  position: absolute;
  top: -100%;
  left: -100%;
  width: 300%;
  height: 300%;
  background: radial-gradient(circle,
    rgba(20, 184, 166, 0.2) 0%,
    transparent 70%);
  animation: metric-scan 8s linear infinite;
}

@keyframes metric-scan {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ===========================
   VeriShift Schedule Animation
   =========================== */
.schedule-grid {
  display: grid;
  gap: 2px;
  background: rgba(255, 255, 255, 0.02);
  padding: 2px;
  border-radius: 8px;
}

.schedule-slot {
  background: rgba(99, 102, 241, 0.1);
  border-radius: 4px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.schedule-slot::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: radial-gradient(circle,
    rgba(99, 102, 241, 0.4) 0%,
    transparent 70%);
  transition: all 0.5s ease;
}

.schedule-slot:hover::before {
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}

.schedule-slot:hover {
  background: rgba(99, 102, 241, 0.2);
  transform: scale(1.02);
  z-index: 10;
}

/* ===========================
   MDS Genie AI Effect
   =========================== */
.ai-processing {
  position: relative;
  display: inline-block;
}

.ai-processing::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  border: 2px solid rgba(139, 92, 246, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: ai-scan 2s linear infinite;
}

@keyframes ai-scan {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  50% {
    border-color: rgba(139, 92, 246, 0.6);
  }
  100% {
    transform: translate(-50%, -50%) scale(1.5);
    opacity: 0;
  }
}

.ai-dots {
  display: inline-flex;
  gap: 4px;
}

.ai-dots span {
  width: 8px;
  height: 8px;
  background: var(--healthcare-purple);
  border-radius: 50%;
  animation: ai-thinking 1.4s ease-in-out infinite;
}

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

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

@keyframes ai-thinking {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1.2);
    opacity: 1;
  }
}

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

@keyframes float {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  25% {
    transform: translateY(-10px) rotate(1deg);
  }
  75% {
    transform: translateY(5px) rotate(-1deg);
  }
}

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

.float-delay-2 {
  animation-delay: 2s;
}

.float-delay-3 {
  animation-delay: 3s;
}

/* ===========================
   Particle Background
   =========================== */
.particle-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  animation: particle-drift 20s linear infinite;
}

@keyframes particle-drift {
  0% {
    transform: translateY(100vh) translateX(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-100vh) translateX(100px);
    opacity: 0;
  }
}

/* ===========================
   Morphing Shapes
   =========================== */
.morph-shape {
  background: linear-gradient(135deg,
    var(--ui-primary),
    var(--healthcare-purple));
  animation: morph 8s ease-in-out infinite;
}

@keyframes morph {
  0%, 100% {
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    transform: rotate(0deg) scale(1);
  }
  25% {
    border-radius: 30% 70% 70% 30% / 30% 70% 30% 70%;
    transform: rotate(90deg) scale(1.1);
  }
  50% {
    border-radius: 70% 30% 30% 70% / 70% 30% 70% 30%;
    transform: rotate(180deg) scale(1);
  }
  75% {
    border-radius: 30% 70% 30% 70% / 70% 30% 70% 30%;
    transform: rotate(270deg) scale(1.1);
  }
}

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

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

.glitch-text::before {
  animation: glitch-1 0.5s infinite;
  color: var(--healthcare-teal);
  z-index: -1;
}

.glitch-text::after {
  animation: glitch-2 0.5s infinite;
  color: var(--healthcare-purple);
  z-index: -2;
}

@keyframes glitch-1 {
  0%, 100% {
    clip: rect(0, 900px, 0, 0);
    transform: translate(0);
  }
  20% {
    clip: rect(20px, 900px, 40px, 0);
    transform: translate(-2px, 2px);
  }
  40% {
    clip: rect(40px, 900px, 60px, 0);
    transform: translate(2px, -2px);
  }
  60% {
    clip: rect(60px, 900px, 80px, 0);
    transform: translate(-2px, 1px);
  }
  80% {
    clip: rect(80px, 900px, 100px, 0);
    transform: translate(2px, -1px);
  }
}

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

/* ===========================
   Hover Reveal Effect
   =========================== */
.hover-reveal {
  position: relative;
  overflow: hidden;
}

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

.hover-reveal:hover::before {
  left: 100%;
}

/* ===========================
   Performance Optimizations
   =========================== */
.gpu-accelerated {
  transform: translateZ(0);
  will-change: transform;
}

.disable-animations * {
  animation: none !important;
  transition: none !important;
}

/* Reduced Motion Preferences */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .float-animation,
  .particle,
  .morph-shape,
  .glitch-text::before,
  .glitch-text::after {
    animation: none;
  }
}

/* ===========================
   Responsive Adjustments
   =========================== */
@media (max-width: 768px) {
  .network-canvas,
  .particle-container {
    display: none; /* Disable heavy animations on mobile */
  }

  .dashboard-metric::before,
  .schedule-slot::before {
    animation: none;
  }

  .morph-shape {
    animation-duration: 12s; /* Slower animation on mobile */
  }
}