/* 
 * DevSecOps Engineer Portfolio - Animations Stylesheet
 * Contains all animations, transitions, and special effects
 */

/* ===== Glitch Text Effect ===== */
.glitch-text {
  position: relative;
  animation: glitch-skew 1s infinite linear alternate-reverse;
}

.glitch-text::before,
.glitch-text::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  clip: rect(44px, 450px, 56px, 0);
}

.glitch-text::before {
  left: 2px;
  text-shadow: -2px 0 var(--secondary-color);
  animation: glitch-anim-1 5s infinite linear alternate-reverse;
}

.glitch-text::after {
  left: -2px;
  text-shadow: -2px 0 var(--primary-color);
  animation: glitch-anim-2 1s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
  0% {
    clip: rect(66px, 9999px, 10px, 0);
  }
  5% {
    clip: rect(36px, 9999px, 50px, 0);
  }
  10% {
    clip: rect(80px, 9999px, 73px, 0);
  }
  15% {
    clip: rect(91px, 9999px, 37px, 0);
  }
  20% {
    clip: rect(20px, 9999px, 14px, 0);
  }
  25% {
    clip: rect(75px, 9999px, 5px, 0);
  }
  30% {
    clip: rect(7px, 9999px, 53px, 0);
  }
  35% {
    clip: rect(10px, 9999px, 84px, 0);
  }
  40% {
    clip: rect(64px, 9999px, 30px, 0);
  }
  45% {
    clip: rect(24px, 9999px, 92px, 0);
  }
  50% {
    clip: rect(61px, 9999px, 55px, 0);
  }
  55% {
    clip: rect(37px, 9999px, 73px, 0);
  }
  60% {
    clip: rect(54px, 9999px, 85px, 0);
  }
  65% {
    clip: rect(7px, 9999px, 12px, 0);
  }
  70% {
    clip: rect(40px, 9999px, 23px, 0);
  }
  75% {
    clip: rect(89px, 9999px, 11px, 0);
  }
  80% {
    clip: rect(70px, 9999px, 42px, 0);
  }
  85% {
    clip: rect(5px, 9999px, 98px, 0);
  }
  90% {
    clip: rect(79px, 9999px, 61px, 0);
  }
  95% {
    clip: rect(45px, 9999px, 25px, 0);
  }
  100% {
    clip: rect(23px, 9999px, 31px, 0);
  }
}

@keyframes glitch-anim-2 {
  0% {
    clip: rect(12px, 9999px, 42px, 0);
  }
  5% {
    clip: rect(94px, 9999px, 70px, 0);
  }
  10% {
    clip: rect(33px, 9999px, 15px, 0);
  }
  15% {
    clip: rect(75px, 9999px, 55px, 0);
  }
  20% {
    clip: rect(67px, 9999px, 98px, 0);
  }
  25% {
    clip: rect(17px, 9999px, 63px, 0);
  }
  30% {
    clip: rect(44px, 9999px, 22px, 0);
  }
  35% {
    clip: rect(89px, 9999px, 35px, 0);
  }
  40% {
    clip: rect(4px, 9999px, 28px, 0);
  }
  45% {
    clip: rect(56px, 9999px, 77px, 0);
  }
  50% {
    clip: rect(30px, 9999px, 81px, 0);
  }
  55% {
    clip: rect(27px, 9999px, 48px, 0);
  }
  60% {
    clip: rect(95px, 9999px, 9px, 0);
  }
  65% {
    clip: rect(38px, 9999px, 53px, 0);
  }
  70% {
    clip: rect(71px, 9999px, 65px, 0);
  }
  75% {
    clip: rect(58px, 9999px, 42px, 0);
  }
  80% {
    clip: rect(84px, 9999px, 19px, 0);
  }
  85% {
    clip: rect(20px, 9999px, 88px, 0);
  }
  90% {
    clip: rect(49px, 9999px, 54px, 0);
  }
  95% {
    clip: rect(62px, 9999px, 11px, 0);
  }
  100% {
    clip: rect(16px, 9999px, 72px, 0);
  }
}

@keyframes glitch-skew {
  0% {
    transform: skew(0deg);
  }
  10% {
    transform: skew(0deg);
  }
  20% {
    transform: skew(0deg);
  }
  30% {
    transform: skew(0deg);
  }
  40% {
    transform: skew(0deg);
  }
  50% {
    transform: skew(-1deg);
  }
  60% {
    transform: skew(0deg);
  }
  70% {
    transform: skew(0deg);
  }
  80% {
    transform: skew(1deg);
  }
  90% {
    transform: skew(0deg);
  }
  100% {
    transform: skew(0deg);
  }
}

