/* Custom Animations */
@keyframes fade-in-up {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slide-in-left {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slide-in-right {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(0, 255, 194, 0.3);
  }
  50% {
    box-shadow: 0 0 40px rgba(0, 255, 194, 0.6);
  }
}

/* Animation Classes */
.animate-fade-in-up {
  animation: fade-in-up 0.8s ease-out forwards;
}

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

.animate-slide-in-left {
  animation: slide-in-left 0.8s ease-out forwards;
}

.animate-slide-in-right {
  animation: slide-in-right 0.8s ease-out forwards;
}

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

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #0E0E2C;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #FF4EC2, #00FFC2);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #00FFC2, #4ECAFF);
}

/* Loading State for Images */
img {
  transition: opacity 0.3s ease;
}

img:not([src]) {
  opacity: 0;
}

/* Prevent layout shift */
section {
  will-change: transform;
}

/* Enhanced Focus States */
input:focus,
textarea:focus,
button:focus {
  outline: 2px solid #00FFC2;
  outline-offset: 2px;
}

/* Glassmorphism Effect */
.glass {
  background: rgba(26, 26, 64, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Text Selection */
::selection {
  background-color: #00FFC2;
  color: #0E0E2C;
}

/* Smooth Transitions */
* {
  transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform;
  transition-duration: 200ms;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Card Hover Effects */
.group:hover {
  transform: translateY(-8px) !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Button Pulse Effect */
@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 10px rgba(0, 255, 194, 0.3);
  }
  50% {
    box-shadow: 0 0 20px rgba(0, 255, 194, 0.6);
  }
}

.rainbow-button:hover {
  box-shadow: 0 10px 30px rgba(255, 110, 196, 0.5);
}

/* Mobile Responsiveness Enhancements */
@media (max-width: 768px) {
  .animate-fade-in-up {
    animation-duration: 0.5s;
  }

  section {
    padding-top: 4rem !important;
    padding-bottom: 4rem !important;
  }

  h1 {
    font-size: 2.5rem !important;
  }

  h2 {
    font-size: 2rem !important;
  }
}

/* Reduced 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;
    scroll-behavior: auto !important;
  }
}

/* Print Styles */
@media print {
  nav,
  button,
  .social-links {
    display: none !important;
  }

  section {
    page-break-inside: avoid;
  }
}

/* Loading Animation */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.loading {
  animation: shimmer 2s infinite;
  background: linear-gradient(
    to right,
    #0E0E2C 4%,
    #1A1A40 25%,
    #0E0E2C 36%
  );
  background-size: 1000px 100%;
}

/* Gradient Text Effect */
.gradient-text {
  background: linear-gradient(135deg, #FF4EC2, #00FFC2, #4ECAFF);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Floating Animation for Icons */
@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

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

/* Hide elements initially for scroll animation */
section > *:not(.absolute) {
  opacity: 0;
  transform: translateY(20px);
}

section.animate-fade-in-up > * {
  opacity: 1;
  transform: translateY(0);
}
