/* Palette AI - Chat Styles */
/* Message bubbles, typing indicators, code blocks, chat-specific styling */

/* Chat Container - PHASE 3: Minimal padding */
.chat-container {
    padding: 12px 16px;
    max-width: 100%;
    /* overflow-y: auto; */  /* ← REMOVE THIS LINE COMPLETELY */
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-height: min-content; /* ADD THIS */
}

/* ============================================================================
   MESSAGE BUBBLES - PHASE 10.5: FLOATING LIBRECHAT STYLE
   ============================================================================ */

.chat-container {
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 24px; /* More space between messages */
}

.message-bubble {
    display: flex;
    flex-wrap: wrap; /* Added - allows metadata to wrap below */
    gap: 12px;
    animation: fadeInUp 0.2s ease;
    margin-bottom: 0;
}

/* User messages - right aligned */
.message-bubble.user {
    flex-direction: row-reverse;
    align-self: flex-end;
}

.message-bubble.assistant {
    align-self: flex-start;
}

/* ========================================
   AVATAR ICONS
   ======================================== */

.message-avatar {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.message-bubble.user .message-avatar {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.message-bubble.assistant .message-avatar {
    background: var(--bg-tertiary);
    border-color: var(--border-primary);
    color: var(--text-secondary);
}

/* ========================================
   MESSAGE CONTENT CARDS
   ======================================== */

   .message-content {
    display: block;
    padding: 12px 16px;
    line-height: 1.4;
    border-radius: 12px;
    word-wrap: break-word;
    max-width: fit-content; /* Shrink to content like user bubbles */
    width: auto; /* Let it size naturally */
    box-shadow: var(--shadow-sm);
    font-size: 15px;
    transition: all 0.15s ease;
}

/* User messages - accent color, right side */
.message-bubble.user .message-content {
    background: var(--accent-primary) !important;
    color: white !important;
    border-bottom-right-radius: 4px;
    min-width: 0; /* Added - allows proper text wrapping */
    word-break: break-word; /* Added */
}

.message-bubble.user .message-content p,
.message-bubble.user .message-content li,
.message-bubble.user .message-content strong {
    color: white !important;
}

/* Assistant messages - neutral, left side, shrinks to content */
.message-bubble.assistant .message-content {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    border-bottom-left-radius: 4px;
    max-width: 85%; /* Max width for very long responses */
    width: auto; /* Shrink to content */
}

/* Error messages */
.message-content.error {
    background: rgba(239, 68, 68, 0.1) !important;
    border: 1px solid var(--error);
    color: var(--error) !important;
}

/* ========================================
   MESSAGE METADATA
   ======================================== */

.message-timestamp {
    display: inline;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    margin-left: 8px;
}

.message-bubble.assistant .message-timestamp {
    color: var(--text-muted);
}

.message-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    padding: 0 12px;
    display: block; /* Added */
    clear: both; /* Added */
    width: 100%; /* Added */
}

.message-bubble.user .message-meta {
    text-align: right;
}

.message-bubble.assistant .message-meta {
    text-align: left; /* Added */
}

/* ============================================================================
   TYPING INDICATOR - PHASE 3: COMPACT
   ============================================================================ */

   .typing-indicator {
    display: flex;
    align-items: center;
    padding: 20px 24px; /* Match message-content padding */
    background: var(--bg-tertiary);
    border-radius: 12px;
    border-bottom-left-radius: 4px; /* Match assistant message */
    max-width: fit-content; /* Changed from 60px to allow natural sizing */
    animation: fadeIn 0.2s ease;
    box-shadow: var(--shadow-sm); /* Add shadow to match message bubbles */
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--text-tertiary);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

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

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

/* ============================================================================
   INLINE TIMESTAMPS & METADATA - PHASE 3
   ============================================================================ */

.message-timestamp {
    display: inline;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    margin-left: 8px;
    font-weight: 400;
}

.message-bubble.assistant .message-timestamp {
    color: var(--text-tertiary);
}

.message-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: -6px; /* Negative margin pulls it closer to bubble */
    padding: 0 12px;
    display: block;
    flex-basis: 100%; /* Forces new line */
    text-align: right; /* Right-aligned for all messages */
    order: 10; /* Appears after content */
    line-height: 1.2; /* Tighter line-height */
}

