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

/* Animations */
@keyframes fade-in-down {
  0% {
    opacity: 0;
    transform: translateY(-10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-out-up {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-10px);
  }
}

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

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

.chartkick-download-button {
  background-color: #4a90e2;
  color: white;
  border: none;
  padding: 10px 20px;
  font-size: 10px;
  border-radius: 5px;
  cursor: pointer;
}

.chartkick-download-button:hover {
  background-color: #357ABD;
}

textarea {
  resize: none !important;
}

.message.user-message {
  white-space: pre-wrap;
}


.scroll-sync-container {
  position: relative;
}

.scroll-top {
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
}

.scroll-bottom {
  overflow-x: auto;
  overflow-y: auto;
}

.scroll-top::-webkit-scrollbar {
  height: 8px;
}


/* 1. Base style for all lists (ul and ol) inside the message content */
/* This provides the Level 1 indentation and ensures markers show correctly. */
.llm-message-content ul,
.llm-message-content ol {
    /* CRITICAL: Allows nested lists to indent correctly */
    list-style-position: outside; 
    /* Base indentation for Level 1 */
    padding-left: 2em;           
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}

/* Ensure ordered lists use numbers and unordered lists use discs (overriding any base reset) */
.llm-message-content ol {
    list-style-type: decimal;
}

.llm-message-content ul {
    list-style-type: disc;
}

/* 2. Style for List Items (li) */
/* Reset padding on the list items, letting the parent ul/ol handle indentation */
.llm-message-content li {
    padding-left: 0; 
    margin-top: 0.25em;
    margin-bottom: 0.25em;
}

/* 3. Indentation for Nested Lists (Level 2 and deeper) */
/* Target lists inside other lists (e.g., ul inside li inside ul) to create levels */
.llm-message-content ul ul,
.llm-message-content ol ol {
    /* This margin creates the extra visual shift for nesting */
    margin-left: 1.5em;
    padding-left: 0; 
}

/* Optional: Change markers for visual distinction at deeper levels */
.llm-message-content ul ul {
    list-style-type: circle; /* Level 2 bullet style */
}

.llm-message-content ul ul ul {
    list-style-type: square; /* Level 3 bullet style */
}
.chart-container2 {
    position: relative;
    width: 100%; 
    max-width: 1485px; 
    height: 600px; 
    margin: 0 auto;
    display: flex;
    justify-content: center;
}

.center-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.center-text .total-value {
    font-size: 28px;
    font-weight: normal;
    color: #4a4a4a;
}

.center-text .total-label {
	font-size: 22px;
	font-weight: normal;
	color: #4a4a4a;
}

.dataTables_length select{
	padding-right: 30px !important;
	padding-left: 10px !important;
}

.dataTables_length{
	margin-bottom: 30px !important;
}
/* LLM Assistant UI Animations and Polish */

/* Fade in animation */
@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* Slide in from right */
@keyframes slide-in-right {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.animate-slide-in-right {
  animation: slide-in-right 0.3s ease-out forwards;
}

/* Pulse animation for status indicators */
@keyframes pulse-soft {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

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

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

.typing-dots .dot {
  display: inline-block;
  animation: bounce-dot 1.4s ease-in-out infinite;
}

/* Shimmer effect for skeleton loaders */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.skeleton-shimmer {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

/* Message bubble animations */
.llm-message-content {
}

/* Citation tooltip */
.citation-tooltip {
  animation: fade-in 0.2s ease-out;
}

/* Hover effects for interactive elements */
.citation-item:hover {
  background-color: rgba(59, 130, 246, 0.05);
  border-radius: 0.375rem;
}

/* Smooth transitions for all interactive elements */
button,
a,
.transition-all {
  transition-property: all;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 200ms;
}

/* Focus ring improvements */
input:focus,
textarea:focus,
button:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

/* Scrollbar styling */
.overflow-y-auto {
  overflow-y: scroll;
}

.overflow-y-auto::-webkit-scrollbar {
  width: 6px;
}

.overflow-y-auto::-webkit-scrollbar-track {
  background: transparent;
}

.overflow-y-auto::-webkit-scrollbar-thumb {
  background-color: rgba(156, 163, 175, 0.5);
  border-radius: 3px;
}

.overflow-y-auto::-webkit-scrollbar-thumb:hover {
  background-color: rgba(156, 163, 175, 0.8);
}

/* Document panel specific styles */
.document-content .doc-line {
  transition: background-color 0.2s ease;
}

.document-content .doc-line:hover {
  background-color: rgba(252, 211, 77, 0.1);
}

/* Message action buttons */
.message-actions button {
  transition: all 0.2s ease;
}

.message-actions button:hover {
  transform: translateY(-1px);
}

/* Gradient text for branding */
.gradient-text {
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Card hover effects */
.card-hover {
  transition: all 0.3s ease;
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* Loading state for buttons */
.btn-loading {
  position: relative;
  pointer-events: none;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Thread item animations */
#prev-threads li {
  animation: fade-in 0.3s ease-out;
  animation-fill-mode: both;
}

#prev-threads li:nth-child(1) { animation-delay: 0.05s; }
#prev-threads li:nth-child(2) { animation-delay: 0.1s; }
#prev-threads li:nth-child(3) { animation-delay: 0.15s; }
#prev-threads li:nth-child(4) { animation-delay: 0.2s; }
#prev-threads li:nth-child(5) { animation-delay: 0.25s; }

/* Suggested prompt cards */
#suggested-prompts button {
  animation: fade-in 0.4s ease-out;
  animation-fill-mode: both;
}

#suggested-prompts button:nth-child(1) { animation-delay: 0.1s; }
#suggested-prompts button:nth-child(2) { animation-delay: 0.2s; }
#suggested-prompts button:nth-child(3) { animation-delay: 0.3s; }
#suggested-prompts button:nth-child(4) { animation-delay: 0.4s; }

/* Active filter chips */
#active-filters-bar span {
  animation: fade-in 0.2s ease-out;
}

/* Error message styling */
#error_messages > div {
  animation: fade-in 0.3s ease-out;
}

/* Toast notifications */
.toast {
  animation: slide-in-right 0.3s ease-out;
}

/* Empty state illustrations */
#ai-instructions {
  animation: fade-in 0.5s ease-out;
}

/* Keyboard shortcut styling */
kbd {
  font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
}

/* ===== DARK MODE SUPPORT ===== */

/* Dark mode toggle transition */
html {
}

/* Dark mode base styles */
.dark {
  color-scheme: dark;
}

.dark body {
  background-color: #0f172a;
  color: #e2e8f0;
}

/* Dark mode for main containers */
.dark .bg-white {
  background-color: #1e293b !important;
}

.dark .bg-gray-50 {
  background-color: #0f172a !important;
}

.dark .bg-gray-100 {
  background-color: #1e293b !important;
}

/* Dark mode text */
.dark .text-gray-900 {
  color: #f1f5f9 !important;
}

.dark .text-gray-800 {
  color: #e2e8f0 !important;
}

.dark .text-gray-700 {
  color: #cbd5e1 !important;
}

.dark .text-gray-600 {
  color: #94a3b8 !important;
}

.dark .text-gray-500 {
  color: #64748b !important;
}

.dark .text-gray-400 {
  color: #475569 !important;
}

/* Dark mode borders */
.dark .border-gray-200 {
  border-color: #334155 !important;
}

.dark .border-gray-100 {
  border-color: #1e293b !important;
}

/* Dark mode for input areas */
.dark input,
.dark textarea {
  background-color: #1e293b !important;
  border-color: #334155 !important;
  color: #f1f5f9 !important;
}

.dark input::placeholder,
.dark textarea::placeholder {
  color: #64748b !important;
}

.dark input:focus,
.dark textarea:focus {
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3) !important;
}

/* Dark mode for message bubbles */
.dark .bg-blue-50 {
  background-color: #1e3a5f !important;
}

.dark .bg-blue-100 {
  background-color: #1e40af !important;
}

.dark .text-blue-800 {
  color: #93c5fd !important;
}

/* Dark mode for buttons */
.dark .bg-gradient-to-r {
  opacity: 0.95;
}

/* Dark mode for cards and panels */
.dark .shadow-lg {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.3) !important;
}

