/* Advanced UI Components */

/* Cursor Follower */
.cursor-follower {
  position: fixed;
  width: 20px;
  height: 20px;
  pointer-events: none;
  z-index: 9999;
  border-radius: 50%;
  background: var(--color-primary-500);
  mix-blend-mode: difference;
  transition: transform var(--motion-medium) var(--motion-ease);
  transform: translate(-50%, -50%) scale(1);
  opacity: 0.5;
}

.cursor-follower.active {
  transform: translate(-50%, -50%) scale(1.5);
  opacity: 0.75;
}

/* Timeline Component */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  padding: var(--space-xl) 0;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  height: 100%;
  width: 2px;
  background: var(--color-border);
  transform: translateX(-50%);
}

.timeline-item {
  display: flex;
  justify-content: flex-end;
  padding: var(--space-lg) 0;
  width: 100%;
  position: relative;
}

.timeline-item:nth-child(odd) {
  justify-content: flex-start;
}

.timeline-content {
  width: 45%;
  padding: var(--space-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  position: relative;
}

.timeline-content::before {
  content: "";
  position: absolute;
  top: 50%;
  width: 20px;
  height: 2px;
  background: var(--color-border);
}

.timeline-item:nth-child(odd) .timeline-content::before {
  right: -20px;
}

.timeline-item:nth-child(even) .timeline-content::before {
  left: -20px;
}

.timeline-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-primary-500);
  transform: translate(-50%, -50%);
  transition: transform var(--motion-medium) var(--motion-bounce);
}

.timeline-item:hover .timeline-dot {
  transform: translate(-50%, -50%) scale(1.2);
}

/* Skill Bars */
.skill-bar {
  width: 100%;
  height: 8px;
  background: var(--color-surface-alt);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.skill-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--color-primary-500),
    var(--color-accent-500)
  );
  transform-origin: left;
  transition: transform var(--motion-slow) var(--motion-emphasis);
}

/* Advanced Cards */
.glass-card {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.1),
    rgba(255, 255, 255, 0.05)
  );
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-lg);
}

.morph-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  position: relative;
  transition: all var(--motion-medium) var(--motion-ease);
}

.morph-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(
    135deg,
    var(--color-primary-500),
    var(--color-accent-500)
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

/* Animated Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  padding: var(--space-xs) var(--space-sm);
  background: var(--color-surface-alt);
  border-radius: var(--radius-full);
  font-size: var(--font-xs);
  color: var(--color-text-secondary);
  position: relative;
  overflow: hidden;
}

.badge::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transform: translateX(-100%);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

/* Scroll Progress */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--color-surface-alt);
  z-index: 1000;
}

.scroll-progress-bar {
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--color-primary-500),
    var(--color-accent-500)
  );
  transform-origin: left;
  transition: transform var(--motion-fast) linear;
}

/* Text Effects */
.gradient-text {
  background: linear-gradient(
    135deg,
    var(--color-primary-500),
    var(--color-accent-500)
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: hue-rotate 10s linear infinite;
}

@keyframes hue-rotate {
  from {
    filter: hue-rotate(0deg);
  }
  to {
    filter: hue-rotate(360deg);
  }
}

/* Advanced Buttons */
.pulse-button {
  position: relative;
}

.pulse-button::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0;
  }
  50% {
    opacity: 1;
    box-shadow: 0 0 0 2px var(--color-primary-500);
  }
}

/* Loading States */
.loading-skeleton {
  background: linear-gradient(
    90deg,
    var(--color-surface-alt) 25%,
    var(--color-surface) 37%,
    var(--color-surface-alt) 63%
  );
  background-size: 400% 100%;
  animation: skeleton-loading 1.4s ease infinite;
}

@keyframes skeleton-loading {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

/* Media Queries */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