.message-bubble.user .message-meta {
    color: rgba(255, 255, 255, 0.8);
    text-align: right;
}

.message-meta-separator {
    margin: 0 6px;
    opacity: 0.6;
}

/* ============================================================================
   CONTINUE BUTTON - PHASE 3: AUTO-APPEAR ON TRUNCATION
   ============================================================================ */

   .continue-response-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    margin-top: 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal) var(--easing);
}

.continue-response-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.continue-response-btn::before {
    content: '↩️';
    font-size: 14px;
}

/* Code Blocks - Sublime Text 4 Theme */
.code-block-wrapper {
    position: relative;
    margin: 12px 0;
    border-radius: 8px;
    overflow: hidden;
    background: #1a1a1a; /* Darker than message */
    border: 1px solid var(--border-primary);
    box-shadow: var(--shadow-sm);
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #252526;
    border-bottom: 1px solid #3e3e42;
}

.copy-code-btn {
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 5px 12px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.15s ease;
}

.copy-code-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.copy-code-btn:active {
    transform: translateY(0);
}

.copy-code-btn.copied {
    background: #4CAF50;
    color: white;
}

.copy-code-btn.copy-failed {
    background: #F44336;
    color: white;
}

.code-block-wrapper pre {
    background: #1E1E1E;
    border: none;
    border-radius: 0;
    padding: 16px;
    margin: 0;
    overflow-x: auto;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
    color: #CCCCCC;
}

.code-block-wrapper code {
    background: transparent;
    padding: 0;
    border-radius: 0;
    color: #CCCCCC;
    font-family: inherit;
    font-size: inherit;
    white-space: pre;
    display: block;
}

/* Syntax Highlighting - Sublime Text 4 Colors */

/* Keywords */
.keyword {
    color: #569CD6;
    font-weight: 500;
}

/* Strings */
.string {
    color: #CE9178;
}

.template-string {
    color: #CE9178;
}

/* Comments */
.comment {
    color: #6A9955;
    font-style: italic;
}

/* Numbers */
.number {
    color: #B5CEA8;
}

/* Functions */
.function {
    color: #DCDCAA;
    font-weight: 500;
}

/* Classes */
.class {
    color: #4EC9B0;
    font-weight: 500;
}

/* Python decorators */
.decorator {
    color: #DCDCAA;
}

/* CSS specific */
.css-selector {
    color: #4EC9B0;
    font-weight: 500;
}

.css-property {
    color: #9CDCFE;
}

.css-value {
    color: #CE9178;
}

.css-important {
    color: #F44747;
    font-weight: bold;
}

/* HTML specific */
.html-tag {
    color: #4EC9B0;
}

.html-attr {
    color: #92C5F8;
}

.html-value {
    color: #CE9178;
}

/* JSX/React specific */
.jsx-tag {
    color: #4FC1FF;
}

.jsx-attr {
    color: #92C5F8;
}

.jsx-value {
    color: #CE9178;
}

.jsx-expression {
    color: #FFD700;
}

/* Inline code (non-block) */
code:not(.code-block-wrapper code) {
    background: #f6f8fa;
    color: #24292f;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 12px;
    border: 1px solid #d0d7de;
}

/* Scrollbar styling for code blocks */
.code-block-wrapper pre::-webkit-scrollbar {
    height: 8px;
}

.code-block-wrapper pre::-webkit-scrollbar-track {
    background: #2D2D30;
}

.code-block-wrapper pre::-webkit-scrollbar-thumb {
    background: #555558;
    border-radius: 4px;
}

