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

@layer base {
  html {
    font-family: system-ui, sans-serif;
    scroll-behavior: smooth;
    overflow-x: hidden;
  }
  
  body {
    @apply transition-colors duration-300;
    overflow-x: hidden;
    max-width: 100vw;
  }
  
  /* Prevent horizontal scroll on all elements */
  * {
    max-width: 100%;
  }
}

@layer components {
  .prose {
    @apply text-gray-700 dark:text-gray-300;
  }
  
  .prose h1,
  .prose h2,
  .prose h3,
  .prose h4,
  .prose h5,
  .prose h6 {
    @apply text-gray-900 dark:text-white;
  }
  
  .prose a {
    @apply text-primary-600 dark:text-primary-400 no-underline hover:underline;
  }
  
  .prose code {
    @apply text-primary-700 dark:text-primary-300 bg-gray-100 dark:bg-gray-800 px-1 py-0.5 rounded text-sm;
  }
  
  .prose pre {
    @apply bg-gray-900 dark:bg-gray-800 text-gray-100 p-4 rounded-lg overflow-x-auto;
  }
  
  .prose pre code {
    @apply bg-transparent text-inherit p-0;
  }
  
  .prose blockquote {
    @apply border-l-4 border-primary-500 bg-primary-50 dark:bg-primary-900/20 pl-4 py-2 my-4 italic;
  }
  
  .prose img {
    @apply rounded-lg shadow-sm;
  }
  
  .prose table {
    @apply w-full border-collapse;
  }
  
  .prose th,
  .prose td {
    @apply border border-gray-300 dark:border-gray-700 px-4 py-2;
  }
  
  .prose th {
    @apply bg-gray-50 dark:bg-gray-800 font-semibold;
  }
}

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

::-webkit-scrollbar-track {
  @apply bg-gray-100 dark:bg-gray-800;
}

::-webkit-scrollbar-thumb {
  @apply bg-gray-400 dark:bg-gray-600 rounded-full;
}

::-webkit-scrollbar-thumb:hover {
  @apply bg-gray-500 dark:bg-gray-500;
}

/* Focus styles */
:focus {
  @apply outline-none;
}

:focus-visible {
  @apply ring-2 ring-primary-500 ring-offset-2 ring-offset-white dark:ring-offset-gray-900;
}

/* Animation utilities */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.3s ease-out;
}

/* Print styles */
@media print {
  .no-print {
    display: none !important;
  }
}
