/**
 * ARTIFACT FILES - iOS-Inspired Modular File System UI
 *
 * Styles for:
 * - File tabs interface
 * - iOS error console
 * - Project browser
 * - Code mode interface
 *
 * Theme: iOS Dark Mode (matches main Oracle UI)
 */

/* iOS Color Variables */
:root {
    --af-primary: #0A84FF;
    --af-primary-light: #409CFF;
    --af-green: #30D158;
    --af-orange: #FF9F0A;
    --af-red: #FF453A;
    --af-purple: #BF5AF2;
    --af-bg-primary: #000000;
    --af-bg-secondary: #1C1C1E;
    --af-bg-tertiary: #2C2C2E;
    --af-bg-elevated: #3A3A3C;
    --af-separator: #38383A;
    --af-text-primary: #FFFFFF;
    --af-text-secondary: rgba(235, 235, 245, 0.6);
    --af-text-tertiary: rgba(235, 235, 245, 0.3);
}

/* ============================================================
   PROJECT BROWSER
   ============================================================ */

.artifact-project-browser {
    background: var(--af-bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--af-separator);
}

.apb-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--af-bg-tertiary);
    border-bottom: 1px solid var(--af-separator);
}

.apb-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--af-text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.apb-title-icon {
    font-size: 20px;
}

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

.apb-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.apb-btn-primary {
    background: var(--af-primary);
    color: var(--af-text-primary);
}

.apb-btn-primary:hover {
    background: var(--af-primary-light);
}

.apb-btn-secondary {
    background: var(--af-bg-tertiary);
    color: var(--af-text-primary);
    border: 1px solid var(--af-separator);
}

.apb-btn-secondary:hover {
    background: var(--af-bg-elevated);
}

/* Project list */
.apb-projects {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    padding: 16px;
}

.apb-project-card {
    background: var(--af-bg-tertiary);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.apb-project-card:hover {
    background: var(--af-bg-elevated);
    border-color: rgba(10, 132, 255, 0.3);
}

.apb-project-card.active {
    border-color: var(--af-primary);
    background: rgba(10, 132, 255, 0.1);
}

.apb-project-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--af-text-primary);
    margin-bottom: 8px;
}

.apb-project-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--af-text-secondary);
}

.apb-project-type {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: var(--af-bg-elevated);
    border-radius: 6px;
}

.apb-project-files {
    display: flex;
    align-items: center;
    gap: 4px;
}


/* ============================================================
   FILE EXPLORER PANEL
   ============================================================ */

.artifact-file-explorer {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--af-bg-secondary);
}

.afe-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--af-separator);
    flex-shrink: 0;
    background: var(--af-bg-tertiary);
}

.afe-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--af-text-secondary);
    font-weight: 600;
}

.afe-actions {
    display: flex;
    gap: 6px;
}

.afe-action-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--af-text-secondary);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.afe-action-btn:hover {
    background: var(--af-bg-elevated);
    color: var(--af-text-primary);
}

/* File tree */
.afe-tree {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
    -webkit-overflow-scrolling: touch;
    background: var(--af-bg-secondary);
}

.afe-file {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    gap: 10px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid var(--af-bg-tertiary);
}

.afe-file:hover {
    background: var(--af-bg-tertiary);
}

.afe-file.active {
    background: rgba(10, 132, 255, 0.15);
    border-left: 3px solid var(--af-primary);
}

.afe-file.active .afe-file-name {
    color: var(--af-primary);
}

.afe-file-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

