/**
 * CSS personnalisé pour le portfolio
 * Contient les animations et les styles supplémentaires
 */

/* =========================================================
   Base responsive globale (toutes pages publiques)
   Objectif : aucun débordement + lecture confortable
   ========================================================= */

/* Base : calculs de tailles cohérents */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Anti-débordement horizontal (sans casser Bootstrap) */
html, body {
    max-width: 100%;
    overflow-x: clip;
}

/* Images / médias : toujours fluides */
img, svg, video, canvas {
    max-width: 100%;
    height: auto;
}

/* Textes longs (URLs, emails, techno) : pas de dépassement */
p, h1, h2, h3, h4, h5, h6, a, span, li, .badge, .btn {
    overflow-wrap: anywhere;
}

/* Confort sur très grands écrans : éviter les lignes trop longues */
@media (min-width: 1400px) {
    .container-fluid {
        max-width: 1320px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* Accessibilité : animations allégées si l’utilisateur le demande */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

/* Style général pour le body en mode flex pour le footer sticky */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Padding-top pour compenser la navbar fixe */
body {
    padding-top: 80px;
}

/* S'assurer que le footer reste en bas et style de base */
footer {
    margin-top: auto;
    border-top: 3px solid var(--bs-primary);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
}

footer h5 {
    font-weight: 600;
}

footer .text-muted {
    color: rgba(255, 255, 255, 0.6) !important;
}

/* Animation fade-in pour les éléments qui apparaissent au scroll */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Animation slide-left pour les éléments */
.slide-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.slide-left.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Animation slide-right pour les éléments */
.slide-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.slide-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Animation scale-up pour les images */
.scale-up {
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scale-up.visible {
    opacity: 1;
    transform: scale(1);
}

/* Effet hover sur les liens de navigation */
.nav-link {
    transition: color 0.3s ease;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background-color: var(--bs-primary);
    transition: width 0.3s ease, left 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
    left: 0;
}

/* Style pour les boutons avec effet hover */
.btn {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Style pour les images avec effet hover */
.img-thumbnail {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.img-thumbnail:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

/* Style pour les icônes sociales */
.social-icons {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Sur desktop, aligner à droite */
@media (min-width: 768px) {
    .text-md-end .social-icons {
        justify-content: flex-end;
    }
}

.social-icons a {
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    text-decoration: none;
}

.social-icons a:hover {
    background-color: var(--bs-primary);
    color: white !important;
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(13, 110, 253, 0.4);
}

.social-icons a i {
    transition: transform 0.3s ease;
}

.social-icons a:hover i {
    transform: scale(1.1);
}

/* Animation des barres de progression */
.progress-bar {
    transition: width 1s ease-in-out;
}

/* Style pour le formulaire */
.form-control {
    background-color: #2d2d2d;
    border-color: #444;
    color: #fff;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
    background-color: #2d2d2d;
    border-color: var(--bs-primary);
    color: #fff;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Style pour les messages de validation */
.invalid-feedback {
    display: none;
    font-size: 0.875rem;
    color: #dc3545;
    margin-top: 0.25rem;
}

.form-control.is-invalid ~ .invalid-feedback {
    display: block;
}

.form-control.is-invalid {
    border-color: #dc3545;
}

.form-control.is-valid {
    border-color: #198754;
}

/* Message de succès */
.alert-success {
    animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive - Ajustements pour mobile */
@media (max-width: 768px) {
    body {
        padding-top: 70px;
    }
    
    /* Réduire la taille des titres sur mobile */
    h1 {
        font-size: 1.75rem !important;
    }
    
    h2 {
        font-size: 1.5rem !important;
    }
    
    /* Ajuster les marges sur mobile */
    .mt-5 {
        margin-top: 2rem !important;
    }
    
    .p-5 {
        padding: 2rem !important;
    }
    
    /* Images responsive */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Footer non fixe sur mobile pour éviter les chevauchements */
    footer {
        position: relative !important;
    }
}

/* =========================================================
   Portfolio : cartes projets (images, grille, boutons)
   Objectif : 1 colonne mobile, 2 tablette, 3+ desktop (Bootstrap gère),
   mais on sécurise les hauteurs d’images sur petits écrans.
   ========================================================= */

.project-card .card-img-top {
    height: 250px;
    object-fit: cover;
}

@media (max-width: 576px) {
    .project-card .card-img-top {
        height: 180px;
    }
}

/* Style pour les filtres de projet */
.project-filters {
    margin-bottom: 2rem;
}

.filter-btn {
    margin: 0.25rem;
    transition: all 0.3s ease;
}

.filter-btn.active {
    background-color: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
}

/* Animation pour les cartes de projet */
.project-card {
    transition: all 0.3s ease;
}

.project-card.hidden {
    display: none;
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Loading spinner pour le formulaire */
.spinner-border-sm {
    display: none;
}

.btn.loading .spinner-border-sm {
    display: inline-block;
}

.btn.loading .btn-text {
    display: none;
}