.code-block-wrapper pre::-webkit-scrollbar-thumb:hover {
    background: #6C6C70;
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
    .code-block-wrapper {
        background: #1E1E1E;
        border-color: #3E3E42;
    }
    
    .code-header {
        background: #2D2D30;
        border-color: #3E3E42;
    }
    
    /* Keep inline code light even in dark mode since app is light theme */
    code:not(.code-block-wrapper code) {
        background: #f6f8fa;
        border-color: #d0d7de;
        color: #24292f;
    }
}

/* History Items */
.history-item {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
}

.history-prompt {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 8px;
    max-height: 60px;
    overflow: hidden;
}

.history-response {
    font-size: 13px;
    color: #374151;
    max-height: 100px;
    overflow: hidden;
}

/* Dark theme support for chat */
@media (prefers-color-scheme: dark) {
    .message-bubble.assistant .message-content {
        background: #f1f3f4;
        color: #374151;
    }
    
    .message-bubble.assistant .message-meta {
        color: #6b7280;
    }
    
    .feedback-btn {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .feedback-btn:hover {
        background: #4a5568;
    }
    
    pre {
        background: #1a202c;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
}

/* Conversation header metadata */
.conversation-meta {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
    font-weight: normal;
}

/* Conversation list improvements */
.conversation-item {
    transition: all 0.2s ease;
}

.conversation-item:hover {
    background-color: #f8f9fa;
    transform: translateX(2px);
}

.conversation-item.active {
    background-color: #e3f2fd;
    border-left: 3px solid #007aff;
}

.conversation-title {
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: color 0.2s ease;
}

.conversation-title:hover {
    color: #007aff;
}

/* Artifact Display Styles */
.artifact-container {
    margin: 16px 0;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.artifact-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f8f9fa;
    border-bottom: 1px solid #e1e5e9;
}

.artifact-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.artifact-title {
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.artifact-type {
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.artifact-actions {
    display: flex;
    gap: 8px;
}

.artifact-btn {
    background: #007aff;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.artifact-btn:hover {
    background: #0056b3;
}

.artifact-content {
    padding: 16px;
    max-height: 500px;
    overflow-y: auto;
}

.artifact-markdown {
    line-height: 1.6;
    color: #374151;
}

.artifact-markdown h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 16px 0;
    color: #1f2937;
}

.artifact-markdown h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 24px 0 12px 0;
    color: #374151;
}

.artifact-markdown h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 20px 0 8px 0;
    color: #374151;
}

.artifact-markdown ul {
    margin: 8px 0;
    padding-left: 20px;
}

.artifact-markdown li {
    margin: 4px 0;
}

.artifact-markdown code {
    background: #f3f4f6;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 13px;
}

.artifact-markdown pre {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 12px 0;
}

.artifact-markdown pre code {
    background: none;
    padding: 0;
}

.artifact-text, .artifact-code {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
    font-size: 13px;
    line-height: 1.5;
    background: #f8f9fa;
    padding: 16px;
    margin: 0;
    border-radius: 6px;
    overflow-x: auto;
    white-space: pre-wrap;
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
    .artifact-container {
        background: #1f2937;
        border-color: #374151;
    }
    
    .artifact-header {
        background: #374151;
        border-color: #4b5563;
    }
    
    .artifact-title {
        color: #f9fafb;
    }
    
    .artifact-type {
        color: #9ca3af;
    }
    
    .artifact-content {
        color: #f9fafb;
    }
    
    .artifact-markdown {
        color: #f9fafb;
    }
    
    .artifact-markdown h1,
    .artifact-markdown h2,
    .artifact-markdown h3 {
        color: #f9fafb;
    }
}

/* Enhanced Artifact Styles */
.artifact-html-container {
    width: 100%;
}

.artifact-tabs {
    display: flex;
    border-bottom: 1px solid #e1e5e9;
    margin-bottom: 12px;
}

.artifact-tab {
    background: none;
    border: none;
    padding: 8px 16px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    transition: all 0.2s ease;
}

.artifact-tab:hover {
    color: #374151;
    background: #f9fafb;
}

.artifact-tab.active {
    color: #007aff;
    border-bottom-color: #007aff;
}

.artifact-tab-content {
    display: none;
}

.artifact-tab-content.active {
    display: block;
}

.artifact-preview iframe {
    border-radius: 4px;
    background: white;
}

.artifact-code code {
    font-size: 12px;
    line-height: 1.4;
}

/* Better error handling display */
.artifact-error {
    background: #fee2e2;
    border: 1px solid #fecaca;
    padding: 12px;
    border-radius: 6px;
    color: #dc2626;
    font-size: 13px;
}

/* Loading state for artifacts */
.artifact-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #6b7280;
    font-style: italic;
}