/* File type colors - iOS style */
.afe-file-icon.html { color: #FF9F0A; }
.afe-file-icon.css { color: #64D2FF; }
.afe-file-icon.js { color: #FFD60A; }
.afe-file-icon.json { color: #BF5AF2; }
.afe-file-icon.md { color: #0A84FF; }
.afe-file-icon.shader { color: #BF5AF2; }

.afe-file-name {
    flex: 1;
    font-size: 14px;
    color: var(--af-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.afe-file-size {
    font-size: 12px;
    color: var(--af-text-tertiary);
}

.afe-file-actions {
    display: none;
    gap: 4px;
}

.afe-file:hover .afe-file-actions {
    display: flex;
}

.afe-file-action {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--af-text-secondary);
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.afe-file-action:hover {
    background: var(--af-bg-elevated);
    color: var(--af-text-primary);
}

.afe-file-action.delete:hover {
    color: var(--af-red);
}


/* ============================================================
   CODE EDITOR PANEL
   ============================================================ */

.artifact-code-editor {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--af-bg-secondary);
}

.ace-tabs {
    display: flex;
    background: var(--af-bg-tertiary);
    border-bottom: 1px solid var(--af-separator);
    overflow-x: auto;
    flex-shrink: 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.ace-tabs::-webkit-scrollbar {
    display: none;
}

.ace-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    cursor: pointer;
    border-right: 1px solid var(--af-separator);
    transition: all 0.15s;
    white-space: nowrap;
}

.ace-tab:hover {
    background: var(--af-bg-elevated);
}

.ace-tab.active {
    background: var(--af-bg-secondary);
    border-bottom: 2px solid var(--af-primary);
}

.ace-tab-icon {
    font-size: 14px;
}

.ace-tab-name {
    font-size: 13px;
    color: var(--af-text-secondary);
}

.ace-tab.active .ace-tab-name {
    color: var(--af-primary);
}

.ace-tab-modified {
    width: 8px;
    height: 8px;
    background: var(--af-orange);
    border-radius: 50%;
    display: none;
}

.ace-tab.modified .ace-tab-modified {
    display: block;
}

.ace-tab-close {
    opacity: 0;
    font-size: 12px;
    color: var(--af-text-tertiary);
    margin-left: 4px;
}

.ace-tab:hover .ace-tab-close {
    opacity: 1;
}

.ace-tab-close:hover {
    color: var(--af-red);
}

/* Editor area */
.ace-editor-area {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.ace-textarea {
    width: 100%;
    height: 100%;
    background: var(--af-bg-secondary);
    color: var(--af-text-primary);
    border: none;
    padding: 20px;
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: none;
    outline: none;
    tab-size: 4;
    white-space: pre;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.ace-textarea::placeholder {
    color: var(--af-text-tertiary);
}

/* Line numbers */
.ace-line-numbers {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 50px;
    padding: 20px 8px;
    background: var(--af-bg-tertiary);
    border-right: 1px solid var(--af-separator);
    font-family: 'SF Mono', Consolas, monospace;
    font-size: 13px;
    line-height: 1.6;
    color: var(--af-text-tertiary);
    text-align: right;
    user-select: none;
    overflow: hidden;
}

.ace-editor-area.with-line-numbers .ace-textarea {
    padding-left: 60px;
}

/* Status bar */
.ace-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: var(--af-bg-secondary);
    border-top: 1px solid var(--af-separator);
    font-size: 12px;
    color: var(--af-text-secondary);
    flex-shrink: 0;
}

.ace-status-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ace-status-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ace-status-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ace-status-filename {
    color: var(--af-primary);
    font-weight: 500;
}

.ace-status-saved {
    color: var(--af-green);
}

.ace-status-unsaved {
    color: var(--af-orange);
}


/* ============================================================
   CODE MODE INTERFACE
   ============================================================ */

.code-mode-container {
    display: flex;
    height: 100%;
    background: var(--af-bg-primary);
}

.code-mode-sidebar {
    width: 250px;
    border-right: 1px solid var(--af-separator);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: var(--af-bg-secondary);
}

.code-mode-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.code-mode-preview {
    width: 40%;
    min-width: 300px;
    border-left: 1px solid var(--af-separator);
    display: flex;
    flex-direction: column;
    background: var(--af-bg-primary);
}

/* Preview panel */
.preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--af-bg-secondary);
    border-bottom: 1px solid var(--af-separator);
}

.preview-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--af-text-secondary);
    font-weight: 600;
}

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

.preview-btn {
    padding: 6px 12px;
    border: 1px solid var(--af-separator);
    background: var(--af-bg-tertiary);
    color: var(--af-text-primary);
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.preview-btn:hover {
    background: var(--af-bg-elevated);
}

.preview-btn.primary {
    background: var(--af-primary);
    border-color: var(--af-primary);
}

.preview-btn.primary:hover {
    background: var(--af-primary-light);
}

.preview-frame-container {
    flex: 1;
    background: var(--af-bg-primary);
    position: relative;
}

.preview-frame {
    width: 100%;
    height: 100%;
    border: none;
}

.preview-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--af-text-secondary);
}

.preview-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--af-separator);
    border-top-color: var(--af-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 12px;
}

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


/* ============================================================
   AUTO-CATEGORIZATION BADGES - iOS Colors
   ============================================================ */

.category-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.category-badge.game {
    background: rgba(255, 69, 58, 0.15);
    color: #FF453A;
    border: 1px solid rgba(255, 69, 58, 0.3);
}

.category-badge.threed {
    background: rgba(191, 90, 242, 0.15);
    color: #BF5AF2;
    border: 1px solid rgba(191, 90, 242, 0.3);
}

.category-badge.app {
    background: rgba(10, 132, 255, 0.15);
    color: #0A84FF;
    border: 1px solid rgba(10, 132, 255, 0.3);
}

.category-badge.website {
    background: rgba(48, 209, 88, 0.15);
    color: #30D158;
    border: 1px solid rgba(48, 209, 88, 0.3);
}

.category-badge.tool {
    background: rgba(255, 214, 10, 0.15);
    color: #FFD60A;
    border: 1px solid rgba(255, 214, 10, 0.3);
}


/* ============================================================
   MOBILE RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
    .code-mode-container {
        flex-direction: column;
    }

    .code-mode-sidebar {
        width: 100%;
        height: auto;
        max-height: 35vh;
        border-right: none;
        border-bottom: 1px solid var(--af-separator);
    }

    .code-mode-preview {
        width: 100%;
        min-width: 0;
        height: 40vh;
        border-left: none;
        border-top: 1px solid var(--af-separator);
    }

    .ace-tabs {
        padding: 0 8px;
    }

    .ace-tab {
        padding: 10px 12px;
    }

    .ace-textarea {
        font-size: 13px;
        padding: 16px;
    }

    .apb-projects {
        grid-template-columns: 1fr;
    }

    .afe-tree {
        max-height: 200px;
    }
}


/* ============================================================
   CODE MODE CHAT PANEL - iOS Style
   ============================================================ */

.code-mode-chat {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--af-separator);
    height: 200px;
    flex-shrink: 0;
    background: var(--af-bg-primary);
}

.cmc-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    -webkit-overflow-scrolling: touch;
    background: var(--af-bg-primary);
}

