@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&family=JetBrains+Mono:wght@400;500;600&display=swap');

@tailwind base;
@tailwind components;
@tailwind utilities;

/* Import UI component library styles */
@import '../styles/ui.css';

:root {
  --foreground: 248 250 252;
  --background: 15 23 42;
  --accent: 6 182 212;
}

@layer base {
  html {
    @apply antialiased;
  }

  body {
    @apply bg-surface-950 text-slate-100;
    background-image: 
      radial-gradient(ellipse 80% 50% at 50% -20%, rgba(6, 182, 212, 0.08), transparent),
      url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%2394a3b8' fill-opacity='0.02'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  }

  /* Custom selection */
  ::selection {
    @apply bg-accent-500/30 text-white;
  }
}

/* Custom scrollbar */
@layer utilities {
  .scrollbar-thin {
    scrollbar-width: thin;
  }

  .scrollbar-thumb-surface-700::-webkit-scrollbar-thumb {
    @apply bg-surface-700 rounded-full;
  }

  .scrollbar-track-transparent::-webkit-scrollbar-track {
    @apply bg-transparent;
  }
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  @apply bg-surface-900;
}

::-webkit-scrollbar-thumb {
  @apply bg-surface-700 rounded-full;
}

::-webkit-scrollbar-thumb:hover {
  @apply bg-surface-600;
}

/* Glass morphism utilities */
@layer components {
  .glass {
    @apply bg-surface-800/60 backdrop-blur-xl border border-surface-700/50;
  }

  .glass-card {
    @apply bg-surface-800/40 backdrop-blur-md border border-surface-700/30 rounded-xl;
  }

  .glow-accent {
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.15), 0 0 40px rgba(6, 182, 212, 0.1);
  }
}

/* Chat-specific styles */
.chat-markdown pre {
  @apply bg-surface-900 rounded-lg p-4 overflow-x-auto my-2 border border-surface-700;
}

.chat-markdown code {
  @apply font-mono text-sm text-accent-300;
}

.chat-markdown table {
  @apply border-collapse w-full my-2;
}

.chat-markdown th,
.chat-markdown td {
  @apply border border-surface-700 px-3 py-2 text-left;
}

.chat-markdown th {
  @apply bg-surface-800 font-semibold text-slate-200;
}

/* Bounce animation for chat typing indicator */
@keyframes bounce {
  0%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-6px);
  }
}

.animate-bounce {
  animation: bounce 1.4s infinite ease-in-out;
}

/* Data visualization accents */
.data-grid-bg {
  background-image: 
    linear-gradient(to right, rgba(6, 182, 212, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(6, 182, 212, 0.03) 1px, transparent 1px);
  background-size: 20px 20px;
}

/* Gradient text utility */
.gradient-text {
  @apply bg-clip-text text-transparent bg-gradient-to-r from-accent-400 to-accent-600;
}

/* Focus ring utilities */
@layer utilities {
  .focus-ring {
    @apply focus:outline-none focus:ring-2 focus:ring-accent-500/50 focus:ring-offset-2 focus:ring-offset-surface-900;
  }
}