.artifact-loading::before {
    content: '⏳';
    margin-right: 8px;
}

/* Styling for incomplete/auto-completed code blocks */
.code-block-wrapper[data-complete="false"] {
    border-left: 4px solid #f59e0b;
}

.code-block-wrapper[data-complete="false"] .code-header {
    background: #fef3c7;
    border-bottom-color: #f59e0b;
}

.code-block-wrapper[data-complete="false"] .code-language {
    color: #92400e;
}

/* Fallback code block styling */
.fallback-code-block {
    background: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    padding: 12px;
    color: #dc2626;
    font-family: monospace;
    font-size: 13px;
    white-space: pre-wrap;
    margin: 12px 0;
}

.fallback-code-block::before {
    content: "⚠️ Code block processing error: ";
    font-weight: bold;
    display: block;
    margin-bottom: 8px;
}

/* Incomplete artifact styling */
.artifact-container.artifact-incomplete {
    border-left: 4px solid #f59e0b;
}

.artifact-incomplete .artifact-header {
    background: #fef3c7;
    border-bottom-color: #f59e0b;
}

.artifact-incomplete .artifact-title {
    color: #92400e;
}

.artifact-error {
    background: #fee2e2;
    border: 1px solid #fecaca;
    padding: 16px;
    border-radius: 8px;
    margin: 16px 0;
    color: #dc2626;
}

.artifact-error strong {
    display: block;
    margin-bottom: 8px;
}

.artifact-error pre {
    background: #fef2f2;
    padding: 8px;
    border-radius: 4px;
    overflow-x: auto;
    font-size: 12px;
    margin-top: 8px;
}

/* ============================================================================
   PHASE 3: EXPAND/COLLAPSE CODE BLOCKS
   ============================================================================ */

/* Collapsible code blocks */
.code-block-wrapper.collapsible.collapsed pre {
    max-height: 400px;
    overflow: hidden;
    position: relative;
}

.code-block-wrapper.collapsible.collapsed pre::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to bottom, transparent, #1E1E1E);
    pointer-events: none;
}

.code-block-wrapper.collapsible.expanded pre {
    max-height: none;
    overflow-y: auto;
}

/* Expand button */
.expand-code-btn {
    background: transparent;
    color: #CCCCCC;
    border: 1px solid #3E3E42;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin-right: 8px;
}

.expand-code-btn:hover {
    background: #2D2D30;
    border-color: #555558;
    color: #FFFFFF;
}

/* Smooth transitions */
.code-block-wrapper.collapsible pre {
    transition: max-height 0.3s ease;
}

/* ============================================================================
   PRISM.JS OVERRIDES - Ensure Palette styles take precedence
   ============================================================================ */

/* Override Prism line numbers to match our theme */
.line-numbers .line-numbers-rows {
    border-right: 1px solid #3E3E42 !important;
    background: #252526 !important;
}

.line-numbers-rows > span:before {
    color: #858585 !important;
}

/* Ensure code block stays dark even with Prism */
.code-block-wrapper pre[class*="language-"] {
    background: #1E1E1E !important;
    margin: 0 !important;
    border-radius: 0 !important;
}

.code-block-wrapper code[class*="language-"] {
    background: transparent !important;
    color: #CCCCCC !important;
}

/* Keep our scrollbar styling */
.code-block-wrapper pre[class*="language-"]::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}

.code-block-wrapper pre[class*="language-"]::-webkit-scrollbar-track {
    background: #2D2D30;
}