.cmc-message {
    margin-bottom: 10px;
    padding: 10px 14px;
    border-radius: 16px;
    max-width: 85%;
    font-size: 15px;
    line-height: 1.5;
}

.cmc-message.ai {
    background: var(--af-bg-tertiary);
    color: var(--af-text-primary);
    border-bottom-left-radius: 4px;
}

.cmc-message.user {
    background: var(--af-primary);
    color: var(--af-text-primary);
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.cmc-message.question {
    background: rgba(191, 90, 242, 0.15);
    border: 1px solid rgba(191, 90, 242, 0.3);
    color: #BF5AF2;
}

.cmc-input-area {
    display: flex;
    padding: 12px;
    gap: 10px;
    background: var(--af-bg-secondary);
    border-top: 1px solid var(--af-separator);
}

.cmc-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--af-separator);
    background: var(--af-bg-tertiary);
    color: var(--af-text-primary);
    border-radius: 20px;
    font-size: 15px;
    outline: none;
}

.cmc-input:focus {
    border-color: var(--af-primary);
}

.cmc-input::placeholder {
    color: var(--af-text-tertiary);
}

.cmc-send {
    padding: 10px 18px;
    background: var(--af-primary);
    border: none;
    color: var(--af-text-primary);
    border-radius: 20px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.cmc-send:hover {
    background: var(--af-primary-light);
}

.cmc-send:active {
    transform: scale(0.96);
}


/* ============================================================
   FILE CHANGE INDICATOR - iOS Style
   ============================================================ */

.file-change-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--af-green);
    color: var(--af-text-primary);
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-change-indicator.error {
    background: var(--af-red);
}

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

.fci-icon {
    font-size: 16px;
}

.fci-details {
    font-size: 12px;
    opacity: 0.8;
    margin-left: 8px;
}


/* ============================================================
   DIFF VIEW - iOS Style
   ============================================================ */

.diff-view {
    font-family: 'SF Mono', Consolas, monospace;
    font-size: 13px;
    line-height: 1.5;
    background: var(--af-bg-secondary);
    border-radius: 12px;
    overflow: hidden;
}

.diff-line {
    padding: 2px 12px;
    white-space: pre;
}

.diff-line.added {
    background: rgba(48, 209, 88, 0.15);
    color: var(--af-green);
}

.diff-line.added::before {
    content: '+ ';
    color: var(--af-green);
}

.diff-line.removed {
    background: rgba(255, 69, 58, 0.15);
    color: var(--af-red);
}

.diff-line.removed::before {
    content: '- ';
    color: var(--af-red);
}

.diff-line.context {
    color: var(--af-text-tertiary);
}

.diff-line.context::before {
    content: '  ';
}

.diff-header {
    padding: 12px 16px;
    background: var(--af-bg-tertiary);
    border-bottom: 1px solid var(--af-separator);
    display: flex;
    align-items: center;
    gap: 12px;
}

.diff-filename {
    color: var(--af-primary);
    font-weight: 500;
}

.diff-stats {
    font-size: 12px;
    color: var(--af-text-secondary);
}

.diff-stats .added-count {
    color: var(--af-green);
}

.diff-stats .removed-count {
    color: var(--af-red);
}


/* ============================================================
   PROJECT DOWNLOAD CONTAINER - Instant Mode
   Claude-style file list + download for multi-file projects
   ============================================================ */

.project-artifact-container {
    background: var(--af-bg-secondary);
    border: 1px solid var(--af-separator);
    border-radius: 12px;
    margin-top: 16px;
    overflow: hidden;
}

.project-artifact-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--af-bg-tertiary);
    border-bottom: 1px solid var(--af-separator);
}

.project-artifact-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--af-primary), var(--af-purple));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.project-artifact-info {
    flex: 1;
}

.project-artifact-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--af-text-primary);
}

.project-artifact-subtitle {
    font-size: 13px;
    color: var(--af-text-secondary);
    margin-top: 2px;
}

.project-artifact-files {
    padding: 12px 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.project-artifact-file {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--af-bg-tertiary);
    border: 1px solid var(--af-separator);
    border-radius: 8px;
    font-size: 13px;
    color: var(--af-text-primary);
}

