/*
 * Atanexus Website Animations
 *
 * Includes:
 * 1. Logo pulsing/breathing animation
 * 2. Scroll-triggered animations
 * 3. Interactive hover effects
 * 4. Loading animations
 * 5. Transition effects
 */

/* ==================== Logo Animation ==================== */
@keyframes logoPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.9;
  }
}

.logo {
  animation: logoPulse 3s ease-in-out infinite;
}

.logo-link:hover .logo {
  animation: logoPulse 1s ease-in-out infinite;
}

/* ==================== Fade In Animations ==================== */
.fade-in {
  opacity: 0;
  animation: fadeIn 1s ease-out forwards;
}

.fade-in:nth-child(1) {
  animation-delay: 0.2s;
}

.fade-in:nth-child(2) {
  animation-delay: 0.4s;
}

.fade-in:nth-child(3) {
  animation-delay: 0.6s;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

/* Stagger animation for multiple elements */
.animate-on-scroll:nth-child(1) {
  transition-delay: 0s;
}

.animate-on-scroll:nth-child(2) {
  transition-delay: 0.1s;
}

.animate-on-scroll:nth-child(3) {
  transition-delay: 0.2s;
}

.animate-on-scroll:nth-child(4) {
  transition-delay: 0.3s;
}

.animate-on-scroll:nth-child(5) {
  transition-delay: 0.4s;
}

.animate-on-scroll:nth-child(6) {
  transition-delay: 0.5s;
}

/* ==================== Slide In Animations ==================== */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

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

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==================== Progress Bar Animation ==================== */
.progress-fill {
  animation: progressFill 2s ease-out forwards;
}

@keyframes progressFill {
  from {
    transform: scaleX(0);
    transform-origin: left;
  }
  to {
    transform: scaleX(1);
    transform-origin: left;
  }
}

/* ==================== Button Hover Effects ==================== */
.btn {
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition:
    width 0.6s,
    height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn:active {
  transform: scale(0.98);
}

/* ==================== Card Hover Effects ==================== */
.value-card,
.product-card {
  position: relative;
  overflow: hidden;
}

.value-card::before,
.product-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(61, 153, 166, 0.1), transparent);
  transition: left 0.5s;
}

.value-card:hover::before,
.product-card:hover::before {
  left: 100%;
}

/* ==================== Icon Animations ==================== */
.value-icon,
.product-icon,
.tech-icon {
  position: relative;
  overflow: hidden;
}

.value-icon::after,
.product-icon::after,
.tech-icon::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition:
    width 0.6s,
    height 0.6s;
}

.value-card:hover .value-icon::after,
.product-card:hover .product-icon::after,
.tech-item:hover .tech-icon::after {
  width: 200px;
  height: 200px;
}

/* Icon rotation on hover */
.value-icon svg,
.product-icon svg,
.tech-icon svg {
  transition: transform 0.3s ease;
}

.value-card:hover .value-icon svg,
.product-card:hover .product-icon svg,
.tech-item:hover .tech-icon svg {
  transform: scale(1.1) rotate(5deg);
}

/* ==================== Navigation Animations ==================== */
.navbar {
  transform: translateY(0);
  transition: transform 0.3s ease;
}

.navbar.hidden {
  transform: translateY(-100%);
}

/* Mobile menu slide-in animation */
.nav-menu {
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-links li {
  opacity: 0;
  transform: translateX(20px);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}

.nav-menu.active .nav-links li {
  opacity: 1;
  transform: translateX(0);
}

.nav-menu.active .nav-links li:nth-child(1) {
  transition-delay: 0.1s;
}

.nav-menu.active .nav-links li:nth-child(2) {
  transition-delay: 0.15s;
}

.nav-menu.active .nav-links li:nth-child(3) {
  transition-delay: 0.2s;
}

.nav-menu.active .nav-links li:nth-child(4) {
  transition-delay: 0.25s;
}

.nav-menu.active .nav-links li:nth-child(5) {
  transition-delay: 0.3s;
}

/* ==================== Form Animations ==================== */
.form-group input {
  transition: all 0.3s ease;
}

.form-group input:focus {
  transform: translateY(-2px);
}

/* Shake animation for form errors */
@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-5px);
  }
  20%,
  40%,
  60%,
  80% {
    transform: translateX(5px);
  }
}

.form-group input.error {
  animation: shake 0.5s;
  border: 2px solid #fca5a5;
}

/* Success animation */
@keyframes successPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.form-message.success {
  animation: successPulse 0.5s;
}

/* ==================== Loading Animation ==================== */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.btn-loader {
  animation: spin 0.6s linear infinite;
}

/* ==================== Parallax Effect ==================== */
.hero-background {
  transform: translateY(0);
  transition: transform 0.1s ease-out;
}

/* ==================== Scroll Progress Indicator ==================== */
@keyframes scrollProgress {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

/* ==================== Pulse Animation ==================== */
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* ==================== Bounce Animation ==================== */
@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

/* ==================== Glow Effect ==================== */
@keyframes glow {
  0%,
  100% {
    box-shadow: 0 0 5px rgba(61, 153, 166, 0.5);
  }
  50% {
    box-shadow: 0 0 20px rgba(61, 153, 166, 0.8);
  }
}

.btn-primary:focus {
  animation: glow 1.5s ease-in-out infinite;
}

/* ==================== Text Gradient Animation ==================== */
@keyframes gradientText {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.hero-title {
  background: linear-gradient(90deg, #ffffff, #d1d1d1, #ffffff);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  animation: gradientText 3s ease infinite;
}

/* ==================== Footer Links Animation ==================== */
.footer-links a {
  position: relative;
}

.footer-links a::before {
  content: '→';
  position: absolute;
  left: -20px;
  opacity: 0;
  transition: all 0.3s ease;
}

.footer-links a:hover::before {
  left: -15px;
  opacity: 1;
}

/* ==================== Social Links Animation ==================== */
.social-links a {
  position: relative;
}

.social-links a::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--secondary-color);
  transform: scale(0);
  transition: transform 0.3s ease;
  z-index: -1;
}

.social-links a:hover::before {
  transform: scale(1);
}

/* ==================== Cookie Banner Animation ==================== */
@keyframes slideUp {
  from {
    transform: translateY(100px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.cookie-banner {
  animation: slideUp 0.5s ease-out;
}

/* ==================== Geometric Pattern Animation ==================== */
.geometric-pattern {
  animation: patternMove 20s linear infinite;
}

@keyframes patternMove {
  0% {
    background-position:
      0 0,
      0 0;
  }
  100% {
    background-position:
      80px 80px,
      -80px 80px;
  }
}

/* ==================== Scroll Indicator Animation ==================== */
.scroll-indicator {
  animation: fadeInDelay 2s ease-out;
}

@keyframes fadeInDelay {
  0%,
  50% {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* ==================== CTA Section Background Animation ==================== */
@keyframes gradientShift {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.cta-section {
  background-size: 200% 200%;
  animation: gradientShift 15s ease infinite;
}

/* ==================== Reduce Motion for Accessibility ==================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .logo {
    animation: none;
  }

  .geometric-pattern {
    animation: none;
  }

  .hero-title {
    animation: none;
  }

  .scroll-arrow::after {
    animation: none;
  }
}

/* ==================== High Contrast Mode ==================== */
@media (prefers-contrast: high) {
  .btn {
    border-width: 3px;
  }

  .nav-link::after {
    height: 3px;
  }
}

/* ==================== Dark Mode Support (Future) ==================== */
@media (prefers-color-scheme: dark) {
  /* Placeholder for dark mode styles */
  /* Can be activated by adding class to body */
}