/* ===== Neon Glow Effect ===== */
.neon-glow {
  text-shadow: 
    0 0 5px rgba(0, 240, 255, 0.5),
    0 0 10px rgba(0, 240, 255, 0.5),
    0 0 15px rgba(0, 240, 255, 0.5),
    0 0 20px rgba(0, 240, 255, 0.5);
  animation: neon-pulse 1.5s infinite alternate;
}

@keyframes neon-pulse {
  from {
    text-shadow: 
      0 0 5px rgba(0, 240, 255, 0.5),
      0 0 10px rgba(0, 240, 255, 0.5),
      0 0 15px rgba(0, 240, 255, 0.5),
      0 0 20px rgba(0, 240, 255, 0.5);
  }
  to {
    text-shadow: 
      0 0 5px rgba(0, 240, 255, 0.8),
      0 0 10px rgba(0, 240, 255, 0.8),
      0 0 15px rgba(0, 240, 255, 0.8),
      0 0 20px rgba(0, 240, 255, 0.8),
      0 0 30px rgba(0, 240, 255, 0.8);
  }
}

/* ===== Logo Specific Animations ===== */
@keyframes shine {
  0% {
    left: -100%;
  }
  20% {
    left: 100%;
  }
  100% {
    left: 100%;
  }
}

@keyframes pulse {
  0% {
    opacity: 0.5;
    transform: translateY(15%) scale(1);
  }
  50% {
    opacity: 0.8;
    transform: translateY(15%) scale(1.05);
  }
  100% {
    opacity: 0.5;
    transform: translateY(15%) scale(1);
  }
}

/* ===== Floating Animation ===== */
.floating {
  animation: floating 3s ease-in-out infinite;
}

@keyframes floating {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-15px);
  }
  100% {
    transform: translateY(0px);
  }
}

/* ===== Pulse Animation ===== */
.pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ===== Typing Animation ===== */
.typing {
  width: 0;
  overflow: hidden;
  white-space: nowrap;
  border-right: 3px solid var(--primary-color);
  animation: typing 4s steps(40, end) forwards, 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: var(--primary-color) }
}