.project-file-icon {
    font-size: 14px;
}

.project-file-name {
    color: var(--af-text-primary);
}

.project-artifact-download {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    margin: 12px 16px 16px;
    background: var(--af-primary);
    border: none;
    border-radius: 10px;
    color: var(--af-text-primary);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.project-artifact-download:hover {
    background: var(--af-primary-light);
    transform: translateY(-1px);
}

.project-artifact-download:active {
    transform: translateY(0);
}

.project-artifact-download .download-icon {
    font-size: 18px;
}

/* Code Validation Display */
.project-validation {
    padding: 12px 16px;
    border-top: 1px solid var(--af-separator);
    font-size: 13px;
}

.project-validation.validation-passed {
    background: rgba(48, 209, 88, 0.1);
}

.project-validation.validation-warning {
    background: rgba(255, 159, 10, 0.1);
}

.validation-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    margin-bottom: 8px;
}

.validation-icon {
    font-size: 16px;
}

.validation-summary {
    color: var(--af-text-primary);
}

.validation-errors,
.validation-warnings {
    margin-top: 8px;
    padding-left: 24px;
}

.validation-error-item,
.validation-warning-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px 0;
    border-bottom: 1px solid var(--af-separator);
}

.validation-error-item:last-child,
.validation-warning-item:last-child {
    border-bottom: none;
}

.error-file,
.warning-file {
    font-family: 'SF Mono', Consolas, monospace;
    font-size: 11px;
    color: var(--af-text-secondary);
}

.error-message {
    color: var(--af-red);
    font-size: 12px;
}

.warning-message {
    color: var(--af-orange);
    font-size: 12px;
}

.validation-more {
    font-size: 11px;
    color: var(--af-text-secondary);
    padding-top: 6px;
}

