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

:root {
    --primary: #6366f1;
    --secondary: #8b5cf6;
}

.dark {
    --primary: #818cf8;
    --secondary: #a78bfa;
}

/* Custom scrollbar */
/* Toast notifications */
.toast {
    @apply fixed top-4 right-4 px-4 py-3 rounded-md shadow-xl z-50;
    @apply transform transition-all duration-300 ease-in-out;
    @apply translate-x-full;
    @apply flex items-start space-x-2;
    @apply max-w-xs;
}

.toast i {
    @apply w-5 h-5 mt-0.5 flex-shrink-0;
}
.toast.show {
    @apply translate-x-0;
}

.toast.success {
    @apply bg-green-500 text-white;
}

.toast.error {
    @apply bg-red-500 text-white;
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.dark ::-webkit-scrollbar-track {
    background: #1e1e1e;
}

::-webkit-scrollbar-thumb {
    background: #c7d2fe;
    border-radius: 4px;
}

.dark ::-webkit-scrollbar-thumb {
    background: #4f46e5;
}

/* Loading spinner */
.loading-spinner {
    @apply inline-block w-4 h-4 border-2 border-current border-t-transparent rounded-full animate-spin;
}

/* Animation for loading */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Markdown preview styles */
.markdown-preview {
    @apply p-4 overflow-y-auto;
}

.markdown-preview h1 {
    @apply text-2xl font-bold mb-4;
}

.markdown-preview h2 {
    @apply text-xl font-semibold mb-3;
}

.markdown-preview p {
    @apply mb-2;
}

.markdown-preview ul {
    @apply list-disc pl-5 mb-4;
}

.markdown-preview ol {
    @apply list-decimal pl-5 mb-4;
}

.markdown-preview code {
    @apply bg-gray-200 dark:bg-gray-700 px-1 py-0.5 rounded text-sm;
}

.markdown-preview pre {
    @apply bg-gray-800 text-gray-100 p-4 rounded mb-4 overflow-x-auto;
}

.markdown-preview blockquote {
    @apply border-l-4 border-gray-300 dark:border-gray-600 pl-4 italic;
}
