@extends('layouts.app')

@section('title', 'Détails de l\'Utilisateur - ' . $VoyagedifiantUsers->name)

@push('styles')
<style>
    :root {
        --primary-color: #020548;
        --secondary-color: #3b5de7;
        --accent-color: #ff6b6b;
        --light-bg: #f8f9fa;
        --dark-text: #2c3e50;
    }

    .user-header {
        background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
        color: white;
        padding: 2rem 0;
        margin-bottom: 2rem;
        border-radius: 0 0 20px 20px;
    }

    .user-card {
        background: white;
        border-radius: 15px;
        box-shadow: 0 10px 30px rgba(2, 5, 72, 0.1);
        overflow: hidden;
        margin-bottom: 2rem;
    }

    .user-profile {
        text-align: center;
        padding: 2rem;
        background: var(--light-bg);
    }

    .user-image {
        width: 180px;
        height: 180px;
        border-radius: 50%;
        object-fit: cover;
        border: 5px solid white;
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        margin-bottom: 1.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 4rem;
        color: white;
        background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    }

    .user-info {
        padding: 2rem;
    }

    .info-item {
        display: flex;
        align-items: center;
        padding: 1rem 0;
        border-bottom: 1px solid #eee;
    }

    .info-item:last-child {
        border-bottom: none;
    }

    .info-icon {
        width: 50px;
        height: 50px;
        background: var(--light-bg);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-right: 1rem;
        color: var(--primary-color);
        font-size: 1.2rem;
    }

    .info-content {
        flex: 1;
    }

    .info-label {
        font-weight: 600;
        color: var(--dark-text);
        margin-bottom: 0.25rem;
    }

    .info-value {
        color: #6c757d;
        font-size: 1.1rem;
    }

    .btn-custom {
        background: var(--primary-color);
        border: none;
        padding: 12px 30px;
        border-radius: 8px;
        font-weight: 600;
        transition: all 0.3s;
    }

    .btn-custom:hover {
        background: var(--secondary-color);
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(59, 93, 231, 0.3);
    }

    .badge-status {
        background: var(--secondary-color);
        color: white;
        padding: 0.5rem 1rem;
        border-radius: 20px;
        font-size: 0.9rem;
        font-weight: 500;
    }

    .badge-role {
        padding: 0.5rem 1rem;
        border-radius: 20px;
        font-size: 0.9rem;
        font-weight: 500;
    }

    .badge-admin {
        background: var(--primary-color);
        color: white;
    }

    .badge-user {
        background: #6c757d;
        color: white;
    }

    .action-buttons {
        display: flex;
        gap: 1rem;
        justify-content: center;
        padding: 2rem;
        background: var(--light-bg);
        border-radius: 15px;
    }

    .stats-card {
        transition: transform 0.3s, box-shadow 0.3s;
    }

    .stats-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    }

    @media (max-width: 768px) {
        .user-image {
            width: 120px;
            height: 120px;
            font-size: 2.5rem;
        }

        .info-item {
            flex-direction: column;
            text-align: center;
        }

        .info-icon {
            margin-right: 0;
            margin-bottom: 1rem;
        }

        .action-buttons {
            flex-direction: column;
        }
    }
</style>
@endpush

@section('content')
<!-- Header avec fond gradient -->
<div class="user-header">
    <div class="container">
        <div class="row align-items-center">
            <div class="col-md-8">
                <h1 class="display-5 fw-bold mb-3" style="color:white">
                    <i class="fas fa-user-tie me-3"></i>Profil de l'Utilisateur
                </h1>
                <p class="lead mb-0">Détails complets du profil utilisateur</p>
            </div>
            {{-- <div class="col-md-4 text-md-end">
                <span class="badge-status">
                    <i class="fas fa-circle me-2"></i>Compte Actif
                </span>
            </div> --}}
        </div>
    </div>
</div>

