/* FILE UPLOAD - CLEAN UI STYLES */

/* Attached files preview (bottom of input area) */
#attachedFilesPreview {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 8px;
}

#attachedFilesPreview.hidden {
    display: none;
}

.attached-files-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: #6b7280;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.attached-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 4px;
    transition: all 0.2s;
}

.attached-file-item:hover {
    border-color: #3b82f6;
    background: #eff6ff;
}

.file-preview-content {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0; /* For text truncation */
}

.file-icon {
    font-size: 18px;
    color: #6b7280;
    flex-shrink: 0;
}

.file-thumbnail {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.file-info {
    display: flex;
    flex-direction: column;
    min-width: 0; /* For text truncation */
    flex: 1;
}

.file-name {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size {
    font-size: 11px;
    color: #9ca3af;
}

.remove-file-btn {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.remove-file-btn:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* File tags in messages (compact display) */
.message-files-compact {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

/* For user messages (blue background) */
.bg-blue-600 .message-files-compact {
    border-top-color: rgba(255, 255, 255, 0.2);
}

/* For assistant messages (white background) */
.bg-white .message-files-compact {
    border-top-color: rgba(0, 0, 0, 0.1);
}

.file-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* For assistant messages */
.bg-white .file-tag {
    background: #f3f4f6;
    color: #4b5563;
    border-color: #e5e7eb;
}

.file-tag i {
    font-size: 10px;
    opacity: 0.8;
}

/* File upload button styling */
.file-upload-btn {
    position: relative;
}

.file-upload-btn:hover {
    transform: scale(1.05);
}

/* Drag and drop styling */
#chatInput.drag-over {
    background: #eff6ff;
    border-color: #3b82f6;
}

#chatInput.drag-over::after {
    content: '📎 Drop files here';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #3b82f6;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    pointer-events: none;
    z-index: 10;
}

/* CODE BLOCK STYLING */

.code-block {
    margin: 12px 0;
    border-radius: 8px;
    overflow: hidden;
    background: #1e1e1e;
    border: 1px solid #3e3e3e;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #2d2d2d;
    border-bottom: 1px solid #3e3e3e;
}

.code-language {
    font-size: 11px;
    font-weight: 600;
    color: #9cdcfe;
    letter-spacing: 0.5px;
}

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

.code-btn {
    background: transparent;
    border: 1px solid #4e4e4e;
    color: #cccccc;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}

.code-btn:hover {
    background: #3e3e3e;
    border-color: #6e6e6e;
    color: #ffffff;
}

.code-btn i {
    font-size: 10px;
}

.code-block pre {
    margin: 0;
    padding: 16px;
    overflow-x: auto;
    background: #1e1e1e;
}

.code-block code {
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.5;
    color: #d4d4d4;
    display: block;
}

/* Inline code */
.inline-code {
    background: #f3f4f6;
    color: #dc2626;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.9em;
}

/* For inline code in user messages (blue background) */
.bg-blue-600 .inline-code {
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.95);
}

/* Syntax highlighting colors (basic) */
.code-block .keyword {
    color: #c586c0;
}

.code-block .string {
    color: #ce9178;
}

.code-block .comment {
    color: #6a9955;
}

.code-block .function {
    color: #dcdcaa;
}

.code-block .number {
    color: #b5cea8;
}