* {
  box-sizing: border-box;
}

body {
  font-family: 'Bricolage Grotesque', sans-serif;
  margin: 0;
  transition: background-color 0.5s ease;
}

body.dark-mode {
  background-color: #1a1a2e;
}

body.dark-mode .insight-card {
  background: linear-gradient(135deg, #252545 0%, #1a1a2e 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .insight-card h3 {
  color: #fff;
}

body.dark-mode header {
  background: rgba(26, 26, 46, 0.85) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

body.dark-mode input[type="text"] {
  background: #252545;
  border-color: #3d3d6b;
  color: #fff;
}

body.dark-mode input[type="text"]::placeholder {
  color: #888;
}

.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Slider styling */
.slider {
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, #4ECDC4, #FFE66D);
  outline: none;
  cursor: pointer;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  border: none;
}

/* Card animations */
.card-entrance {
  animation: cardEnter 0.5s ease forwards;
  opacity: 0;
  transform: translateY(20px);
}

@keyframes cardEnter {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fadeIn {
  animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.shake {
  animation: shake 0.5s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px) rotate(-2deg); }
  40% { transform: translateX(10px) rotate(2deg); }
  60% { transform: translateX(-8px) rotate(-1deg); }
  80% { transform: translateX(8px) rotate(1deg); }
}

/* Subtle grain texture */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%' height='100%' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
  z-index: 9999;
}

/* Insight card hover effect */
.insight-card {
  position: relative;
  overflow: hidden;
}

.insight-card::before {
  content: '';
  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.5s ease;
}

.insight-card:hover::before {
  left: 100%;
}

/* Canvas responsiveness */
canvas {
  max-width: 100%;
  height: auto;
}

/* Mobile optimizations */
@media (max-width: 640px) {
  .slider {
    height: 12px;
  }
  
  .slider::-webkit-slider-thumb {
    width: 28px;
    height: 28px;
  }
  
  .slider::-moz-range-thumb {
    width: 28px;
    height: 28px;
  }
}

/* Category buttons */
button {
  font-family: 'Bricolage Grotesque', sans-serif;
}

/* Dark mode adjustments for canvases */
body.dark-mode canvas {
  filter: brightness(0.95);
}

/* Fancy gradient text */
.gradient-text {
  background: linear-gradient(135deg, #FF6B6B 0%, #4ECDC4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Loading animation for future use */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

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

/* Bounce animation */
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-30px); }
}

.animate-bounce {
  animation: bounce 0.6s ease infinite;
}

/* Font mono for numbers */
.font-mono {
  font-family: 'JetBrains Mono', monospace;
}