* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

.gradient-text {
  background: linear-gradient(135deg, #6B21A8 0%, #EC4899 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Smooth transitions for ultra butter mode */
.ultra-smooth * {
  transition-duration: 400ms !important;
  transition-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

/* Knowledge card hover effect */
.knowledge-card {
  transform-style: preserve-3d;
}

.knowledge-card:hover {
  box-shadow: 0 20px 40px -12px rgba(107, 33, 168, 0.25);
}

/* Optimization entry animation */
.optimization-entry {
  animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Confetti animation */
.confetti-particle {
  position: absolute;
  top: -10px;
  border-radius: 2px;
  animation: confettiFall linear forwards;
}

@keyframes confettiFall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* Progress line animation */
.progress-line {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: drawLine 2s ease-out forwards;
}

@keyframes drawLine {
  to {
    stroke-dashoffset: 0;
  }
}

/* Milestone dot animation */
.milestone-dot {
  animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
}

/* Counter animation */
.counter-animate {
  animation: countUp 0.5s ease-out;
}

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

/* Quote fade animation */
.quote-fade {
  animation: quoteFade 8s ease-in-out infinite;
}

@keyframes quoteFade {
  0%, 90%, 100% {
    opacity: 1;
  }
  95% {
    opacity: 0;
  }
}

/* Modal animation */
.modal-content {
  animation: modalSlide 0.3s ease-out;
}

@keyframes modalSlide {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Pulse slow animation for ultra butter */
.animate-pulse-slow {
  animation: pulseSlow 2s ease-in-out infinite;
}

@keyframes pulseSlow {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.animate-ping-slow {
  animation: pingSlow 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes pingSlow {
  75%, 100% {
    transform: scale(2);
    opacity: 0;
  }
}

/* Mobile responsive improvements */
@media (max-width: 640px) {
  .knowledge-card {
    padding: 12px;
  }
  
  .gradient-text {
    font-size: 1.5rem;
  }
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #6B21A8, #EC4899);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #7C3AED, #F472B6);
}

/* Line clamp utility */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Dark mode body class */
body.dark-mode {
  background-color: #0f172a;
}

/* Button press effect */
button:active {
  transform: scale(0.98);
}

/* Focus visible for accessibility */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #6B21A8;
  outline-offset: 2px;
}

/* Selection color */
::selection {
  background: rgba(107, 33, 168, 0.3);
  color: inherit;
}