/* Custom Animations for WEKA AKIBA Site - Cybersecurity Style */

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

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

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

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

@keyframes slideInUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

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

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 5px rgba(99, 102, 241, 0.5);
  }
  50% {
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.8), 0 0 30px rgba(99, 102, 241, 0.6);
  }
}

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

@keyframes neonGlow {
  0%, 100% {
    text-shadow: 0 0 5px #f76f35, 0 0 10px #f76f35, 0 0 15px #f76f35;
    box-shadow: 0 0 5px #f76f35, 0 0 10px #f76f35, 0 0 15px #f76f35;
  }
  50% {
    text-shadow: 0 0 10px #f76f35, 0 0 20px #f76f35, 0 0 30px #f76f35;
    box-shadow: 0 0 10px #f76f35, 0 0 20px #f76f35, 0 0 30px #f76f35;
  }
}

@keyframes matrixRain {
  0% {
    transform: translateY(-100vh);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh);
    opacity: 0;
  }
}

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

@keyframes blink {
  0%, 50% {
    border-color: transparent;
  }
  51%, 100% {
    border-color: #f76f35;
  }
}

@keyframes particleFloat {
  0% {
    transform: translateY(0px) rotate(0deg);
    opacity: 1;
  }
  50% {
    transform: translateY(-20px) rotate(180deg);
    opacity: 0.5;
  }
  100% {
    transform: translateY(0px) rotate(360deg);
    opacity: 1;
  }
}

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

@keyframes cyberPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(0, 255, 0, 0.7);
  }
  50% {
    transform: scale(1.1);
    box-shadow: 0 0 0 10px rgba(0, 255, 0, 0);
  }
}

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

/* Utility classes */
.animate-fade-in-up {
  animation: fadeInUp 0.6s ease-out forwards;
}

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

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

.animate-scale-in {
  animation: scaleIn 0.5s ease-out forwards;
}

.animate-bounce-in {
  animation: bounceIn 0.8s ease-out forwards;
}

.animate-slide-in-up {
  animation: slideInUp 0.6s ease-out forwards;
}

.animate-pulse-custom {
  animation: pulse 2s infinite;
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

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

/* Cybersecurity utility classes */
.animate-glitch {
  animation: glitch 0.3s ease-in-out;
}

.animate-glitch:hover {
  animation: glitch 0.3s ease-in-out infinite;
}

.animate-neon-glow {
  animation: neonGlow 2s ease-in-out infinite;
}

.animate-matrix-rain {
  animation: matrixRain 5s linear infinite;
}

.animate-typing {
  overflow: hidden;
  border-right: 2px solid #f76f35;
  white-space: nowrap;
  animation: typing 3s steps(40, end), blink 1s infinite;
}

.animate-particle-float {
  animation: particleFloat 4s ease-in-out infinite;
}

.animate-code-scan {
  background: linear-gradient(45deg, transparent 30%, rgba(0, 255, 0, 0.1) 50%, transparent 70%);
  background-size: 200% 200%;
  animation: codeScan 3s ease-in-out infinite;
}

.animate-cyber-pulse {
  animation: cyberPulse 2s ease-in-out infinite;
}

.animate-data-flow {
  animation: dataFlow 2s linear infinite;
}

/* Icon animations */
.icon-animated {
  transition: all 0.3s ease;
  position: relative;
}

.icon-animated:hover {
  transform: scale(1.2) rotate(5deg);
  filter: drop-shadow(0 0 10px rgba(0, 255, 0, 0.5));
}

.icon-cyber {
  position: relative;
  overflow: hidden;
}

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

/* Card cybersecurity animations */
.card-cyber {
  position: relative;
  border: 1px solid rgba(0, 255, 0, 0.2);
  background: rgba(0, 0, 0, 0.8);
  transition: all 0.3s ease;
}

.card-cyber::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #00ff00, #00ffff, #00ff00);
  animation: dataFlow 3s linear infinite;
}

.card-cyber:hover {
  border-color: #00ff00;
  box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
  transform: translateY(-5px);
}

.card-cyber:hover::before {
  animation-duration: 1s;
}

/* Section animations */
.section-cyber {
  position: relative;
  overflow: hidden;
}

