/* Custom styles for QueryLex - Legal AI Platform (Ultrathink) */

/* Ensure the app takes full height */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

/* Style code blocks with syntax highlighting */
pre {
    border-radius: 0.5rem;
    padding: 1rem;
    overflow-x: auto;
    background-color: #f4f4f5;
    border: 1px solid #e4e4e7;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #18181b;
}

html.dark pre {
    background-color: rgba(24, 24, 27, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e4e4e7;
}

/* Style links */
a {
    color: #2563eb;
    text-decoration: none;
}

a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

html.dark a {
    color: #60a5fa;
}

html.dark a:hover {
    color: #93c5fd;
}

/* Style markdown content */
.prose {
    max-width: 65ch;
    color: #18181b;
}

.prose h1, .prose h2, .prose h3, .prose h4 {
    color: #09090b;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.prose p {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}

.prose ul, .prose ol {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
    padding-left: 1.5em;
}

.prose li {
    margin-top: 0.25em;
    margin-bottom: 0.25em;
}

.prose blockquote {
    border-left: 4px solid rgba(59, 130, 246, 0.5);
    padding-left: 1em;
    color: #52525b;
    font-style: italic;
}

/* Dark mode overrides for prose */
html.dark .prose {
    color: #e4e4e7;
}

html.dark .prose h1, html.dark .prose h2, html.dark .prose h3, html.dark .prose h4 {
    color: #f4f4f5;
}

html.dark .prose blockquote {
    color: #a1a1aa;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background-color: rgba(24, 24, 27, 0.5);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background-color: rgba(161, 161, 170, 0.5);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: rgba(161, 161, 170, 0.7);
}

/* Make sure code doesn't overflow */
.prose pre code {
    white-space: pre-wrap;
    word-break: break-word;
}

/* Styling for tables */
.prose table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1em;
    margin-bottom: 1em;
}

.prose th {
    background-color: #f4f4f5;
    font-weight: 600;
    text-align: left;
    padding: 0.5em;
    border: 1px solid #e4e4e7;
    color: #09090b;
}

.prose td {
    padding: 0.5em;
    border: 1px solid #e4e4e7;
    color: #18181b;
}

.prose tr:nth-child(even) {
    background-color: #fafafa;
}

html.dark .prose th {
    background-color: rgba(24, 24, 27, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f4f4f5;
}

html.dark .prose td {
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e4e4e7;
}

html.dark .prose tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Style for file input */
.file-input-container {
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.file-input {
    position: absolute;
    font-size: 100px;
    right: 0;
    top: 0;
    opacity: 0;
    cursor: pointer;
}

.file-input-label {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: #3b82f6;
    color: white;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.file-input-label:hover {
    background-color: #60a5fa;
}

/* Animation for dots loading */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.animate-bounce {
    animation: bounce 1s infinite;
}

/* Animation for thinking pulse */
@keyframes pulse {
    0% {
        opacity: 0.6;
        transform: scale(0.98);
    }
    50% {
        opacity: 1;
        transform: scale(1.02);
    }
    100% {
        opacity: 0.6;
        transform: scale(0.98);
    }
}

.animate-pulse {
    animation: pulse 1.5s infinite ease-in-out;
}

/* Drag and drop styling */
.chat-item {
    transition: all 0.2s ease;
}

.chat-item[draggable="true"]:hover {
    cursor: grab;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
}

.folder-item.drag-over {
    background-color: rgba(59, 130, 246, 0.25);
    box-shadow: 0 0 5px rgba(59, 130, 246, 0.5);
}

.chat-item.dragging {
    opacity: 0.5;
    border: 2px dashed #3b82f6;
}

/* Toast notification */
.toast-notification {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    padding: 0.75rem 1rem;
    background-color: #10b981;
    color: white;
    border-radius: 0.375rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 50;
    animation: fadeIn 0.3s ease-in-out, fadeOut 0.3s ease-in-out 2.7s forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(1rem); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(1rem); }
}

/* Folder structure styling */
.folder-container {
    border-radius: 0.375rem;
    overflow: hidden;
}

.folder-item {
    transition: all 0.2s ease;
}

.folder-chats {
    transition: all 0.2s ease;
    padding-left: 1.5rem;
    border-left: 1px solid rgba(156, 163, 175, 0.2);
    margin-left: 0.75rem;
}

/* Context menu styling */
#chat-context-menu {
    min-width: 170px;
    animation: fadeIn 0.1s ease-out;
    border: 1px solid rgba(156, 163, 175, 0.2);
}

/* Make sure folders have a visual cue that they are drop targets */
.folder-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.folder-item.drag-over {
    background-color: rgba(59, 130, 246, 0.25);
    box-shadow: 0 0 5px rgba(59, 130, 246, 0.5);
}