.code-block-wrapper pre[class*="language-"]::-webkit-scrollbar-thumb {
    background: #555558;
    border-radius: 4px;
}

.code-block-wrapper pre[class*="language-"]::-webkit-scrollbar-thumb:hover {
    background: #6C6C70;
}

/* ============================================================================
   PHASE 9: ARTIFACT DISPLAY FIXES
   ============================================================================ */

/* Remove white outline from artifact code blocks */
.artifact-code-display,
.artifact-code-display pre,
.artifact-code-display code,
.artifact-content pre,
.artifact-content code,
#artifactDetailContent pre,
#artifactDetailContent code {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: #1E1E1E !important;
}

/* Fix double scrolling - only scroll at artifact pane level */
.artifact-pane-content {
    overflow-y: auto; /* Scroll here */
    overflow-x: hidden;
    height: 100%;
}

#artifactDetailContent {
    overflow: visible !important; /* Don't scroll here */
    max-height: none !important;
}

#artifactDetailContent pre {
    overflow-x: auto !important; /* Horizontal scroll for code only */
    overflow-y: visible !important; /* No vertical scroll */
    max-height: none !important;
}

/* Remove max-height from artifact content */
.artifact-content {
    padding: 16px;
    max-height: none !important; /* Changed from 500px */
    overflow: visible !important; /* Changed from overflow-y: auto */
}

/* Clean artifact code display */
.artifact-code-display pre {
    background: #1E1E1E !important;
    border: none !important;
    margin: 0 !important;
    padding: 16px !important;
}

.artifact-code-display code {
    color: #CCCCCC !important;
    background: transparent !important;
}

/* Ensure artifact detail view only scrolls at pane level */
#artifactDetailView {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: visible;
}

#artifactDetailView .artifact-detail-header {
    flex-shrink: 0;
}

#artifactDetailView .artifact-detail-body {
    flex: 1;
    overflow: visible; /* Let parent handle scroll */
}

/* PHASE 9: Artifact streaming card styles */
.artifact-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 8px 0;
}

.artifact-card:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
    transform: translateX(2px);
}

.artifact-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.artifact-card-content {
    flex: 1;
}

.artifact-card-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 2px;
}

.artifact-card-meta {
    font-size: 12px;
    color: var(--text-secondary);
}

.artifact-card-action {
    color: var(--accent-primary);
    font-size: 13px;
    font-weight: 500;
}

.artifact-card.streaming {
    border-color: var(--accent-primary);
    background: linear-gradient(90deg, 
        var(--bg-tertiary) 0%, 
        var(--bg-hover) 50%, 
        var(--bg-tertiary) 100%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

.artifact-card.complete {
    border-color: var(--success);
}

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

/* PHASE 9: Artifact streaming spinner */
.artifact-streaming-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-primary);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.artifact-detail-icon .artifact-streaming-spinner {
    width: 24px;
    height: 24px;
}

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

/* Ensure artifact detail content fills space */
.artifact-detail-body {
    flex: 1;
    overflow: visible;
    display: flex;
    flex-direction: column;
}

.artifact-code-display {
    flex: 1;
    overflow: visible;
}

.artifact-code-display pre {
    margin: 0 !important;
    height: 100%;
    overflow-x: auto;
    overflow-y: visible;
}

/* Remove any artifact tags from display */
artifact {
    display: none !important;
}

/* Hide artifact XML tags in messages */
.message-content artifact,
.message-content artifact * {
    display: none !important;
}

/* ============================================================================
   SCROLL TO BOTTOM BUTTON
   ============================================================================ */

   .scroll-to-bottom-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent-primary);
    border: none;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: all 0.2s ease;
    opacity: 0;
    transform: translateY(10px) scale(0.9);
    pointer-events: none;
}

.scroll-to-bottom-btn.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.scroll-to-bottom-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.scroll-to-bottom-btn:active {
    transform: translateY(0) scale(1);
}

.scroll-to-bottom-btn svg {
    opacity: 0.9;
}