<?php

namespace App\Filament\Resources\Companies\Schemas;

use Filament\Forms;
use Filament\Schemas\Components\Section;
use Filament\Schemas\Schema;

class CompanyForm
{
    public static function configure(Schema $schema): Schema
    {
        return $schema
            ->components([
                Section::make('Company Information')
                    ->description('Basic company details and contact information.')
                    ->icon('heroicon-o-building-office')
                    ->schema([
                        Forms\Components\TextInput::make('name')
                            ->label('Company Name')
                            ->required()
                            ->maxLength(255)
                            ->prefixIcon('heroicon-o-building-office')
                            ->placeholder('Enter company name')
                            ->columnSpanFull(),
                        
                        Forms\Components\TextInput::make('email')
                            ->label('Email')
                            ->email()
                            ->maxLength(255)
                            ->prefixIcon('heroicon-o-envelope')
                            ->placeholder('company@example.com'),
                        
                        Forms\Components\TextInput::make('email_alternative')
                            ->label('Alternative Email')
                            ->email()
                            ->maxLength(255)
                            ->prefixIcon('heroicon-o-envelope')
                            ->placeholder('alternative@example.com'),
                        
                        Forms\Components\TextInput::make('mobile')
                            ->label('Mobile')
                            ->tel()
                            ->maxLength(255)
                            ->prefixIcon('heroicon-o-phone')
                            ->placeholder('+1 (555) 000-0000'),
                        
                        Forms\Components\TextInput::make('mobile_two')
                            ->label('Mobile Two')
                            ->tel()
                            ->maxLength(255)
                            ->prefixIcon('heroicon-o-phone')
                            ->placeholder('+1 (555) 000-0000'),
                        
                        Forms\Components\Textarea::make('address')
                            ->label('Address')
                            ->rows(3)
                            ->maxLength(65535)
                            ->placeholder('Enter company address')
                            ->columnSpanFull(),
                    ])
                    ->columns(1)
                    ->collapsible(),
                
                Section::make('Social Media Links')
                    ->description('Company social media profiles.')
                    ->icon('heroicon-o-share')
                    ->schema([
                        Forms\Components\TextInput::make('facebook')
                            ->label('Facebook')
                            ->url()
                            ->maxLength(255)
                            ->prefixIcon('heroicon-o-link')
                            ->placeholder('https://facebook.com/company'),
                        
                        Forms\Components\TextInput::make('instagram')
                            ->label('Instagram')
                            ->url()
                            ->maxLength(255)
                            ->prefixIcon('heroicon-o-link')
                            ->placeholder('https://instagram.com/company'),
                        
                        Forms\Components\TextInput::make('linkedin')
                            ->label('LinkedIn')
                            ->url()
                            ->maxLength(255)
                            ->prefixIcon('heroicon-o-link')
                            ->placeholder('https://linkedin.com/company'),
                        
                        Forms\Components\TextInput::make('tiktok')
                            ->label('TikTok')
                            ->url()
                            ->maxLength(255)
                            ->prefixIcon('heroicon-o-link')
                            ->placeholder('https://tiktok.com/@company'),
                        
                        Forms\Components\TextInput::make('whatsapp')
                            ->label('WhatsApp')
                            ->tel()
                            ->maxLength(255)
                            ->prefixIcon('heroicon-o-phone')
                            ->placeholder('+1 (555) 000-0000')
                            ->helperText('Include country code'),
                    ])
                    ->columns(1)
                    ->collapsible(),
                
                Section::make('Branding Assets')
                    ->description('Upload company logos and favicon.')
                    ->icon('heroicon-o-photo')
                    ->schema([
                        Forms\Components\FileUpload::make('logo')
                            ->label('Logo')
                            ->image()
                            ->imageEditor()
                            ->disk('public')
                            ->directory('company/logos')
                            ->maxSize(2048)
                            ->helperText('Recommended: PNG or SVG format')
                            ->imagePreviewHeight('150')
                            ->panelLayout('compact')
                            ->columnSpanFull(),
                        
                        Forms\Components\FileUpload::make('white_logo')
                            ->label('White Logo')
                            ->image()
                            ->imageEditor()
                            ->disk('public')
                            ->directory('company/logos')
                            ->maxSize(2048)
                            ->helperText('Logo for dark backgrounds')
                            ->imagePreviewHeight('150')
                            ->panelLayout('compact')
                            ->columnSpanFull(),
                        
                        Forms\Components\FileUpload::make('favicon')
                            ->label('Favicon')
                            ->image()
                            ->imageEditor()
                            ->disk('public')
                            ->directory('company/favicons')
                            ->maxSize(512)
                            ->helperText('Recommended: 32x32 or 64x64 pixels')
                            ->imagePreviewHeight('150')
                            ->panelLayout('compact')
                            ->columnSpanFull(),
                    ])
                    ->columns(1)
                    ->collapsible(),
            ]);
    }
}
