/* ============================================
   OPTIMIZED PERFORMANCE & SMOOTH ANIMATIONS
   Professional Portfolio Enhancement
   ============================================ */

/* ============================================
   CORE PERFORMANCE OPTIMIZATIONS
   ============================================ */

/* Hardware Acceleration & GPU Optimization - Ultra Optimized */
* {
  /* Universal optimization for maximum smoothness */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.gpu-accelerated,
.enhanced-card,
.card,
.btn,
.project-card,
.experience-card {
  transform: translate3d(0, 0, 0); /* Force GPU acceleration */
  backface-visibility: hidden;
  perspective: 1000px;
  -webkit-perspective: 1000px;
  -webkit-backface-visibility: hidden;
  -webkit-transform: translate3d(0, 0, 0);
}

/* Smooth Scrolling with Performance - Ultra Optimized */
html {
  scroll-behavior: auto; /* Instant scrolling for better performance */
  scroll-padding-top: 4rem;
  -webkit-overflow-scrolling: touch; /* Smooth momentum scrolling on iOS */
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Optimize Paint & Layout */
.optimize-paint {
  contain: layout style paint;
}

/* ============================================
   PROFESSIONAL BACKGROUND EFFECTS
   ============================================ */

/* Subtle Floating Orbs - Disabled for performance */
.floating-orbs {
  display: none !important; /* Disabled for maximum performance */
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  will-change: auto;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px); /* Reduced blur for better performance */
  opacity: 0.2; /* Reduced opacity */
  animation: float-orb 30s infinite ease-in-out; /* Slower animation */
  will-change: auto; /* Remove will-change for better performance */
}

.orb-1 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.25) 0%, transparent 70%);
  top: -15%;
  left: -10%;
  animation-duration: 28s;
}

.orb-2 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(217, 70, 239, 0.2) 0%, transparent 70%);
  bottom: -15%;
  right: -10%;
  animation-duration: 32s;
  animation-delay: -12s;
}

@keyframes float-orb {
  0%, 100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  33% {
    transform: translate3d(30px, -20px, 0) scale(1.08);
  }
  66% {
    transform: translate3d(-20px, 15px, 0) scale(0.95);
  }
}

/* ============================================
   PROFESSIONAL SCROLL PROGRESS BAR
   ============================================ */

.scroll-progress {
  display: none !important; /* Disabled for maximum scroll performance */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.05);
  z-index: 9999;
  pointer-events: none;
}

.scroll-progress-bar {
  height: 100%;
  background: var(--gradient-primary);
  transform-origin: left;
  transform: scaleX(0) translateZ(0);
  will-change: auto;
  box-shadow: none; /* Disabled shadow */
}

/* ============================================
   PROFESSIONAL ENHANCED CARD EFFECTS
   ============================================ */

.enhanced-card {
  position: relative;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: auto; /* Remove will-change for better performance */
}

