@extends('layouts.base')

@section('menu')
    @include('etudiants.menu')
@endsection

@section('content')
<section class="profile-details bg-light py-5">
    <div class="container">
        <!-- Header -->
        <div class="header d-flex justify-content-between align-items-center mb-4">
            <h1 class="text-primary">Mon Profil</h1>
            <a href="{{ route('etudiants.offres.index') }}" class="btn btn-outline-primary">
                <i class="bi bi-arrow-left"></i> Retour à l'accueil
            </a>
        </div>

        <!-- User Profile Details -->
        <div class="card shadow-sm">
            <div class="card-body ">
                <div class="d-flex align-items-center mb-4">
                    <img src="{{ asset('auth/images/img2.svg') }}" alt="User Avatar" class="rounded-circle me-3" width="80" height="80">
                    <div>
                        <h3 class="card-title">{{ auth()->user()->name }} {{ auth()->user()->surname }}</h3>
                        <p class="text-muted">{{ auth()->user()->email }}</p>
                    </div>
                </div>

                <hr>
                <h2 class="d-flex justify-content-center align-items-center vh-10">Ajoutez une formation</h2>
                <div class="row d-flex justify-content-center align-items-center vh-10">
                
                    <div class="col-md-6">
                    
        @if(session('success'))
            <div class="alert alert-success">{{ session('success') }}</div>
        @endif

        <form action="{{ route('formations.store') }}" method="POST" enctype="multipart/form-data">
            @csrf
            <div class="mb-3">
                <label for="school_name" class="form-label">Nom de l'école*</label>
                <input type="text" name="school_name" id="school_name" class="form-control" required>
            </div>
            <div class="mb-3">
                <label for="degree" class="form-label">Diplôme</label>
                <input type="text" name="degree" id="degree" class="form-control">
            </div>
            <div class="mb-3">
                <label for="field_of_study" class="form-label">Domaine</label>
                <input type="text" name="field_of_study" id="field_of_study" class="form-control">
            </div>
            <div class="mb-3">
                <label for="result" class="form-label">Résultat obtenu</label>
                <input type="text" name="result" id="result" class="form-control">
            </div>
            <div class="mb-3">
                <label for="associative_activity" class="form-label">Activité associative</label>
                <textarea name="associative_activity" id="associative_activity" class="form-control"></textarea>
            </div>
            <div class="mb-3">
                <label for="start_date" class="form-label">Année de début</label>
                <input type="date" name="start_date" id="start_date" class="form-control">
            </div>
            <div class="mb-3">
                <label for="end_date" class="form-label">Année de fin</label>
                <input type="date" name="end_date" id="end_date" class="form-control">
            </div>
            <div class="mb-3">
                <label for="description" class="form-label">Description</label>
                <textarea name="description" id="description" class="form-control"></textarea>
            </div>
            <div class="mb-3">
                <label for="media" class="form-label">Ajouter un média (PDF, Word, Image)</label>
                <input type="file" name="media" id="media" class="form-control">
            </div>
            <button type="submit" class="btn btn-primary">Soumettre</button>
        </form>
              
            </div>
        </div>
    </div>
</section>
    
@endsection