<div class="container">
    <!-- Carte principale -->
    <div class="user-card">
        <!-- Section photo de profil -->
        <div class="user-profile">
            <div class="position-relative d-inline-block">
                <div class="user-image">
                    {{ substr($VoyagedifiantUsers->name, 0, 1) }}
                </div>
                <div class="position-absolute bottom-0 end-0 bg-success rounded-circle p-2 border border-3 border-white">
                    <i class="fas fa-check text-white"></i>
                </div>
            </div>
            <h2 class="mb-1" style="color: var(--primary-color);">{{ $VoyagedifiantUsers->name }}</h2>
            <p class="text-muted">
                <span class="badge-role {{ $VoyagedifiantUsers->role === 'admin' ? 'badge-admin' : 'badge-user' }}">
                    {{ $VoyagedifiantUsers->role === 'admin' ? 'Administrateur' : 'Employé' }}
                </span>
            </p>
        </div>

        <!-- Section informations -->
        <div class="user-info">
            <h4 class="mb-4" style="color: var(--primary-color);">
                <i class="fas fa-info-circle me-2"></i>Informations Personnelles
            </h4>

            <div class="info-item">
                <div class="info-icon">
                    <i class="fas fa-id-card"></i>
                </div>
                <div class="info-content">
                    <div class="info-label">Nom Complet</div>
                    <div class="info-value">{{ $VoyagedifiantUsers->name }}</div>
                </div>
            </div>

            <div class="info-item">
                <div class="info-icon">
                    <i class="fas fa-envelope"></i>
                </div>
                <div class="info-content">
                    <div class="info-label">Email</div>
                    <div class="info-value">
                        <a href="mailto:{{ $VoyagedifiantUsers->email }}" class="text-decoration-none">
                            <i class="fas fa-envelope me-2"></i>{{ $VoyagedifiantUsers->email }}
                        </a>
                    </div>
                </div>
            </div>

            <div class="info-item">
                <div class="info-icon">
                    <i class="fas fa-phone"></i>
                </div>
                <div class="info-content">
                    <div class="info-label">Téléphone</div>
                    <div class="info-value">
                        <a href="tel:{{ $VoyagedifiantUsers->telephone }}" class="text-decoration-none">
                            <i class="fas fa-phone-alt me-2"></i>{{ $VoyagedifiantUsers->telephone }}
                        </a>
                    </div>
                </div>
            </div>

            <div class="info-item">
                <div class="info-icon">
                    <i class="fas fa-globe"></i>
                </div>
                <div class="info-content">
                    <div class="info-label">Pays</div>
                    <div class="info-value">
                        <i class="fas fa-flag me-2"></i>{{ $VoyagedifiantUsers->country }}
                    </div>
                </div>
            </div>

            <div class="info-item">
                <div class="info-icon">
                    <i class="fas fa-user-tag"></i>
                </div>
                <div class="info-content">
                    <div class="info-label">Rôle</div>
                    <div class="info-value">
                        <span class="badge-role {{ $VoyagedifiantUsers->role === 'admin' ? 'badge-admin' : 'badge-user' }}">
                            {{ $VoyagedifiantUsers->role === 'admin' ? 'Administrateur' : 'Employé' }}
                        </span>
                    </div>
                </div>
            </div>

            <div class="info-item">
                <div class="info-icon">
                    <i class="fas fa-calendar-alt"></i>
                </div>
                <div class="info-content">
                    <div class="info-label">Membre depuis</div>
                    <div class="info-value">
                        <i class="far fa-clock me-2"></i>{{ $VoyagedifiantUsers->created_at->format('d/m/Y') }}
                    </div>
                </div>
            </div>

            <div class="info-item">
                <div class="info-icon">
                    <i class="fas fa-sync-alt"></i>
                </div>
                <div class="info-content">
                    <div class="info-label">Dernière mise à jour</div>
                    <div class="info-value">
                        <i class="far fa-clock me-2"></i>{{ $VoyagedifiantUsers->updated_at->format('d/m/Y à H:i') }}
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- Statistiques supplémentaires -->
    {{-- <div class="row mb-4">
        <div class="col-md-3 mb-3">
            <div class="card border-0 shadow-sm h-100 text-center stats-card">
                <div class="card-body py-4">
                    <div class="text-primary mb-2">
                        <i class="fas fa-calendar-check fa-2x"></i>
                    </div>
                    <h3 class="fw-bold">{{ $VoyagedifiantUsers->created_at->diffInDays() }}</h3>
                    <p class="text-muted mb-0">Jours actifs</p>
                </div>
            </div>
        </div>
        <div class="col-md-3 mb-3">
            <div class="card border-0 shadow-sm h-100 text-center stats-card">
                <div class="card-body py-4">
                    <div class="text-success mb-2">
                        <i class="fas fa-tasks fa-2x"></i>
                    </div>
                    <h3 class="fw-bold">156</h3>
                    <p class="text-muted mb-0">Tâches complétées</p>
                </div>
            </div>
        </div>
        <div class="col-md-3 mb-3">
            <div class="card border-0 shadow-sm h-100 text-center stats-card">
                <div class="card-body py-4">
                    <div class="text-warning mb-2">
                        <i class="fas fa-bell fa-2x"></i>
                    </div>
                    <h3 class="fw-bold">12</h3>
                    <p class="text-muted mb-0">Notifications</p>
                </div>
            </div>
        </div>
        <div class="col-md-3 mb-3">
            <div class="card border-0 shadow-sm h-100 text-center stats-card">
                <div class="card-body py-4">
                    <div class="text-info mb-2">
                        <i class="fas fa-database fa-2x"></i>
                    </div>
                    <h3 class="fw-bold">3.2GB</h3>
                    <p class="text-muted mb-0">Stockage utilisé</p>
                </div>
            </div>
        </div>
    </div> --}}

    <!-- Boutons d'action -->
    {{-- <div class="action-buttons">
        <a href="{{ route('listeUtilisateur') }}" class="btn btn-custom">
            <i class="fas fa-arrow-left me-2"></i>Retour à la liste
        </a>
        <a href="{{ route('formeditUtilisateur', $VoyagedifiantUsers->id) }}" class="btn btn-outline-primary">
            <i class="fas fa-edit me-2"></i>Modifier le profil
        </a>
        <a href="mailto:{{ $VoyagedifiantUsers->email }}" class="btn btn-success">
            <i class="fas fa-envelope me-2"></i>Envoyer un email
        </a>
        <a href="tel:{{ $VoyagedifiantUsers->telephone }}" class="btn btn-primary">
            <i class="fas fa-phone me-2"></i>Appeler
        </a>
    </div> --}}
</div>
@endsection

@push('scripts')
<script>
    document.addEventListener('DOMContentLoaded', function() {
        // Animation au scroll
        const observer = new IntersectionObserver((entries) => {
            entries.forEach(entry => {
                if (entry.isIntersecting) {
                    entry.target.style.opacity = 1;
                    entry.target.style.transform = 'translateY(0)';
                }
            });
        }, { threshold: 0.1 });

        document.querySelectorAll('.info-item, .stats-card').forEach(item => {
            item.style.opacity = 0;
            item.style.transform = 'translateY(20px)';
            item.style.transition = 'all 0.6s ease';
            observer.observe(item);
        });
    });
</script>
@endpush