/* Shimmer effect on hover - Disabled for better performance */
.enhanced-card::before {
  content: '';
  display: none; /* Disabled shimmer effect for performance */
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  transition: left 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.enhanced-card:hover::before {
  /* left: 100%; */ /* Disabled */
}

.enhanced-card:hover {
  transform: translateY(-4px) translateZ(0); /* Reduced lift */
  box-shadow:
    0 12px 24px rgba(0, 0, 0, 0.2), /* Simpler shadow */
    0 0 0 1px rgba(14, 165, 233, 0.2);
}

/* Remove will-change after transition */
.enhanced-card:not(:hover) {
  will-change: auto;
}

/* ============================================
   SMOOTH REVEAL ON SCROLL ANIMATIONS
   ============================================ */

.reveal-enhanced {
  opacity: 0;
  transform: translateY(40px) translateZ(0);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-enhanced.visible {
  opacity: 1;
  transform: translateY(0) translateZ(0);
}

/* ============================================
   PROFESSIONAL STAGGER ANIMATIONS
   ============================================ */

.stagger-animation > * {
  opacity: 0;
  transform: translateY(20px) translateZ(0);
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.stagger-animation.animate > *:nth-child(1) {
  transition-delay: 0.08s;
  opacity: 1;
  transform: translateY(0) translateZ(0);
}
.stagger-animation.animate > *:nth-child(2) {
  transition-delay: 0.16s;
  opacity: 1;
  transform: translateY(0) translateZ(0);
}
.stagger-animation.animate > *:nth-child(3) {
  transition-delay: 0.24s;
  opacity: 1;
  transform: translateY(0) translateZ(0);
}
.stagger-animation.animate > *:nth-child(4) {
  transition-delay: 0.32s;
  opacity: 1;
  transform: translateY(0) translateZ(0);
}
.stagger-animation.animate > *:nth-child(5) {
  transition-delay: 0.40s;
  opacity: 1;
  transform: translateY(0) translateZ(0);
}
.stagger-animation.animate > *:nth-child(6) {
  transition-delay: 0.48s;
  opacity: 1;
  transform: translateY(0) translateZ(0);
}

/* ============================================
   PROFESSIONAL SHIMMER TEXT EFFECT
   ============================================ */

.shimmer-text {
  background: linear-gradient(
    110deg,
    var(--primary-400) 0%,
    var(--accent-400) 50%,
    var(--primary-400) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer-slide 6s ease-in-out infinite; /* Slower for better performance */
  will-change: auto; /* Remove will-change */
}

@keyframes shimmer-slide {
  0%, 100% {
    background-position: 0% center;
  }
  50% {
    background-position: 200% center;
  }
}

/* ============================================
   SMOOTH PULSE RING ANIMATION
   ============================================ */

.pulse-ring {
  position: relative;
}

.pulse-ring::before,
.pulse-ring::after {
  content: '';
  display: none !important; /* Disabled for maximum performance */
  position: absolute;
  inset: -10px;
  border: 1px solid var(--primary-400);
  border-radius: inherit;
  opacity: 0;
  animation: none; /* Disabled animation */
  pointer-events: none;
}

.pulse-ring::after {
  animation-delay: 0s;
}

@keyframes pulse-expand {
  0% {
    transform: scale(0.85) translateZ(0);
    opacity: 0.9;
  }
  50% {
    opacity: 0.4;
  }
  100% {
    transform: scale(1.4) translateZ(0);
    opacity: 0;
  }
}

/* ============================================
   SMOOTH IMAGE HOVER ZOOM
   ============================================ */

.image-zoom-container {
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.image-zoom {
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1); /* Faster, smoother */
  will-change: auto; /* Remove will-change */
}

.image-zoom-container:hover .image-zoom {
  transform: scale(1.05) translateZ(0); /* Reduced scale */
}

/* ============================================
   PROFESSIONAL FLOAT IN ANIMATION
   ============================================ */

@keyframes float-in {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.98) translateZ(0);
  }
  60% {
    opacity: 0.8;
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1) translateZ(0);
  }
}

/* ============================================
   MOBILE OPTIMIZATIONS FOR PERFORMANCE
   ============================================ */

@media (max-width: 768px) {
  /* Reduce animations on mobile for better performance */
  .floating-orbs {
    display: none;
  }

  .enhanced-card:hover {
    transform: translateY(-4px) translateZ(0);
  }

  .shimmer-text {
    animation-duration: 6s;
  }

  .pulse-ring::before,
  .pulse-ring::after {
    display: none;
  }

  /* Faster transitions on mobile */
  .reveal-enhanced {
    transition-duration: 0.5s;
  }

  .stagger-animation > * {
    transition-duration: 0.3s;
  }
}

/* ============================================
   PROFESSIONAL MICRO-INTERACTIONS
   ============================================ */

/* Button Press Effect */
.btn:active {
  transform: scale(0.96) translateZ(0);
  transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Card Active State */
.card:active {
  transform: scale(0.98) translateZ(0);
}

/* Smooth Focus States */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--primary-400);
  outline-offset: 3px;
  border-radius: 4px;
  transition: outline-offset 0.2s ease;
}

/* Link Hover Underline */
.nav-link {
  position: relative;
}

.nav-link::after {
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   THEME-SPECIFIC ENHANCEMENTS
   ============================================ */

[data-theme="dark"] .enhanced-card:hover {
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(14, 165, 233, 0.25),
    0 0 20px rgba(14, 165, 233, 0.2);
}

[data-theme="light"] .enhanced-card:hover {
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.12),
    0 0 0 1px rgba(14, 165, 233, 0.2),
    0 0 20px rgba(14, 165, 233, 0.12);
}

[data-theme="light"] .orb {
  opacity: 0.18;
  filter: blur(100px);
}