.section-cyber::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at center, rgba(0, 255, 0, 0.05) 0%, transparent 70%);
  pointer-events: none;
  animation: cyberPulse 4s ease-in-out infinite;
}

/* Button cybersecurity animations */
.btn-cyber {
  position: relative;
  border: 2px solid #00ff00;
  background: transparent;
  color: #00ff00;
  overflow: hidden;
  transition: all 0.3s ease;
}

.btn-cyber::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: #00ff00;
  transition: left 0.3s ease;
}

.btn-cyber:hover {
  color: #000;
  box-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
}

.btn-cyber:hover::before {
  left: 0;
}

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

.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

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

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

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

.hover-glow:hover {
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
}

/* Button animations */
.btn-animated {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.btn-animated::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: left 0.5s;
}

.btn-animated:hover::before {
  left: 100%;
}

/* Card animations */
.card-animated {
  transition: all 0.3s ease;
  cursor: pointer;
}

.card-animated:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

/* Loading animation */
.loading-dots::after {
  content: '';
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0%, 20% { content: ''; }
  40% { content: '.'; }
  60% { content: '..'; }
  80%, 100% { content: '...'; }
}

/* Stagger animations */
.stagger-children > * {
  opacity: 0;
  animation: fadeInUp 0.6s ease-out forwards;
}

.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; }

/* Scroll-triggered animations */
.fade-in-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-on-scroll.animate {
  opacity: 1;
  transform: translateY(0);
}

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

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

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

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

.scale-in-on-scroll {
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.scale-in-on-scroll.animate {
  opacity: 1;
  transform: scale(1);
}

/* Lazy Loading Animation */
@keyframes lazyLoad {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.lazy-load {
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.lazy-load.loaded {
  animation: lazyLoad 0.6s ease forwards;
}

/* Lightbox Animations */
@keyframes lightboxFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes lightboxZoomIn {
  from {
    opacity: 0;
    transform: scale(0.7);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  animation: lightboxFadeIn 0.3s ease;
}

.lightbox-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 90%;
  max-height: 90%;
  animation: lightboxZoomIn 0.3s ease;
}

/* Notification Animations */
@keyframes toastSlideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes toastSlideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

.toast-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  animation: toastSlideIn 0.3s ease;
}

.toast-notification.hide {
  animation: toastSlideOut 0.3s ease forwards;
}

/* Enhanced Button Animations */
@keyframes buttonPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.btn-pulse {
  animation: buttonPulse 2s infinite;
}

.btn-click {
  transition: all 0.1s ease;
}

.btn-click:active {
  transform: scale(0.95);
}

/* Enhanced Hover Effects */
.hover-glow-strong {
  transition: all 0.3s ease;
}

.hover-glow-strong:hover {
  box-shadow: 0 0 30px rgba(0, 255, 0, 0.4);
  transform: translateY(-2px);
}

/* Stagger Animation Improvements */
.stagger-children-enhanced > * {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s ease-out forwards;
}

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

/* Typing Effect Enhancements */
@keyframes typingEnhanced {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes blinkEnhanced {
  0%, 50% {
    border-color: #f76f35;
  }
  51%, 100% {
    border-color: transparent;
  }
}

.animate-typing-enhanced {
  overflow: hidden;
  border-right: 3px solid #f76f35;
  white-space: nowrap;
  animation: typingEnhanced 4s steps(40, end), blinkEnhanced 1s infinite;
}

/* Carousel Enhancements */
@keyframes carouselSlideIn {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.carousel-item-enter {
  animation: carouselSlideIn 0.5s ease forwards;
}

/* Progressive Text Reveal */
@keyframes textReveal {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.text-reveal {
  opacity: 0;
  animation: textReveal 0.8s ease forwards;
}

.text-reveal.delay-1 { animation-delay: 0.2s; }
.text-reveal.delay-2 { animation-delay: 0.4s; }
.text-reveal.delay-3 { animation-delay: 0.6s; }

/* Mobile optimizations */
@media (max-width: 768px) {
  .animate-fade-in-up,
  .animate-fade-in-left,
  .animate-fade-in-right {
    animation-duration: 0.4s;
  }

  .hover-lift:hover {
    transform: none;
  }

  .lightbox-content {
    max-width: 95%;
    max-height: 95%;
  }

  .toast-notification {
    left: 10px;
    right: 10px;
    top: 10px;
  }
}