/* Mobile responsive */
@media (max-width: 480px) {
    .project-artifact-header {
        padding: 14px 16px;
    }

    .project-artifact-icon {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .project-artifact-title h4 {
        font-size: 15px;
    }

    .project-file-tag {
        padding: 5px 10px;
        font-size: 12px;
    }

    .project-download-btn {
        padding: 12px 16px;
        font-size: 14px;
    }
}


/* ============================================================
   CLAUDE-STYLE ARTIFACT PANEL
   Clean, professional code artifact display
   ============================================================ */

/* Artifact Panel Container - appears as sidebar or inline */
.claude-artifact-panel {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    overflow: hidden;
    margin: 16px 0;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

/* Artifact Header */
.claude-artifact-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #252525;
    border-bottom: 1px solid #333;
}

.claude-artifact-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.claude-artifact-filename {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.claude-artifact-lang {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: #888;
    background: #333;
    padding: 3px 8px;
    border-radius: 4px;
}

.claude-artifact-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.claude-artifact-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: transparent;
    border: 1px solid #444;
    border-radius: 6px;
    color: #ccc;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.claude-artifact-btn:hover {
    background: #333;
    border-color: #555;
    color: #fff;
}

.claude-artifact-btn.primary {
    background: #5a5aff;
    border-color: #5a5aff;
    color: #fff;
}

.claude-artifact-btn.primary:hover {
    background: #4a4aef;
}

.claude-artifact-btn svg {
    width: 16px;
    height: 16px;
}

/* Code Container */
.claude-artifact-code {
    position: relative;
    max-height: 500px;
    overflow: auto;
    background: #1a1a1a;
}

.claude-artifact-code::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.claude-artifact-code::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.claude-artifact-code::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

.claude-artifact-code::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Code with Line Numbers */
.claude-code-wrapper {
    display: flex;
    font-family: 'SF Mono', 'Fira Code', 'JetBrains Mono', Consolas, monospace;
    font-size: 13px;
    line-height: 1.6;
}

.claude-line-numbers {
    flex-shrink: 0;
    padding: 16px 12px;
    background: #141414;
    color: #555;
    text-align: right;
    user-select: none;
    border-right: 1px solid #2a2a2a;
    min-width: 50px;
}

.claude-line-numbers div {
    padding: 0 4px;
}

.claude-code-content {
    flex: 1;
    padding: 16px;
    margin: 0;
    color: #e0e0e0;
    white-space: pre;
    overflow-x: auto;
}

/* Syntax Highlighting */
.claude-code-content .keyword { color: #c792ea; }
.claude-code-content .string { color: #c3e88d; }
.claude-code-content .number { color: #f78c6c; }
.claude-code-content .comment { color: #676e95; font-style: italic; }
.claude-code-content .function { color: #82aaff; }
.claude-code-content .class-name { color: #ffcb6b; }
.claude-code-content .operator { color: #89ddff; }
.claude-code-content .punctuation { color: #89ddff; }
.claude-code-content .builtin { color: #82aaff; }
.claude-code-content .decorator { color: #c792ea; }
.claude-code-content .property { color: #f07178; }

/* Collapsible Process Sections */
.claude-process-section {
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 8px;
    margin: 12px 0;
    overflow: hidden;
}

.claude-process-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #252525;
    cursor: pointer;
    transition: background 0.15s;
}

.claude-process-header:hover {
    background: #2a2a2a;
}

.claude-process-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #333;
    border-radius: 4px;
    font-size: 12px;
}

.claude-process-title {
    flex: 1;
    font-size: 14px;
    color: #e0e0e0;
}

.claude-process-file {
    font-size: 12px;
    color: #888;
    background: #333;
    padding: 4px 10px;
    border-radius: 4px;
    font-family: 'SF Mono', monospace;
}

.claude-process-chevron {
    color: #666;
    transition: transform 0.2s;
}

.claude-process-section.expanded .claude-process-chevron {
    transform: rotate(180deg);
}

.claude-process-content {
    display: none;
    padding: 16px;
    border-top: 1px solid #333;
}

.claude-process-section.expanded .claude-process-content {
    display: block;
}

/* Multi-file artifact */
.claude-artifact-tabs {
    display: flex;
    background: #1a1a1a;
    border-bottom: 1px solid #333;
    overflow-x: auto;
    padding: 0 8px;
}

.claude-artifact-tabs::-webkit-scrollbar {
    height: 0;
}

.claude-artifact-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: #888;
    font-size: 13px;
    font-family: 'SF Mono', monospace;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
}

.claude-artifact-tab:hover {
    color: #ccc;
    background: #252525;
}

.claude-artifact-tab.active {
    color: #fff;
    border-bottom-color: #5a5aff;
}

.claude-artifact-tab-icon {
    font-size: 14px;
}

/* Validation badge in artifact */
.claude-validation-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.claude-validation-badge.passed {
    background: rgba(48, 209, 88, 0.15);
    color: #30D158;
}

.claude-validation-badge.warning {
    background: rgba(255, 159, 10, 0.15);
    color: #FF9F0A;
}

.claude-validation-badge.error {
    background: rgba(255, 69, 58, 0.15);
    color: #FF453A;
}

/* Footer with actions */
.claude-artifact-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #1a1a1a;
    border-top: 1px solid #333;
}

.claude-artifact-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 12px;
    color: #666;
}

.claude-artifact-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Responsive */
@media (max-width: 768px) {
    .claude-artifact-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .claude-artifact-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .claude-artifact-btn span {
        display: none;
    }

    .claude-artifact-btn {
        padding: 8px 10px;
    }

    .claude-line-numbers {
        display: none;
    }

    .claude-code-content {
        font-size: 12px;
    }
}

/* ============================================================
   STREAMING ARTIFACT SECTIONS
   Claude-style collapsible code sections during streaming
   ============================================================ */

.streaming-artifact {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    margin: 16px 0;
    overflow: hidden;
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
}

.streaming-artifact-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: linear-gradient(135deg, #2a2a2a 0%, #1e1e1e 100%);
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid #333;
}

.streaming-artifact-header:hover {
    background: linear-gradient(135deg, #333 0%, #252525 100%);
}

.streaming-artifact-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.streaming-artifact-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #5a5aff 0%, #8a4fff 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.streaming-artifact-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.streaming-artifact-label {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.streaming-artifact-description {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.streaming-artifact-file-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #333;
    border-radius: 6px;
    font-size: 12px;
    color: #aaa;
    font-family: 'SF Mono', monospace;
    flex-shrink: 0;
}

.streaming-artifact-file-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #30D158;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

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

.streaming-artifact-toggle {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.streaming-artifact.collapsed .streaming-artifact-toggle {
    transform: rotate(-90deg);
}

.streaming-artifact-toggle svg {
    width: 16px;
    height: 16px;
}

/* Streaming code content */
.streaming-artifact-body {
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.streaming-artifact.collapsed .streaming-artifact-body {
    max-height: 0;
}

.streaming-artifact-code {
    display: flex;
    overflow-x: auto;
    background: #0d0d0d;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 13px;
    line-height: 1.6;
}

.streaming-line-numbers {
    padding: 12px 12px 12px 16px;
    background: #0a0a0a;
    color: #444;
    text-align: right;
    user-select: none;
    border-right: 1px solid #222;
    min-width: 50px;
    flex-shrink: 0;
}

.streaming-line-numbers div {
    height: 1.6em;
}

.streaming-code-content {
    padding: 12px 16px;
    color: #e0e0e0;
    white-space: pre;
    flex: 1;
    overflow-x: auto;
    min-width: 0;
}

/* Streaming typing cursor */
.streaming-cursor {
    display: inline-block;
    width: 8px;
    height: 1.2em;
    background: #5a5aff;
    animation: blink 0.8s infinite;
    vertical-align: middle;
    margin-left: 2px;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Syntax highlighting for streaming */
.streaming-code-content .keyword {
    color: #c792ea;
}

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

.streaming-code-content .number {
    color: #f78c6c;
}

.streaming-code-content .comment {
    color: #546e7a;
    font-style: italic;
}

.streaming-code-content .function {
    color: #82aaff;
}

.streaming-code-content .class-name {
    color: #ffcb6b;
}

.streaming-code-content .operator {
    color: #89ddff;
}

.streaming-code-content .decorator {
    color: #c792ea;
}

.streaming-code-content .tag {
    color: #f07178;
}

.streaming-code-content .attribute {
    color: #ffcb6b;
}

/* Streaming progress indicator */
.streaming-artifact-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #1a1a1a;
    border-top: 1px solid #333;
    font-size: 12px;
    color: #888;
}

.streaming-artifact-progress-bar {
    flex: 1;
    height: 3px;
    background: #333;
    border-radius: 2px;
    overflow: hidden;
}

.streaming-artifact-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #5a5aff, #8a4fff);
    width: 0%;
    transition: width 0.3s ease;
    animation: shimmer 1.5s infinite;
}

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

.streaming-artifact-progress-fill {
    background: linear-gradient(90deg, #5a5aff, #8a4fff, #5a5aff);
    background-size: 200% 100%;
}

/* Completed streaming artifact */
.streaming-artifact.completed .streaming-artifact-file-badge::before {
    background: #5a5aff;
    animation: none;
}

.streaming-artifact.completed .streaming-artifact-progress {
    display: none;
}

/* Footer with stats */
.streaming-artifact-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: #1a1a1a;
    border-top: 1px solid #333;
    font-size: 12px;
    color: #666;
}

.streaming-artifact-stats {
    display: flex;
    gap: 16px;
}

.streaming-artifact-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

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

.streaming-artifact-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid #444;
    border-radius: 6px;
    color: #aaa;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
}

.streaming-artifact-btn:hover {
    background: #333;
    border-color: #555;
    color: #fff;
}

.streaming-artifact-btn svg {
    width: 14px;
    height: 14px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .streaming-artifact-header {
        padding: 12px;
    }

    .streaming-artifact-icon {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }

    .streaming-artifact-label {
        font-size: 13px;
    }

    .streaming-artifact-file-badge {
        padding: 3px 8px;
        font-size: 11px;
    }

    .streaming-line-numbers {
        display: none;
    }

    .streaming-code-content {
        font-size: 12px;
        padding: 10px 12px;
    }
}

/* ============================================================
   CLAUDE-STYLE SPLIT-SCREEN ARTIFACT PANEL
   Clean minimal design - thin grey borders, muted colors
   ============================================================ */

/* When artifact panel is active, enable split layout */
.chat-think-wrapper.artifact-active {
    display: flex;
    gap: 0;
}

.chat-think-wrapper.artifact-active .chat-container {
    flex: 0 0 50%;
    max-width: 50%;
    border-right: 1px solid rgba(255,255,255,0.1);
}

/* Right-side artifact panel - MUST be hidden by default */
.artifact-side-panel {
    display: none !important;
    flex-direction: column;
    flex: 1;
    background: #1e1e1e;
    height: 100%;
    overflow: hidden;
    visibility: hidden;
}

.chat-think-wrapper.artifact-active .artifact-side-panel {
    display: flex !important;
    visibility: visible;
}

/* Artifact panel header - minimal */
.artifact-side-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    min-height: 52px;
}

/* File tabs - clean text style */
.artifact-side-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    flex: 1;
    padding-right: 16px;
}

.artifact-side-tabs::-webkit-scrollbar {
    display: none;
}

.artifact-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: transparent;
    border: none;
    color: #a0a0a0;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.15s ease;
}

.artifact-tab:hover {
    color: #fff;
}

.artifact-tab.active {
    color: #fff;
}

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

.artifact-tab-lang {
    padding: 2px 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 4px;
    font-size: 11px;
    text-transform: uppercase;
    color: #777;
    margin-left: 4px;
}

/* Header actions - thin border buttons */
.artifact-side-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.artifact-side-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: #888;
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.15s ease;
}

.artifact-side-btn:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.2);
    color: #e0e0e0;
}

.artifact-side-btn.primary {
    background: transparent;
    border-color: rgba(255,255,255,0.1);
    color: #888;
}

.artifact-side-btn.primary:hover {
    background: rgba(255,255,255,0.06);
    color: #e0e0e0;
}

.artifact-side-btn svg {
    width: 14px;
    height: 14px;
    opacity: 0.7;
}

.artifact-side-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    color: #555;
    cursor: pointer;
    margin-left: 4px;
    transition: all 0.15s ease;
}