[data-theme="light"] .scroll-progress {
  background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .scroll-progress-bar {
  box-shadow: 0 0 10px rgba(14, 165, 233, 0.3);
}

/* ============================================
   LOADING & SKELETON STATES
   ============================================ */

.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-secondary) 25%,
    var(--bg-tertiary) 50%,
    var(--bg-secondary) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-lg);
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================
   PERFORMANCE HINTS
   ============================================ */

/* Content Containment for Better Performance */
.section {
  contain: layout style;
}

.card {
  contain: layout style paint;
}

/* ============================================
   PROFESSIONAL SKILLS SECTION
   ============================================ */

.skills-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-6);
  margin-bottom: var(--space-12);
}

.skill-category {
  padding: var(--space-6);
}

.skill-category-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.skill-category-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-primary);
  border-radius: var(--radius-xl);
  color: white;
}

.skill-category-title {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.skills-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.skill-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.skill-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-1);
}

.skill-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: var(--font-size-base);
}

.skill-percentage {
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: var(--font-size-sm);
}

.skill-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

[data-theme="light"] .skill-bar {
  background: rgba(0, 0, 0, 0.08);
}

.skill-progress {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  width: 0%;
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.skill-progress::after {
  content: '';
  display: none; /* Disabled shimmer for performance */
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  animation: shimmer-skill 3s infinite; /* Slower */
}

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

/* ============================================
   CIRCULAR SKILLS
   ============================================ */

.circular-skills-container {
  margin-top: var(--space-12);
  padding: var(--space-8);
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-3xl);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .circular-skills-container {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(255, 255, 255, 0.4);
}

.circular-skills-title {
  text-align: center;
  font-size: var(--font-size-2xl);
  font-weight: 700;
  margin-bottom: var(--space-8);
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.circular-skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-8);
  justify-items: center;
}

.circular-skill {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}

.circular-progress {
  transform: rotate(-90deg);
  filter: drop-shadow(0 0 10px rgba(14, 165, 233, 0.3));
}

.circular-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.05);
  stroke-width: 8;
}

[data-theme="light"] .circular-bg {
  stroke: rgba(0, 0, 0, 0.08);
}

.circular-bar {
  fill: none;
  stroke: url(#circularGradient);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 377;
  stroke-dashoffset: 377;
  transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.circular-skill-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
}

.circular-percentage {
  font-size: var(--font-size-xl);
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.circular-name {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  text-align: center;
  font-weight: 500;
}

/* ============================================
   ENHANCED BACKGROUND ANIMATIONS
   ============================================ */

/* Gradient Mesh Background - Disabled for performance */
.gradient-mesh {
  display: none !important; /* Disabled for maximum performance */
  position: fixed;
  inset: 0;
  z-index: -2;
  opacity: 0.4;
  background: radial-gradient(at 0% 0%, rgba(14, 165, 233, 0.2) 0px, transparent 50%),
              radial-gradient(at 100% 0%, rgba(217, 70, 239, 0.2) 0px, transparent 50%),
              radial-gradient(at 100% 100%, rgba(14, 165, 233, 0.2) 0px, transparent 50%),
              radial-gradient(at 0% 100%, rgba(217, 70, 239, 0.2) 0px, transparent 50%);
  animation: gradient-mesh-move 15s ease-in-out infinite;
}

@keyframes gradient-mesh-move {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.05); }
}

/* Animated Grid Background - Disabled for performance */
.grid-background {
  display: none !important; /* Disabled for maximum performance */
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(14, 165, 233, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14, 165, 233, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: grid-move 20s linear infinite;
  opacity: 0.5;
}

@keyframes grid-move {
  0% { transform: translate(0, 0); }
  100% { transform: translate(50px, 50px); }
}

/* Floating Particles - Disabled for performance */
.floating-particle {
  display: none !important; /* Disabled for maximum performance */
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--primary-400);
  border-radius: 50%;
  opacity: 0.6;
  animation: float-particle 8s infinite ease-in-out;
  box-shadow: 0 0 10px var(--primary-400);
}

@keyframes float-particle {
  0%, 100% {
    transform: translateY(0) translateX(0);
    opacity: 0;
  }
  10% {
    opacity: 0.6;
  }
  90% {
    opacity: 0.6;
  }
  100% {
    transform: translateY(-100vh) translateX(20px);
    opacity: 0;
  }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
  .skills-container {
    grid-template-columns: 1fr;
  }

  .circular-skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .gradient-mesh,
  .grid-background {
    display: none;
  }
}