/* ===== Fade In Animation ===== */
.fade-in {
  opacity: 0;
  animation: fadeIn 1s ease-in forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ===== Slide In Animation ===== */
.slide-in-left {
  transform: translateX(-50px);
  opacity: 0;
  animation: slideInLeft 0.8s ease forwards;
}

.slide-in-right {
  transform: translateX(50px);
  opacity: 0;
  animation: slideInRight 0.8s ease forwards;
}

.slide-in-up {
  transform: translateY(50px);
  opacity: 0;
  animation: slideInUp 0.8s ease forwards;
}

@keyframes slideInLeft {
  from {
    transform: translateX(-50px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideInRight {
  from {
    transform: translateX(50px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideInUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ===== Rotate Animation ===== */
.rotate {
  animation: rotate 10s linear infinite;
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ===== Flicker Animation ===== */
.flicker {
  animation: flicker 3s linear infinite;
}

@keyframes flicker {
  0%, 19.999%, 22%, 62.999%, 64%, 64.999%, 70%, 100% {
    opacity: 1;
  }
  20%, 21.999%, 63%, 63.999%, 65%, 69.999% {
    opacity: 0.5;
  }
}

/* ===== Scan Line Effect ===== */
.scan-line {
  position: relative;
  overflow: hidden;
}

.scan-line::after {
  content: "";
  position: absolute;
  top: -50%;
  left: 0;
  width: 100%;
  height: 200%;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0, 240, 255, 0.2) 50%,
    transparent 100%
  );
  animation: scanline 4s linear infinite;
}

@keyframes scanline {
  0% {
    transform: translateY(-100%);
  }
  100% {
    transform: translateY(100%);
  }
}

/* ===== Digital Noise Effect ===== */
.digital-noise {
  position: relative;
}

.digital-noise::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  opacity: 0.05;
  pointer-events: none;
}

/* ===== Hologram Effect ===== */
.hologram-effect {
  position: relative;
  overflow: hidden;
}

.hologram-effect::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    linear-gradient(135deg, rgba(0, 240, 255, 0.1) 0%, transparent 100%),
    repeating-linear-gradient(
      45deg,
      rgba(0, 240, 255, 0.1),
      rgba(0, 240, 255, 0.1) 1px,
      transparent 1px,
      transparent 6px
    );
  animation: hologram-shift 3s infinite linear;
}

@keyframes hologram-shift {
  0% {
    background-position: 0% 0%;
  }
  100% {
    background-position: 100% 100%;
  }
}

/* ===== Data Stream Effect ===== */
.data-stream {
  position: relative;
  overflow: hidden;
}

.data-stream::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    linear-gradient(90deg, 
      transparent 0%, 
      transparent 5%, 
      rgba(0, 240, 255, 0.1) 5.1%, 
      rgba(0, 240, 255, 0.1) 10%, 
      transparent 10.1%, 
      transparent 15%, 
      rgba(0, 240, 255, 0.05) 15.1%, 
      rgba(0, 240, 255, 0.05) 20%, 
      transparent 20.1%, 
      transparent 100%
    );
  background-size: 200% 100%;
  animation: data-stream 2s linear infinite;
}

@keyframes data-stream {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

/* ===== Circuit Board Background ===== */
.circuit-bg {
  position: relative;
}

.circuit-bg::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(rgba(0, 240, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.05) 1px, transparent 1px),
    linear-gradient(rgba(0, 240, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.03) 1px, transparent 1px);
  background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px;
  background-position: -1px -1px, -1px -1px, -1px -1px, -1px -1px;
  z-index: -1;
}

/* ===== Particle Effect ===== */
.particle-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: -1;
}

.particle {
  position: absolute;
  display: block;
  background-color: var(--primary-color);
  width: 2px;
  height: 2px;
  border-radius: 50%;
  animation: particle-animation var(--duration) infinite;
}

@keyframes particle-animation {
  0% {
    transform: translate(var(--x-start), var(--y-start));
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translate(var(--x-end), var(--y-end));
    opacity: 0;
  }
}

/* ===== Cyberpunk Grid ===== */
.cyberpunk-grid {
  position: relative;
}

.cyberpunk-grid::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    linear-gradient(transparent 0%, transparent 95%, rgba(0, 240, 255, 0.3) 95.1%, rgba(0, 240, 255, 0.3) 100%),
    linear-gradient(90deg, transparent 0%, transparent 95%, rgba(0, 240, 255, 0.3) 95.1%, rgba(0, 240, 255, 0.3) 100%);
  background-size: 20px 20px;
  perspective: 1000px;
  transform: rotateX(60deg);
  transform-origin: center top;
  z-index: -1;
  opacity: 0.1;
}

/* ===== Futuristic Loading Animation ===== */
.loading-circle {
  width: 50px;
  height: 50px;
  border: 3px solid transparent;
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-circle::before, .loading-circle::after {
  content: "";
  position: absolute;
  border: 3px solid transparent;
  border-radius: 50%;
}

.loading-circle::before {
  top: 5px;
  left: 5px;
  right: 5px;
  bottom: 5px;
  border-top-color: var(--secondary-color);
  animation: spin 2s linear infinite;
}

.loading-circle::after {
  top: 15px;
  left: 15px;
  right: 15px;
  bottom: 15px;
  border-top-color: var(--accent-blue);
  animation: spin 3s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ===== Futuristic Button Hover Effect ===== */
.btn-futuristic {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.btn-futuristic::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: all 0.6s ease;
}

.btn-futuristic:hover::before {
  left: 100%;
}

/* ===== Holographic Text Effect ===== */
.holographic-text {
  background-image: linear-gradient(
    90deg,
    var(--primary-color),
    var(--accent-blue),
    var(--secondary-color),
    var(--accent-green),
    var(--primary-color)
  );
  background-size: 200% auto;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  animation: holographic-shift 3s linear infinite;
}

@keyframes holographic-shift {
  to {
    background-position: 200% center;
  }
}

/* ===== Matrix Rain Effect ===== */
.matrix-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: -1;
}

.matrix-rain {
  color: var(--primary-color);
  font-family: "Courier New", monospace;
  font-size: 1.2rem;
  position: absolute;
  top: 0;
  animation: matrix-rain-fall linear infinite;
}

@keyframes matrix-rain-fall {
  0% {
    transform: translateY(-100%);
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  100% {
    transform: translateY(calc(100vh + 20px));
    opacity: 0;
  }
}

/* ===== AI Neural Network Effect ===== */
.neural-network {
  position: relative;
  overflow: hidden;
}

.neural-network::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(0, 240, 255, 0.1) 1px, transparent 1px),
    radial-gradient(circle at 20% 20%, rgba(0, 240, 255, 0.1) 1px, transparent 1px),
    radial-gradient(circle at 30% 30%, rgba(0, 240, 255, 0.1) 1px, transparent 1px),
    radial-gradient(circle at 40% 40%, rgba(0, 240, 255, 0.1) 1px, transparent 1px),
    radial-gradient(circle at 50% 50%, rgba(0, 240, 255, 0.1) 1px, transparent 1px),
    radial-gradient(circle at 60% 60%, rgba(0, 240, 255, 0.1) 1px, transparent 1px),
    radial-gradient(circle at 70% 70%, rgba(0, 240, 255, 0.1) 1px, transparent 1px),
    radial-gradient(circle at 80% 80%, rgba(0, 240, 255, 0.1) 1px, transparent 1px),
    radial-gradient(circle at 90% 90%, rgba(0, 240, 255, 0.1) 1px, transparent 1px);
  background-size: 100px 100px;
  animation: neural-pulse 4s infinite linear;
  z-index: -1;
}

@keyframes neural-pulse {
  0% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.05);
  }
  100% {
    opacity: 0.3;
    transform: scale(1);
  }
}

