/* DeepChives AI Main Styles */

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

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

@keyframes checkmarkPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
    40% { transform: scale(1.2); opacity: 1; }
}

@keyframes slideInFromTop {
    from { 
        opacity: 0; 
        transform: translateY(-20px) scale(0.95); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

@keyframes blob {
    0% { transform: translate(0px, 0px) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
    100% { transform: translate(0px, 0px) scale(1); }
}

/* Animation Classes */
.fade-in { animation: fadeIn 0.5s ease-out; }
.slide-in-left { animation: slideInLeft 0.5s ease-out; }
.slide-in-right { animation: slideInRight 0.5s ease-out; }
.animate-slide-in-from-top { animation: slideInFromTop 0.4s cubic-bezier(0.4, 0, 0.2, 1); }
.pulse-hover:hover { animation: pulse 0.3s ease-in-out; }
.float-animation { animation: float 3s ease-in-out infinite; }
.animate-blob { animation: blob 7s infinite; }
.animation-delay-2000 { animation-delay: 2s; }
.animation-delay-4000 { animation-delay: 4s; }

/* Background Effects */
.gradient-bg {
    background: linear-gradient(135deg, #44417D 0%, #67DFF0 100%);
}

.glass-effect {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.pattern-bg {
    background-color: #f8fafc;
    background-image:
        radial-gradient(at 47% 33%, hsl(264, 30%, 97%) 0, transparent 59%),
        radial-gradient(at 82% 65%, hsl(218, 30%, 95%) 0, transparent 55%);
}

.shimmer {
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.4) 50%, transparent 100%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* Interactive Elements */
.button-glow {
    box-shadow: 0 0 20px rgba(68, 65, 125, 0.3);
    transition: all 0.3s ease;
}

.button-glow:hover {
    box-shadow: 0 0 30px rgba(103, 223, 240, 0.5);
    transform: translateY(-2px);
}

.hover-lift {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -10px rgba(68, 65, 125, 0.35);
}

/* Message Bubbles */
.message-bubble { animation: fadeIn 0.35s ease-out; }
.message-bubble.user { animation: fadeIn 0.35s ease-out; }

/* Chat bubble shape refinements */
.message-bubble .inline-block {
    position: relative;
}

/* Tails */
.message-bubble:not(.user) .inline-block::after {
    content: '';
    position: absolute;
    left: -8px;
    bottom: 8px;
    width: 0; height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid rgba(255,255,255,0.9);
}

.message-bubble.user .inline-block::after { content: none !important; display: none !important; }

/* Typing Indicator */
.typing-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, #44417D 0%, #67DFF0 100%);
    animation: bounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }
.typing-dot:nth-child(3) { animation-delay: 0; }

/* Streaming Response Animations */
@keyframes cursorBlink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

@keyframes chunkFadeIn {
    from {
        opacity: 0;
        transform: translateY(2px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.streaming-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: linear-gradient(135deg, #44417D 0%, #67DFF0 100%);
    margin-left: 2px;
    animation: cursorBlink 1s infinite;
    vertical-align: text-bottom;
}

.streaming-text {
    display: inline;
    animation: chunkFadeIn 0.3s ease-out;
}

.streaming-message {
    position: relative;
}

/* Progress Elements */
#progressCheckmark {
    animation: checkmarkPop 0.3s ease-out;
}

.progress-completed {
    background: linear-gradient(to right, #10b981, #059669) !important;
}

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

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #44417D 0%, #67DFF0 100%);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #3a3669 0%, #5bcde8 100%);
}
/* Sources Display - Compact Horizontal Layout */
.sources-container-horizontal {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.sources-container-horizontal::-webkit-scrollbar {
    height: 6px;
}

.sources-container-horizontal::-webkit-scrollbar-track {
    background: transparent;
}

.sources-container-horizontal::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.sources-container-horizontal::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.source-card-compact {
    flex-shrink: 0;
    width: 14rem;
    padding: 0.75rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    scroll-snap-align: start;
}

.source-card-compact:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #d1d5db;
}

.source-card-compact:active {
    transform: translateY(0);
}

/* Sort dropdown styling */
.sources-sort-dropdown {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.25rem center;
    background-repeat: no-repeat;
    background-size: 1rem 1rem;
    padding-right: 1.5rem;
}

/* Sources Navigation Wrapper and Arrows */
.sources-nav-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.sources-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
    color: #6b7280;
}

.sources-nav-btn:hover {
    background: white;
    border-color: #d1d5db;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: #374151;
}

.sources-nav-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.sources-nav-btn.hidden {
    opacity: 0;
    pointer-events: none;
}

.sources-nav-left {
    left: -16px;
}

.sources-nav-right {
    right: -16px;
}

/* Adjust container to make room for arrows */
.sources-nav-wrapper .sources-container-horizontal {
    flex: 1;
    margin: 0 8px;
}

/* Legacy source preview card (keep for backwards compatibility) */
.source-preview-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.source-thumbnail {
    transition: all 0.3s ease;
}

.source-thumbnail:hover {
    transform: scale(1.02);
}

/* Responsive adjustments for compact sources */
@media (max-width: 640px) {
    .source-card-compact {
        width: 12rem;
    }

    .sources-container-horizontal {
        gap: 0.5rem;
    }
}

@media (min-width: 1024px) {
    .source-card-compact {
        width: 15rem;
    }
}

/* Line clamp utility */
.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;
}

/* Document viewer enhancements */
.document-viewer-overlay {
    backdrop-filter: blur(8px);
    background: rgba(0, 0, 0, 0.6);
}

.document-viewer-modal {
    max-height: 95vh;
    max-width: 95vw;
}

/* Responsive grid for sources */
@media (max-width: 768px) {
    .sources-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) {
    .sources-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .sources-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Sources Carousel */
.sources-carousel {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.sources-carousel-track {
    display: flex;
    transition: transform 0.3s ease-in-out;
    width: 100%;
}

.sources-carousel .source-preview-card {
    min-width: 100%;
    flex-shrink: 0;
}

.sources-carousel button {
    transition: all 0.2s ease;
}

.sources-carousel button:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sources-carousel button:active {
    transform: scale(0.95);
}

/* Carousel dots */
.sources-carousel [data-dot] {
    transition: all 0.2s ease;
}

.sources-carousel [data-dot]:hover {
    transform: scale(1.2);
}

/* Responsive carousel adjustments */
@media (max-width: 640px) {
    .sources-carousel {
        max-width: 100%;
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    .sources-carousel {
        max-width: 350px;
    }
}

@media (min-width: 1025px) {
    .sources-carousel {
        max-width: 400px;
    }
}

/* Blob Animation */
@keyframes blob {
    0% { transform: translate(0px, 0px) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
    100% { transform: translate(0px, 0px) scale(1); }
}

/* Index page custom styles moved from inline */
.tab-button {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.tab-button.active {
    background: linear-gradient(135deg, #44417D, #67DFF0);
    box-shadow: 0 8px 25px rgba(68, 65, 125, 0.3);
}

.tab-button.active:hover {
    box-shadow: 0 10px 30px rgba(68, 65, 125, 0.4);
}

.glass-morphism {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.gradient-border {
    background: linear-gradient(white, white) padding-box,
    linear-gradient(135deg, #44417D, #67DFF0) border-box;
    border: 2px solid transparent;
}/
* Widget and UI Enhancement Styles */

/* Quick Widget Hover Effects */
#quickWidget:hover #quickWidgetPanel {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(-50%) translateX(0) scale(1);
}

.writing-mode-vertical {
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

/* Enhanced shadow for better depth */
.shadow-3xl {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

/* Smooth hover animations */
@keyframes float-subtle {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-2px);
    }
}

.hover\:float:hover {
    animation: float-subtle 2s ease-in-out infinite;
}/* Setting
s and Profile Section Enhanced Styling */
.settings-profile-section {
    position: relative;
    z-index: 10;
}

/* Enhanced blur effect for the overlay */
.settings-profile-section::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 0;
    right: 0;
    height: 24px;
    background: linear-gradient(to top, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.85) 50%, transparent 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    pointer-events: none;
    z-index: 1;
}

/* Smooth transitions for buttons */
.settings-profile-section button {
    transform: translateY(0);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.settings-profile-section button:hover {
    transform: translateY(-2px);
}

/* Enhanced shadow effects */
.settings-profile-section button:hover {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Icon container animations */
.settings-profile-section button .w-12 {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Arrow icon subtle animation */
.settings-profile-section button:hover svg {
    transform: translateX(2px);
}

/* Backdrop blur support for older browsers */
@supports not (backdrop-filter: blur(12px)) {
    .settings-profile-section::before {
        background: linear-gradient(to top, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.8) 50%, rgba(255, 255, 255, 0.3) 100%);
    }
}/* Do
cument Card Enhancements */
.document-card {
    position: relative;
    overflow: hidden;
}

/* Line clamp utility for text truncation */
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Enhanced hover effects for document cards */
.document-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.15);
}

/* File type specific animations */
.document-card .w-14:hover {
    transform: scale(1.1) rotate(5deg);
}

/* Smooth transitions for all card elements */
.document-card * {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Button hover effects */
.document-card button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.2);
}

/* File type indicator line animation */
.document-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    right: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
    transition: all 0.6s ease;
}

.document-card:hover::before {
    left: 100%;
    right: -100%;
}

/* Staggered animation for grid items */
.document-card:nth-child(1) { animation-delay: 0.1s; }
.document-card:nth-child(2) { animation-delay: 0.2s; }
.document-card:nth-child(3) { animation-delay: 0.3s; }
.document-card:nth-child(4) { animation-delay: 0.4s; }
.document-card:nth-child(5) { animation-delay: 0.5s; }
.document-card:nth-child(6) { animation-delay: 0.6s; }

/* Fade in animation for new cards */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.document-card {
    animation: fadeInUp 0.6s ease-out both;
}

/* Enhanced tag styling */
.document-card .tag {
    backdrop-filter: blur(8px);
    transition: all 0.2s ease;
}

.document-card .tag:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}/* In
ternet Search Toggle Styles */
#internetSearchToggle {
    position: relative;
    overflow: hidden;
}

#internetSearchToggle.enabled {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

#internetSearchToggle.enabled::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: rotate(45deg);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

/* Internet Search Status Indicator */
#internetSearchStatus {
    animation: fadeInSlide 0.3s ease-out;
}

@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Search Mode Indicators in Chat */
.search-mode-indicator {
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.search-mode-indicator.web-search {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(29, 78, 216, 0.1));
    border-color: rgba(59, 130, 246, 0.3);
}

.search-mode-indicator.documents-only {
    background: linear-gradient(135deg, rgba(107, 114, 128, 0.1), rgba(75, 85, 99, 0.1));
    border-color: rgba(107, 114, 128, 0.3);
}

/* Enhanced feedback notifications */
.internet-search-feedback {
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.internet-search-feedback.show {
    transform: translateX(0);
    opacity: 1;
}

/* Media mode feedback toast notification */
.media-mode-feedback {
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.media-mode-feedback.show {
    transform: translateX(0);
    opacity: 1;
}

/* Pulse animation for internet search icon */
#internetSearchToggle.enabled #internetSearchIcon {
    animation: pulse-glow 2s infinite;
}

/* Pulse animation for media mode icon */
#mediaModeToggle.enabled #mediaModeIcon {
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 4px rgba(59, 130, 246, 0.6));
    }
    50% {
        transform: scale(1.1);
        filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.8));
    }
}

/* AI Response Content Spacing - Improve readability with proper paragraph spacing */
.message-content {
    line-height: 1.6;
}

.message-content p {
    margin: 0 0 1rem 0;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content h1,
.message-content h2,
.message-content h3,
.message-content h4,
.message-content h5,
.message-content h6 {
    margin: 1.5rem 0 0.75rem 0;
    font-weight: 600;
    line-height: 1.4;
}

.message-content h1:first-child,
.message-content h2:first-child,
.message-content h3:first-child,
.message-content h4:first-child,
.message-content h5:first-child,
.message-content h6:first-child {
    margin-top: 0;
}

.message-content h1 { font-size: 1.5rem; }
.message-content h2 { font-size: 1.25rem; }
.message-content h3 { font-size: 1.125rem; }
.message-content h4 { font-size: 1rem; }
.message-content h5 { font-size: 0.875rem; }
.message-content h6 { font-size: 0.75rem; }

.message-content ul,
.message-content ol {
    margin: 0.75rem 0;
    padding-left: 1.5rem;
}

.message-content li {
    margin: 0.25rem 0;
}

.message-content li p {
    margin: 0.25rem 0;
}

.message-content blockquote {
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    border-left: 4px solid #e5e7eb;
    background-color: #f9fafb;
    font-style: italic;
    border-radius: 0 0.375rem 0.375rem 0;
}

.message-content code {
    background-color: #f3f4f6;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-size: 0.875em;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.message-content pre {
    background-color: #f3f4f6;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1rem 0;
}

.message-content pre code {
    background-color: transparent;
    padding: 0;
    border-radius: 0;
}

.message-content strong,
.message-content b {
    font-weight: 600;
}

.message-content em,
.message-content i {
    font-style: italic;
}

.message-content hr {
    margin: 1.5rem 0;
    border: none;
    border-top: 1px solid #e5e7eb;
}

.message-content table {
    width: 100%;
    margin: 1rem 0;
    border-collapse: collapse;
}

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

.message-content th {
    background-color: #f9fafb;
    font-weight: 600;
}

/* Ensure proper spacing between different types of content */
.message-content > *:first-child {
    margin-top: 0;
}

.message-content > *:last-child {
    margin-bottom: 0;
}

/* Special spacing for consecutive elements */
.message-content p + p {
    margin-top: 1rem;
}

.message-content p + ul,
.message-content p + ol {
    margin-top: 0.5rem;
}

.message-content ul + p,
.message-content ol + p {
    margin-top: 0.75rem;
}

/* Improve readability for inline code within paragraphs */
.message-content p code {
    background-color: rgba(68, 65, 125, 0.1);
    color: #44417D;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
}

/* Gradient Text Utility */
.gradient-text {
    background: linear-gradient(135deg, #44417D 0%, #67DFF0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}