/* Custom styles for Looni Flask SSR App */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Line clamp utilities */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

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

/* Gradient text */
.gradient-text {
    background: linear-gradient(to right, #9333ea, #2563eb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Button styles */
.btn-primary {
    background: linear-gradient(to right, #9333ea, #2563eb);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(to right, #7c3aed, #1d4ed8);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(147, 51, 234, 0.3);
}

/* Prose styles for markdown content */
.prose {
    max-width: 65ch;
}

.prose p {
    margin-bottom: 1rem;
}

.prose a {
    color: #2563eb;
    text-decoration: underline;
}

.prose a:hover {
    color: #1d4ed8;
}

.prose strong {
    font-weight: 600;
    color: #111827;
}

.prose em {
    font-style: italic;
}

.prose ul, .prose ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.prose li {
    margin-bottom: 0.5rem;
}

.prose h1, .prose h2, .prose h3 {
    font-weight: 700;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.prose h1 {
    font-size: 2rem;
}

.prose h2 {
    font-size: 1.5rem;
}

.prose h3 {
    font-size: 1.25rem;
}

/* Loading spinner */
.spinner {
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top-color: #2563eb;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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

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

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Mobile menu transition */
#mobile-menu {
    transition: all 0.3s ease;
}

/* Focus styles for accessibility */
button:focus,
a:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

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

/* Responsive utilities */
@media (max-width: 640px) {
    .text-responsive {
        font-size: 0.875rem;
    }
}


/* Discussion Thread Styles */
.discussion-item {
    position: relative;
}

.discussion-item[data-depth="0"] {
    margin-bottom: 1rem;
}

.discussion-item[data-depth="1"] {
    border-left: 2px solid #e5e7eb;
}

.discussion-item[data-depth="2"],
.discussion-item[data-depth="3"],
.discussion-item[data-depth="4"] {
    border-left: 2px solid #d1d5db;
}

/* Smooth transitions for forms */
.discussion-item form {
    transition: all 0.2s ease-in-out;
}

/* Hover effect on discussion cards */
.discussion-item > div {
    transition: all 0.2s ease;
}

.discussion-item > div:hover {
    border-color: #9ca3af;
}

/* Nested replies spacing */
.nested-replies {
    margin-top: 0.5rem;
}

/* Animation for showing/hiding forms */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: slideDown 0.2s ease-out;
}

/* Discussion action buttons */
.discussion-item button {
    transition: all 0.15s ease;
}

.discussion-item button:active {
    transform: scale(0.95);
}

/* Reply count badge */
.discussion-item .reply-count {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Flagged discussion highlight */
.discussion-item[data-flagged="true"] {
    opacity: 0.6;
}

/* Mobile optimizations */
@media (max-width: 640px) {
    .discussion-item[data-depth="1"],
    .discussion-item[data-depth="2"],
    .discussion-item[data-depth="3"],
    .discussion-item[data-depth="4"] {
        margin-left: 1rem;
    }
    
    .discussion-item button {
        font-size: 0.75rem;
    }
}

/* Loading state for discussions */
.discussions-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.discussions-loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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


/* Custom scrollbar for FAQ list */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Better prose styling for answer content */
.answer-content {
    line-height: 1.7;
    color: #374151;
}

.answer-content p {
    margin-bottom: 1rem;
}

.answer-content h1,
.answer-content h2,
.answer-content h3,
.answer-content h4 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
    line-height: 1.3;
    color: #111827;
}

.answer-content h1 {
    font-size: 1.875rem;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.5rem;
}

.answer-content h2 {
    font-size: 1.5rem;
}

.answer-content h3 {
    font-size: 1.25rem;
}

.answer-content h4 {
    font-size: 1.125rem;
}

/* Lists with visible bullets */
.answer-content ul,
.answer-content ol {
    margin-left: 0;
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.answer-content ul {
    list-style-type: disc; /* Add disc bullets */
    list-style-position: outside;
}

.answer-content ol {
    list-style-type: decimal; /* Add numbers */
    list-style-position: outside;
}

.answer-content li {
    margin-bottom: 0.5rem;
    padding-left: 0.5rem;
}

/* Nested lists */
.answer-content ul ul,
.answer-content ol ul {
    list-style-type: circle; /* Hollow circles for nested lists */
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.answer-content ul ul ul,
.answer-content ol ul ul,
.answer-content ol ol ul {
    list-style-type: square; /* Squares for deeply nested lists */
}

.answer-content ol ol {
    list-style-type: lower-alpha; /* a, b, c for nested ordered lists */
}

.answer-content ol ol ol {
    list-style-type: lower-roman; /* i, ii, iii for deeply nested ordered lists */
}

.answer-content strong,
.answer-content b {
    font-weight: 600;
    color: #4b5563;
}

.answer-content em {
    font-style: italic;
}

.answer-content a {
    color: #2563eb;
    text-decoration: underline;
    transition: color 0.2s;
}

.answer-content a:hover {
    color: #1d4ed8;
}

/* Inline code */
.answer-content code {
    background-color: #f3f4f6;
    padding: 0.125rem 0.375rem;
    border-radius: 0.375rem;
    font-size: 0.875em;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Courier New', monospace;
    color: #dc2626;
    border: 1px solid #e5e7eb;
}

/* Code blocks */
.answer-content pre {
    background-color: #1e293b;
    color: #e2e8f0;
    padding: 1.25rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    border: 1px solid #334155;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.answer-content pre code {
    background-color: transparent;
    padding: 0;
    color: inherit;
    border: none;
    font-size: 0.875rem;
    line-height: 1.6;
}

/* Syntax highlighting hint colors */
.answer-content pre code .keyword {
    color: #c792ea;
}

.answer-content pre code .string {
    color: #c3e88d;
}

.answer-content pre code .comment {
    color: #697098;
    font-style: italic;
}

/* Blockquotes */
.answer-content blockquote {
    border-left: 4px solid #3b82f6;
    padding-left: 1rem;
    margin: 1.5rem 0;
    color: #6b7280;
    font-style: italic;
    background-color: #f9fafb;
    padding: 1rem;
    border-radius: 0.375rem;
}

/* Horizontal rules */
.answer-content hr {
    border: none;
    border-top: 2px solid #e5e7eb;
    margin: 1.5rem 0;
}

/* Tables */
.answer-content table,
.answer-content .markdown-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
    overflow: hidden;
}

.answer-content th,
.answer-content td {
    border: 1px solid #e5e7eb;
    padding: 0.75rem 1rem;
    text-align: left;
}

.answer-content thead th {
    background-color: #f3f4f6;
    font-weight: 600;
    color: #1f2937;
    border-bottom: 2px solid #d1d5db;
}

.answer-content tbody tr:nth-child(even) {
    background-color: #f9fafb;
}

.answer-content tbody tr:hover {
    background-color: #f3f4f6;
}

/* Images */
.answer-content img,
.answer-content .markdown-image {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1.5rem 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Citations - GREY COLOR */
.answer-content sup.citation {
    color: #6b7280;
    font-weight: 600;
    cursor: pointer;
    margin: 0 2px;
    font-size: 0.75em;
}

.answer-content sup.citation:hover {
    color: #4b5563;
}

/* Custom scrollbar for FAQ list */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #555;
}