/* Dark mode for scrollbars */
.dark .overflow-y-auto::-webkit-scrollbar-thumb {
  background-color: rgba(71, 85, 105, 0.7);
}

.dark .overflow-y-auto::-webkit-scrollbar-thumb:hover {
  background-color: rgba(100, 116, 139, 0.9);
}

/* Dark mode for citations */
.dark .citation-item:hover {
  background-color: rgba(59, 130, 246, 0.1);
}

/* Dark mode for tooltips */
.dark .citation-tooltip {
  background-color: #1e293b;
  border-color: #334155;
}

/* Dark mode for badges */
.dark .bg-green-100 {
  background-color: rgba(34, 197, 94, 0.2) !important;
}

.dark .bg-purple-100 {
  background-color: rgba(168, 85, 247, 0.2) !important;
}

.dark .bg-blue-100 {
  background-color: rgba(59, 130, 246, 0.2) !important;
}

.dark .bg-red-100 {
  background-color: rgba(239, 68, 68, 0.2) !important;
}

.dark .bg-orange-100 {
  background-color: rgba(249, 115, 22, 0.2) !important;
}

/* Dark mode for document panel */
.dark .document-content .doc-line:hover {
  background-color: rgba(252, 211, 77, 0.05);
}

/* Dark mode for keyboard shortcuts */
.dark kbd {
  background-color: #334155 !important;
  border-color: #475569 !important;
  color: #94a3b8 !important;
}

/* ===== NEW UI POLISH ===== */

/* Hide conversations sidebar by default on mobile */
#threads-container.hidden {
  display: none;
}

#threads-container {
  display: block;
}

/* Smooth toggle animation */
#threads-container {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Message content styling */
#messages .llm-message-content {
  max-width: 100%;
}

/* Hide copy button while streaming */
.ai-stream .llm-message-content button {
  display: none !important;
}

/* Input area focus improvements */
textarea:focus {
  border-color: #e5e7eb !important;
  outline: none !important;
  box-shadow: none !important;
}

/* Button hover and focus states */
button {
  transition: all 0.2s ease;
}

/* Greeting text styling */
#ai-instructions h1 {
  letter-spacing: -0.02em;
  line-height: 1.1;
}

/* Conversation list item active state */
#prev-threads li.active {
  background-color: #f3f4f6;
  border-left-color: #111827;
}

/* Smooth transitions for interactive elements */
#threads-container {
  will-change: transform, opacity;
}

/* ===== FIX MASTER SCROLLBAR ===== */

[data-controller="history"] {
  height: calc(100vh - 64px);
  overflow: hidden;
}

#threads-container {
  height: 100%;
}
/*
  
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


*/