.artifact-side-close:hover {
    color: #e0e0e0;
}

.artifact-side-close svg {
    width: 18px;
    height: 18px;
}

/* Code area - clean dark */
.artifact-side-code {
    flex: 1;
    display: flex;
    overflow: auto;
    background: #111;
    font-family: 'Menlo', 'Monaco', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.5;
}

/* Line numbers - subtle grey */
.artifact-line-numbers {
    display: flex;
    flex-direction: column;
    padding: 16px 16px 16px 20px;
    background: rgba(255,255,255,0.02);
    color: #444;
    text-align: right;
    user-select: none;
    min-width: 50px;
    border-right: 1px solid rgba(255,255,255,0.05);
}

.artifact-line-numbers div {
    height: 1.5em;
}

/* Code content */
.artifact-code-content {
    flex: 1;
    padding: 16px 20px;
    margin: 0;
    color: #d4d4d4;
    overflow-x: auto;
    white-space: pre;
    tab-size: 4;
}

/* Footer with run button */
.artifact-side-footer {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 12px 16px;
    background: rgba(255,255,255,0.02);
    border-top: 1px solid rgba(255,255,255,0.06);
}

.artifact-run-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: #909090;
    font-size: 13px;
    font-family: 'Menlo', 'Monaco', monospace;
    cursor: pointer;
    transition: all 0.15s ease;
}

