/* ==========================================
   ADVANCED ANIMATIONS & EFFECTS
   ========================================== */

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

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

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary-color), var(--accent-color));
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--primary-dark), var(--primary-color));
}

/* Selection styles */
::selection {
  background: var(--primary-color);
  color: white;
}

::-moz-selection {
  background: var(--primary-color);
  color: white;
}

/* Focus styles for accessibility */
button:focus,
a:focus,
input:focus,
textarea:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Loading state animations */
.loading {
  position: relative;
  overflow: hidden;
}

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

@keyframes shimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

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

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

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

/* Pulse effect */
.pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7);
  }
  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 10px rgba(99, 102, 241, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
  }
}

/* Glow effect */
.glow {
  box-shadow: 0 0 20px var(--primary-color);
}

.glow-hover:hover {
  box-shadow: 0 0 30px var(--primary-color);
  transition: box-shadow var(--transition-normal);
}

/* Text effects */
.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-shadow {
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Hover lift effect */
.hover-lift {
  transition: all var(--transition-normal);
}

.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
}

/* Scale effect */
.hover-scale {
  transition: transform var(--transition-normal);
}

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

/* Rotate effect */
.hover-rotate {
  transition: transform var(--transition-normal);
}

.hover-rotate:hover {
  transform: rotate(5deg);
}

/* Tilt effect */
.tilt {
  transition: transform var(--transition-normal);
}

.tilt:hover {
  transform: perspective(1000px) rotateX(5deg) rotateY(5deg);
}

/* Magnetic effect for buttons */
.magnetic {
  position: relative;
  transition: all var(--transition-normal);
}

.magnetic:hover {
  transform: scale(1.1);
}

/* Spotlight effect */
.spotlight {
  position: relative;
  overflow: hidden;
}

.spotlight::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  transform: scale(0);
  transition: transform 0.6s ease;
  pointer-events: none;
}

.spotlight:hover::before {
  transform: scale(1);
}

/* Parallax effect */
.parallax {
  transform: translateZ(0);
  transition: transform 0.3s ease;
}

/* Advanced gradient backgrounds */
.gradient-bg-1 {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.gradient-bg-2 {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.gradient-bg-3 {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.gradient-bg-4 {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

/* Glass morphism variations */
.glass-heavy {
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.glass-light {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Neumorphism effect */
.neumorphism {
  background: #e0e5ec;
  border-radius: 20px;
  box-shadow: 
    9px 9px 16px #a3b1c6,
    -9px -9px 16px #ffffff;
}

.neumorphism-dark {
  background: #2d3748;
  border-radius: 20px;
  box-shadow: 
    9px 9px 16px #1a202c,
    -9px -9px 16px #404b64;
}

/* Loading spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(99, 102, 241, 0.3);
  border-left-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Progress bars */
.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 4px;
  transition: width 1s ease;
}

/* Badge styles */
.badge-modern {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--gradient-primary);
  color: white;
  border-radius: 25px;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Card stack effect */
.card-stack {
  position: relative;
}

.card-stack::before,
.card-stack::after {
  content: '';
  position: absolute;
  top: 8px;
  left: 8px;
  right: -8px;
  bottom: -8px;
  background: var(--bg-glass);
  border-radius: inherit;
  z-index: -1;
  opacity: 0.7;
}

.card-stack::after {
  top: 16px;
  left: 16px;
  right: -16px;
  bottom: -16px;
  opacity: 0.4;
}

/* Typewriter effect */
.typewriter {
  overflow: hidden;
  border-right: 3px solid var(--primary-color);
  white-space: nowrap;
  margin: 0 auto;
  animation: 
    typing 3.5s steps(40, end),
    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);
  }
}

/* Slide animations */
.slide-in-left {
  animation: slideInLeft 0.6s ease-out;
}

.slide-in-right {
  animation: slideInRight 0.6s ease-out;
}

@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);
  }
}

/* Zoom animations */
.zoom-in {
  animation: zoomIn 0.6s ease-out;
}

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.3);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Fade animations */
.fade-in {
  animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Utilities */
.cursor-pointer {
  cursor: pointer;
}

.user-select-none {
  user-select: none;
}

.overflow-hidden {
  overflow: hidden;
}

.position-relative {
  position: relative;
}

.z-index-high {
  z-index: 1000;
}

/* Print styles */
@media print {
  .no-print {
    display: none !important;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
  
  .glass-card {
    background: white !important;
    border: 1px solid #ccc !important;
    box-shadow: none !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --primary-color: #000080;
    --text-primary: #000000;
    --text-secondary: #333333;
    --bg-primary: #ffffff;
  }
}

/* Enhanced interactive states */
.keyboard-focus {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
}

.animate-in {
  opacity: 1;
  transform: translateY(0);
  transition: all 0.6s ease-out;
}

.stagger-child {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease-out;
}

.stagger-child.animate-in {
  opacity: 1;
  transform: translateY(0);
}

/* Performance optimizations */
.reduced-animations *,
.reduced-animations *::before,
.reduced-animations *::after {
  animation-duration: 0.3s !important;
  transition-duration: 0.3s !important;
}

.paused-animations * {
  animation-play-state: paused !important;
}

/* Removed custom cursor - using default browser cursor */
/* Custom cursor functionality disabled for better user experience */

/* Enhanced particle animation */
@keyframes particleFloat {
  0%, 100% { 
    transform: translateY(0px) rotate(0deg); 
    opacity: 0.3;
  }
  25% { 
    transform: translateY(-20px) rotate(90deg); 
    opacity: 0.7;
  }
  50% { 
    transform: translateY(0px) rotate(180deg); 
    opacity: 1;
  }
  75% { 
    transform: translateY(20px) rotate(270deg); 
    opacity: 0.7;
  }
}

/* Enhanced glassmorphism */
.glass-enhanced {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.1),
    rgba(255, 255, 255, 0.05)
  );
  backdrop-filter: blur(20px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Smooth state transitions */
* {
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

/* Focus trap styles */
.focus-trap:focus-within {
  outline: 2px solid var(--primary-color);
  outline-offset: 4px;
  border-radius: var(--border-radius-md);
}

/* Loading states */
.loading-skeleton {
  background: linear-gradient(90deg, 
    rgba(255, 255, 255, 0.1) 25%, 
    rgba(255, 255, 255, 0.2) 50%, 
    rgba(255, 255, 255, 0.1) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

/* Reduced motion support */
@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;
  }
  
  .particles-bg,
  .custom-cursor,
  .particle {
    display: none !important;
  }
}