/**
 * Artifact Styles
 * Code artifacts, previews, and modals
 */

/* Message Attachments */
.message-attachments {
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.attachment-preview {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--surface-secondary);
    border-radius: 0.5rem;
    font-size: 0.75rem;
}

.attachment-icon {
    font-size: 1rem;
    color: var(--text-secondary);
}

.attachment-name {
    font-weight: 500;
    color: var(--text-primary);
}

.attachment-size {
    color: var(--text-secondary);
    margin-left: auto;
}

.artifact-card {
    background: var(--surface);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
    padding: 0.75rem;
    cursor: pointer;
    transition: var(--transition-base);
}

.artifact-card:hover {
    border-color: var(--primary-500);
    background: var(--primary-100);
    transform: translateY(-1px);
}

.artifact-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.artifact-type {
    background: var(--primary-500);
    color: white;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
}

.artifact-title {
    flex: 1;
    font-weight: 500;
    font-size: 0.875rem;
}

.artifact-description {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Artifact Modal */
.artifact-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: var(--z-toast);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-slow);
}

.artifact-modal.show {
    opacity: 1;
    visibility: visible;
}

.artifact-modal-content {
    background: white;
    border-radius: 1rem;
    width: 90vw;
    max-width: 800px;
    height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
}

.artifact-modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.artifact-modal-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
}

.modal-close-btn {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-base);
}

.modal-close-btn:hover {
    background: var(--surface-secondary);
}

.artifact-modal-body {
    flex: 1;
    padding: 0;
    overflow: hidden;
}

.artifact-frame {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 0;
}

.artifact-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Artifact Tabs */
.artifact-tabs {
    display: flex;
    align-items: center;
    background: var(--surface-secondary);
    border-radius: 0.5rem;
    padding: 0.25rem;
    gap: 0.25rem;
    margin: 0 1rem;
}

.artifact-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-base);
    border-radius: 0.375rem;
    white-space: nowrap;
}

.artifact-tab:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

.artifact-tab.active {
    color: var(--primary-500);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.artifact-tab i {
    font-size: 0.875rem;
}

/* Artifact Tab Content */
.artifact-tab-content {
    display: none;
    height: 100%;
}

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

/* Code Viewer */
.code-viewer {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #1e1e1e;
    border-radius: 0.5rem;
    overflow: hidden;
}

.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: #2d2d2d;
    border-bottom: 1px solid #404040;
}

.code-language {
    font-size: 0.875rem;
    font-weight: 600;
    color: #d4d4d4;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.code-copy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background: transparent;
    border: 1px solid #404040;
    border-radius: 0.375rem;
    color: #d4d4d4;
    cursor: pointer;
    transition: var(--transition-base);
}

.code-copy-btn:hover {
    background: #404040;
    border-color: #606060;
}

.code-copy-btn.copied {
    background: var(--success-500);
    border-color: var(--success-500);
    color: white;
}

.code-content {
    flex: 1;
    margin: 0;
    padding: 1rem;
    background: #1e1e1e;
    color: #d4d4d4;
    font-family: var(--font-family-mono);
    font-size: 0.875rem;
    line-height: 1.5;
    overflow: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.code-content code {
    font-family: inherit;
    background: transparent;
    padding: 0;
    border-radius: 0;
}