/* ===== AI Data Flow Effect ===== */
.data-flow {
  position: relative;
  overflow: hidden;
}

.data-flow::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 200%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 240, 255, 0.1) 25%,
    rgba(255, 0, 170, 0.1) 50%,
    rgba(0, 240, 255, 0.1) 75%,
    transparent 100%
  );
  animation: data-flow 3s infinite linear;
  z-index: -1;
}

@keyframes data-flow {
  0% {
    transform: translateX(0%);
  }
  100% {
    transform: translateX(50%);
  }
}

/* ===== AI Voice Waveform Effect ===== */
.voice-wave {
  position: relative;
  overflow: hidden;
}

.voice-wave::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 20px;
  background: linear-gradient(
    90deg,
    var(--primary-color) 0%,
    var(--primary-color) 10%,
    transparent 10.1%,
    transparent 20%,
    var(--primary-color) 20.1%,
    var(--primary-color) 30%,
    transparent 30.1%,
    transparent 40%,
    var(--primary-color) 40.1%,
    var(--primary-color) 50%,
    transparent 50.1%,
    transparent 60%,
    var(--primary-color) 60.1%,
    var(--primary-color) 70%,
    transparent 70.1%,
    transparent 80%,
    var(--primary-color) 80.1%,
    var(--primary-color) 90%,
    transparent 90.1%,
    transparent 100%
  );
  opacity: 0.3;
  animation: voice-wave 2s infinite linear;
  z-index: -1;
}

@keyframes voice-wave {
  0% {
    height: 5px;
  }
  50% {
    height: 20px;
  }
  100% {
    height: 5px;
  }
}

/* ===== AI Processing Effect ===== */
.ai-processing {
  position: relative;
  overflow: hidden;
}

.ai-processing::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    linear-gradient(90deg, transparent 0%, rgba(0, 240, 255, 0.1) 50%, transparent 100%),
    linear-gradient(180deg, transparent 0%, rgba(255, 0, 170, 0.1) 50%, transparent 100%);
  background-size: 200% 200%;
  animation: ai-processing 4s infinite linear;
  z-index: -1;
}

@keyframes ai-processing {
  0% {
    background-position: 0% 0%;
  }
  25% {
    background-position: 100% 0%;
  }
  50% {
    background-position: 100% 100%;
  }
  75% {
    background-position: 0% 100%;
  }
  100% {
    background-position: 0% 0%;
  }
}

/* ===== Quantum Computing Effect ===== */
.quantum-effect {
  position: relative;
  overflow: hidden;
}

.quantum-effect::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 50% 50%, rgba(0, 240, 255, 0.2) 0%, transparent 50%),
    radial-gradient(circle at 30% 70%, rgba(255, 0, 170, 0.2) 0%, transparent 40%),
    radial-gradient(circle at 70% 30%, rgba(0, 255, 157, 0.2) 0%, transparent 40%);
  filter: blur(10px);
  animation: quantum-fluctuation 8s infinite ease-in-out;
  z-index: -1;
}

@keyframes quantum-fluctuation {
  0% {
    opacity: 0.3;
    transform: scale(0.8) rotate(0deg);
  }
  25% {
    opacity: 0.5;
    transform: scale(1.2) rotate(90deg);
  }
  50% {
    opacity: 0.3;
    transform: scale(0.9) rotate(180deg);
  }
  75% {
    opacity: 0.5;
    transform: scale(1.1) rotate(270deg);
  }
  100% {
    opacity: 0.3;
    transform: scale(0.8) rotate(360deg);
  }
}

/* ===== 3D Rotation Effect ===== */
.rotate-3d {
  transform-style: preserve-3d;
  perspective: 1000px;
  animation: rotate-3d 10s infinite linear;
}

@keyframes rotate-3d {
  0% {
    transform: rotateX(0deg) rotateY(0deg);
  }
  25% {
    transform: rotateX(90deg) rotateY(45deg);
  }
  50% {
    transform: rotateX(180deg) rotateY(90deg);
  }
  75% {
    transform: rotateX(270deg) rotateY(135deg);
  }
  100% {
    transform: rotateX(360deg) rotateY(180deg);
  }
}
