const fs = require('fs');

// Read the Dashboard.tsx file
const filePath = '/components/Dashboard.tsx';
let content = fs.readFileSync(filePath, 'utf8');

// Replace all bg-gray-50 with dark mode compatible version
content = content.replace(/bg-gray-50/g, 'bg-muted/50 dark:bg-muted/20');

// Replace bg-gray-100 with dark mode compatible version  
content = content.replace(/bg-gray-100/g, 'bg-muted/60 dark:bg-muted/30');

// Replace text-gray colors with dark mode compatible versions
content = content.replace(/text-gray-800/g, 'text-foreground dark:text-foreground');
content = content.replace(/text-gray-600/g, 'text-muted-foreground dark:text-muted-foreground');
content = content.replace(/text-gray-900/g, 'text-foreground dark:text-foreground');
content = content.replace(/text-gray-500/g, 'text-muted-foreground/80 dark:text-muted-foreground/80');

// Replace icon backgrounds with dark mode versions
content = content.replace(/bg-blue-100/g, 'bg-blue-100 dark:bg-blue-900/30');
content = content.replace(/bg-green-100/g, 'bg-green-100 dark:bg-green-900/30');
content = content.replace(/bg-yellow-100/g, 'bg-yellow-100 dark:bg-yellow-900/30');
content = content.replace(/bg-purple-100/g, 'bg-purple-100 dark:bg-purple-900/30');
content = content.replace(/bg-orange-100/g, 'bg-orange-100 dark:bg-orange-900/30');
content = content.replace(/bg-indigo-100/g, 'bg-indigo-100 dark:bg-indigo-900/30');

// Replace icon text colors with dark mode versions
content = content.replace(/text-blue-600/g, 'text-blue-600 dark:text-blue-400');
content = content.replace(/text-green-600/g, 'text-green-600 dark:text-green-400');
content = content.replace(/text-yellow-600/g, 'text-yellow-600 dark:text-yellow-400');
content = content.replace(/text-purple-600/g, 'text-purple-600 dark:text-purple-400');
content = content.replace(/text-orange-600/g, 'text-orange-600 dark:text-orange-400');
content = content.replace(/text-indigo-600/g, 'text-indigo-600 dark:text-indigo-400');

// Replace borders
content = content.replace(/border-gray-200/g, 'border-border/20 dark:border-border/30');

// Write the file back
fs.writeFileSync(filePath, content, 'utf8');

console.log('Dashboard.tsx 다크모드 적용 완료!');