<?php

namespace Database\Seeders;

use App\Models\Career;
use App\Models\JobApplication;
use App\Models\User;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\Hash;

class DatabaseSeeder extends Seeder
{
    /**
     * Seed the application's database.
     */
    public function run(): void
    {
        // Create Admin User
        User::create([
            'name' => 'Admin',
            'email' => 'admin@galtech.org',
            'email_verified_at' => now(),
            'password' => Hash::make('admin123'),
        ]);

        $this->command->info('Admin user created:');
        $this->command->info('Email: admin@galtech.org');
        $this->command->info('Password: admin123');

        // Create Sample Careers
        $career1 = Career::create([
            'title' => 'Senior SEO Analyst',
            'description' => 'We are looking for a results-driven SEO Executive with strong knowledge of On-Page SEO, Off-Page SEO, and Backlinking strategies. The ideal candidate will be responsible for improving website rankings, increasing organic traffic, and enhancing overall online visibility through ethical and effective SEO practices.',
            'responsibilities' => "1. Perform On-Page SEO activities including keyword research, meta tags optimization, content optimization, internal linking, and URL structuring.\n2. Execute Off-Page SEO strategies such as backlink building, directory submissions, guest posting, forum participation, and outreach campaigns.\n3. Develop and manage high-quality backlinking strategies to improve domain authority and search engine rankings.\n4. Conduct regular website audits to identify SEO issues and recommend improvements.\n5. Track, analyze, and report website performance using tools like Google Analytics, Google Search Console, and SEO tools.\n6. Monitor keyword rankings and competitor SEO strategies.\n7. Coordinate with content and marketing teams to ensure SEO best practices are implemented.",
            'requirements' => "1. Strong understanding of On-Page SEO, Off-Page SEO, and Backlinking techniques.\n2. Knowledge of keyword research tools and SEO tools (Google Search Console, Analytics, Ahrefs, SEMrush, etc.).\n3. Ability to analyze data and prepare SEO performance reports.\n4. Candidates having experience of minimum 6 months to 1 Year needs to apply.",
            'location' => 'Thrissur',
            'job_location' => 'Infopark, Thrissur, Thrissur, KERALA, 680308, INDIA',
            'department' => 'Marketing',
            'employment_type' => 'full-time',
            'education' => "Bachelor's Degree",
            'contact_email' => 'hr@galtech.org',
            'contact_phone' => '+91 6282845368',
            'skills' => 'Keyword research, on-page SEO, technical SEO, content optimization, link building, analytics',
            'industry' => 'Information Technology',
            'working_hours' => '9.00 AM to 6.00 PM',
            'date_posted' => '2026-04-01',
            'valid_through' => '2026-12-31',
            'is_active' => true,
        ]);

        Career::create([
            'title' => 'Digital Marketing Interns',
            'description' => 'We are looking for enthusiastic and motivated Digital Marketing Interns to join our team for a 6-month internship. This internship offers hands-on experience in digital marketing and an opportunity to build a strong foundation for a full-time career.',
            'responsibilities' => "1. Assist in planning and executing digital marketing campaigns\n2. Support SEO activities (on-page, off-page, keyword research, backlinking)\n3. Manage and assist with social media content creation and scheduling\n4. Help in basic Google Ads and social media ads execution\n5. Create and optimize content for websites, blogs, and social platforms\n6. Analyze campaign performance using tools like Google Analytics\n7. Conduct market and competitor research",
            'requirements' => "1. Basic knowledge of digital marketing concepts\n2. Familiarity with SEO, social media platforms, and content marketing\n3. Good communication and writing skills\n4. Willingness to learn and adapt in a fast-paced environment\n5. Freshers completed the Digital marketing course Needs to apply",
            'benefits' => "1. Hands-on practical training\n2. Internship certificate upon successful completion\n3. Performance-based opportunity for full-time employment",
            'location' => 'Thrissur',
            'job_location' => 'Infopark, Thrissur, KERALA, 680308, INDIA',
            'department' => 'Marketing',
            'employment_type' => 'internship',
            'education' => "Bachelor's Degree",
            'contact_email' => 'hr@galtech.org',
            'contact_phone' => '+91 6282845368',
            'skills' => 'SEO, social media, content marketing, Good communication and writing skills',
            'industry' => 'Information Technology',
            'working_hours' => '9.00 AM TO 6.00 PM',
            'date_posted' => '2026-04-01',
            'valid_through' => '2026-12-31',
            'is_active' => true,
        ]);

        Career::create([
            'title' => 'Python Full Stack Trainer',
            'description' => 'We are seeking an experienced Python Full Stack Trainer to join our training team. The ideal candidate should have hands-on experience in Python development and a passion for teaching.',
            'responsibilities' => "1. Deliver training on Python full stack development\n2. Create course materials and practical exercises\n3. Mentor students and provide guidance on projects\n4. Evaluate student performance and provide feedback\n5. Stay updated with latest technologies and industry trends",
            'requirements' => "1. 1-2 years of experience in Python development\n2. Knowledge of Django/Flask framework\n3. Experience with frontend technologies (HTML, CSS, JavaScript)\n4. Excellent communication and presentation skills\n5. Prior teaching/training experience preferred",
            'location' => 'Thrissur',
            'job_location' => 'Infopark, Thrissur, KERALA, 680308, INDIA',
            'department' => 'Training',
            'employment_type' => 'full-time',
            'education' => "Bachelor's Degree in Computer Science",
            'contact_email' => 'hr@galtech.org',
            'contact_phone' => '+91 6282845368',
            'skills' => 'Python, Django, Flask, JavaScript, HTML, CSS, SQL',
            'industry' => 'Information Technology',
            'working_hours' => '9.00 AM to 6.00 PM',
            'date_posted' => '2026-04-01',
            'valid_through' => '2026-12-31',
            'is_active' => true,
        ]);

        // Create Sample Application
        JobApplication::create([
            'career_id' => $career1->id,
            'name' => 'John Doe',
            'email' => 'john@example.com',
            'phone' => '+91 98765 43210',
            'position' => 'Senior SEO Analyst',
            'message' => 'I am excited to apply for this position. I have 1 year of experience in SEO and digital marketing. I am proficient in keyword research, on-page optimization, and using tools like Google Analytics and Search Console.',
            'status' => 'pending',
        ]);

        JobApplication::create([
            'career_id' => $career1->id,
            'name' => 'Jane Smith',
            'email' => 'jane@example.com',
            'phone' => '+91 98765 43211',
            'position' => 'Senior SEO Analyst',
            'message' => 'With 8 months of SEO experience and a strong background in content marketing, I believe I would be a great fit for this role. I have experience with technical SEO audits and link building strategies.',
            'status' => 'reviewed',
            'reviewed_at' => now(),
        ]);

        $this->command->info('Sample careers and applications created successfully!');
    }
}