.artifact-run-btn:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.artifact-run-btn .run-icon {
    color: #4ade80;
    font-size: 10px;
}

/* Mobile responsive - stack vertically */
@media (max-width: 900px) {
    .chat-think-wrapper.artifact-active {
        flex-direction: column;
    }

    .chat-think-wrapper.artifact-active .chat-container {
        flex: none;
        max-width: 100%;
        height: 40vh;
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    .chat-think-wrapper.artifact-active .artifact-side-panel {
        flex: 1;
        min-height: 50vh;
    }

    .artifact-side-header {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px 12px;
    }

    .artifact-side-tabs {
        width: 100%;
        order: 2;
    }

    .artifact-side-actions {
        order: 1;
        margin-left: auto;
    }
}

/* Syntax highlighting - VSCode/Claude muted colors */
.artifact-code-content .keyword { color: #c586c0; }
.artifact-code-content .string { color: #ce9178; }
.artifact-code-content .number { color: #b5cea8; }
.artifact-code-content .comment { color: #6a9955; }
.artifact-code-content .function { color: #dcdcaa; }
.artifact-code-content .class { color: #4ec9b0; }
.artifact-code-content .operator { color: #d4d4d4; }
.artifact-code-content .variable { color: #9cdcfe; }
.artifact-code-content .property { color: #9cdcfe; }
.artifact-code-content .decorator { color: #dcdcaa; }
.artifact-code-content .tag { color: #569cd6; }
.artifact-code-content .attr-name { color: #9cdcfe; }
.artifact-code-content .attr-value { color: #ce9178; }
.artifact-code-content .punctuation { color: #d4d4d4; }
.artifact-code-content .builtin { color: #4ec9b0; }

/* Inline artifact indicator (shown in chat when panel is open) */
.artifact-inline-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    margin-top: 12px;
}

.artifact-indicator-icon {
    font-size: 20px;
    opacity: 0.8;
}

.artifact-indicator-text {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.artifact-indicator-text strong {
    color: #e0e0e0;
    font-size: 14px;
    font-weight: 500;
}

.artifact-indicator-text span {
    color: #808080;
    font-size: 12px;
}

.artifact-indicator-btn {
    padding: 8px 14px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: #888;
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.15s ease;
}

.artifact-indicator-btn:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.2);
    color: #e0e0e0;
}

/* ============================================================
   LIVE STREAMING ARTIFACT (shows code as it's being written)
   Clean minimal design - matches Claude's artifact aesthetic
   ============================================================ */

.live-streaming-artifact {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    margin: 12px 0;
    overflow: hidden;
}

.live-artifact-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #1f1f1f;
    border-bottom: 1px solid #2a2a2a;
}

.live-artifact-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
}

.live-artifact-icon svg {
    width: 100%;
    height: 100%;
    color: inherit;
}

.live-artifact-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.live-artifact-title {
    font-size: 13px;
    font-weight: 500;
    color: #e0e0e0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.live-artifact-lang {
    font-size: 10px;
    color: #777;
    background: rgba(255,255,255,0.08);
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.live-artifact-status {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #888;
    font-size: 12px;
}

.live-artifact-spinner {
    width: 12px;
    height: 12px;
    border: 1.5px solid #444;
    border-top-color: #888;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.live-streaming-artifact.completed .live-artifact-status {
    color: #6b6;
}

.live-streaming-artifact.completed .live-artifact-spinner {
    display: none;
}

/* Code display area - clean dark like Claude */
.live-artifact-code {
    display: flex;
    max-height: 400px;
    overflow: auto;
    background: #0d0d0d;
}

.live-artifact-lines {
    display: flex;
    flex-direction: column;
    padding: 12px 10px;
    background: #141414;
    color: #555;
    text-align: right;
    user-select: none;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 12px;
    line-height: 1.5;
    min-width: 40px;
    border-right: 1px solid #252525;
}

.live-artifact-lines div {
    height: 1.5em;
}

.live-artifact-content {
    flex: 1;
    padding: 12px 14px;
    margin: 0;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 12px;
    line-height: 1.5;
    color: #d4d4d4;
    background: transparent;
    overflow-x: auto;
    white-space: pre;
    tab-size: 4;
}

/* Syntax highlighting - VSCode/Claude muted colors */
.live-artifact-content .keyword { color: #c586c0; }
.live-artifact-content .string { color: #ce9178; }
.live-artifact-content .number { color: #b5cea8; }
.live-artifact-content .comment { color: #6a9955; }
.live-artifact-content .function { color: #dcdcaa; }
.live-artifact-content .class { color: #4ec9b0; }
.live-artifact-content .operator { color: #d4d4d4; }
.live-artifact-content .decorator { color: #dcdcaa; }

/* Mobile responsive */
@media (max-width: 600px) {
    .live-artifact-header {
        padding: 10px 12px;
    }

    .live-artifact-icon {
        width: 28px;
        height: 28px;
    }

    .live-artifact-title {
        font-size: 13px;
    }

    .live-artifact-lines {
        display: none;
    }

    .live-artifact-content {
        padding: 10px 12px;
        font-size: 12px;
    }
}

/* ============================================================
   STREAMING ARTIFACT (completed/static version)
   Used after code finishes streaming - collapsible panel
   ============================================================ */

.streaming-artifact {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    margin: 12px 0;
    overflow: hidden;
}

.streaming-artifact-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #1f1f1f;
    border-bottom: 1px solid #2a2a2a;
    cursor: pointer;
    transition: background 0.15s ease;
}

.streaming-artifact-header:hover {
    background: #252525;
}

.streaming-artifact-title {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.streaming-artifact-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.streaming-artifact-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.streaming-artifact-label {
    font-size: 13px;
    font-weight: 500;
    color: #e0e0e0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.streaming-artifact-description {
    font-size: 11px;
    color: #777;
}

.streaming-artifact-file-badge {
    font-size: 10px;
    color: #777;
    background: rgba(255,255,255,0.08);
    padding: 2px 8px;
    border-radius: 3px;
    font-family: 'SF Mono', 'Fira Code', monospace;
}

.streaming-artifact-toggle {
    width: 20px;
    height: 20px;
    color: #666;
    transition: transform 0.2s ease;
}

.streaming-artifact-toggle svg {
    width: 100%;
    height: 100%;
}

.streaming-artifact.collapsed .streaming-artifact-toggle {
    transform: rotate(-90deg);
}

.streaming-artifact-body {
    display: block;
}

.streaming-artifact.collapsed .streaming-artifact-body {
    display: none;
}

.streaming-artifact-code {
    display: flex;
    max-height: 400px;
    overflow: auto;
    background: #0d0d0d;
}

.streaming-line-numbers {
    display: flex;
    flex-direction: column;
    padding: 12px 10px;
    background: #141414;
    color: #555;
    text-align: right;
    user-select: none;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 12px;
    line-height: 1.5;
    min-width: 40px;
    border-right: 1px solid #252525;
}

.streaming-line-numbers div {
    height: 1.5em;
}

.streaming-code-content {
    flex: 1;
    padding: 12px 14px;
    margin: 0;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 12px;
    line-height: 1.5;
    color: #d4d4d4;
    background: transparent;
    overflow-x: auto;
    white-space: pre;
    tab-size: 4;
}

/* Syntax highlighting for streaming artifacts */
.streaming-code-content .keyword { color: #c586c0; }
.streaming-code-content .string { color: #ce9178; }
.streaming-code-content .number { color: #b5cea8; }
.streaming-code-content .comment { color: #6a9955; }
.streaming-code-content .function { color: #dcdcaa; }
.streaming-code-content .class { color: #4ec9b0; }
.streaming-code-content .operator { color: #d4d4d4; }
.streaming-code-content .decorator { color: #dcdcaa; }

.streaming-artifact-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: #1a1a1a;
    border-top: 1px solid #2a2a2a;
}

.streaming-artifact-stats {
    display: flex;
    gap: 16px;
    font-size: 11px;
    color: #666;
}

.streaming-artifact-stats strong {
    color: #888;
    font-weight: 500;
}

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

.streaming-artifact-btn {
    background: transparent;
    border: 1px solid #333;
    color: #888;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.streaming-artifact-btn:hover {
    background: rgba(255,255,255,0.05);
    color: #e0e0e0;
    border-color: #555;
}

.streaming-artifact-btn svg {
    width: 12px;
    height: 12px;
}

/* Mobile responsive for streaming artifacts */
@media (max-width: 600px) {
    .streaming-artifact-header {
        padding: 10px 12px;
    }

    .streaming-artifact-file-badge {
        display: none;
    }

    .streaming-line-numbers {
        display: none;
    }

    .streaming-code-content {
        padding: 10px 12px;
        font-size: 11px;
    }

    .streaming-artifact-footer {
        flex-direction: column;
        gap: 8px;
    }
}
