/* global.css - AVEC GESTION DU PREMIER CHARGEMENT */

/* Définition de la police personnalisée PPPangaia */
@font-face {
    font-family: 'PPPangaia';
    font-weight: bold;
    src: url('../fonts/PPPangaia-Bold.woff2') format('woff2'),
         url('../fonts/PPPangaia-Bold.woff') format('woff');
    font-display: swap; /* AU LIEU DE optional */
    font-style: normal;
}



/* Cache la barre de défilement pour Webkit (Chrome, Safari) */
.overflow-x-scroll::-webkit-scrollbar {
  display: none;
}

/* Cache la barre de défilement pour Firefox */
.overflow-x-scroll {
  scrollbar-width: none;
}

/* Cache la barre de défilement pour IE et Edge */
.overflow-x-scroll {
  -ms-overflow-style: none;
}

/* Classe pour appliquer la police PPPangaia (utilisée par Tailwind) */
.font-pangaia {
    font-family: 'PPPangaia', sans-serif;
}

/* Styles globaux pour le body et html */
html, body {
    background-color: #FCF9F5 !important;
    height: auto;
    margin: 0;
    padding: 0;
}

body {
    background-color: #FCF9F5 !important;
    font-family: 'Satoshi', sans-serif;
}

/* Définition de l'animation Keyframes */
@keyframes slideDown {
    from {
        transform: translateY(-100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Classe pour l'animation (sera ajoutée par JS) */
.animate-slide-down {
    animation: slideDown 1.2s ease-out forwards;
    transition: all 1.2s ease-out;
}

/* 🔧 MENU - État par défaut VISIBLE sur toutes les pages */
#main-nav {
    position: fixed;
    top: 0 !important; 
    left: 0;
    right: 0;
    /* ✅ VISIBLE PAR DÉFAUT pour toutes les pages */
    transform: translateY(0) !important;
    visibility: visible !important;
    opacity: 1 !important;
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 30 !important;
}

/* 🎬 ANIMATION SPÉCIALE SEULEMENT POUR LE PREMIER CHARGEMENT DE LA PAGE D'ACCUEIL */
/* ✅ NOUVEAU : Menu caché SEULEMENT pendant le premier chargement */
body.home-page-loading #main-nav {
    transform: translateY(-100px) !important; /* Menu caché pour animation d'entrée */
    visibility: hidden !important;
    opacity: 0 !important;
    transition: none !important; /* Désactiver les transitions CSS pendant l'animation GSAP */
}



/* ✅ NOUVEAU : Menu toujours visible lors des navigations */
body.home-page-loaded #main-nav {
    transform: translateY(0) !important; /* Toujours visible */
    visibility: visible !important;
    opacity: 1 !important;
}

/* 📱 COMPORTEMENT AU SCROLL (toutes les pages) */
.nav-scrolled #main-nav {
    height: 74px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    transition: height 600ms ease-in-out;
}

/* Espacement réduit entre liens et logo en mode scroll */
.nav-scrolled #main-nav .flex.items-center.justify-between {
    gap: 0 !important; /* Pas d'espacement sur mobile en mode scroll */
    max-width: 300px !important; /* Conteneur plus petit sur mobile */
    padding-left: 0.5rem !important; /* px-1 */
    padding-right: 0.5rem !important; /* px-1 */
}

@media (min-width: 640px) {
    .nav-scrolled #main-nav .flex.items-center.justify-between {
        gap: 0.25rem !important; /* SM - petit espacement */
        max-width: 450px !important; /* SM - un peu plus large */
    }
}

@media (min-width: 768px) {
    .nav-scrolled #main-nav .flex.items-center.justify-between {
        gap: 0.5rem !important; /* MD - plus d'espacement */
        max-width: 600px !important;
    }
}

@media (min-width: 1024px) {
    .nav-scrolled #main-nav .flex.items-center.justify-between {
        gap: 0.5rem !important; /* LG+ */
        max-width: 700px !important;
    }
}


/* Styles par défaut pour les liens - RESPONSIVE */
.nav-links-wrapper a,
.nav-links-wrapper2 a {
    font-size:0.875rem; /* 14px - mobile */
    transition: font-size 600ms ease-in-out;
}

/* Styles pour les liens quand on scroll (état "réduit") */
.nav-scrolled .nav-links-wrapper a,
.nav-scrolled .nav-links-wrapper2 a {
    font-size: 0.6rem; 
}

/* Tailles par défaut du logo SVG */
.logo-svg {
    width: 32px;
    height: 30px;
    transition: width 600ms ease-in-out, height 600ms ease-in-out;
}

/* Au scroll */
.nav-scrolled .logo-svg {
    width: 26px;
    height: 24px;
    transition: width 600ms ease-in-out, height 600ms ease-in-out;
}


/* 📱 MOBILE (moins de 640px) */
@media (max-width: 639px) {
    .nav-scrolled .logo-container {
        height: 60px !important; 
        width: 55px !important;
    }
}

/* 📱 SM - TABLETTE (640px à 767px) */
@media (min-width: 640px) and (max-width: 767px) {
    .logo-svg { 
        width: 36px; 
        height: 34px; 
    }
    
    .nav-scrolled .logo-container {
        height: 70px !important;
    }
    
    .nav-scrolled .logo-svg {
        width: 30px !important; 
        height: 28px !important;
    }
}

/* 🖥️ MD ET PLUS (768px et plus) */
@media (min-width: 768px) {
    .logo-svg {
        width: 55px; 
        height: 52px; 
    }
    
    .nav-scrolled .logo-svg {
        width: 46px; 
        height: 44px; 
    }
}




/* Desktop */
@media (min-width: 1024px) {
    .nav-links-wrapper a,
    .nav-links-wrapper2 a {
        font-size: 1.25rem; /* 20px - lg+ (comme avant) */
    }
    .nav-scrolled .nav-links-wrapper a,
    .nav-scrolled .nav-links-wrapper2 a {
        font-size: 1.125rem; /* text-lg quand on scroll */
    }
}


/* Cible le conteneur du logo lorsque 'nav-scrolled' est sur le corps/élément parent */
.nav-scrolled .logo-container {
    height: 90px;
    transition: height 600ms ease-in-out;
}


.nav-scrolled #main-nav a {
  /*   font-size: 1.125rem; text-lg (18px) au lieu de text-xl (20px) */
    transition: font-size 600ms ease-in-out;
}



/* 🎯 CONTENU PRINCIPAL - Gestion selon le type de chargement */

/* ✅ ÉTAT PAR DÉFAUT : Contenu visible sur toutes les pages */
#mainContent {
    opacity: 1 !important; /* Visible par défaut partout */
    transition: opacity 0.5s ease;
    background-color: #FCF9F5;
}


/* ✅ TEXTES HERO - Logique simple qui marche */
#leftTextDiv, #rightTextDiv {
    opacity: 0;
    transform: translateY(100px);
    transition: all 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.slide-up-fade {
    opacity: 1 !important;
    transform: translateY(0) !important;
}



/* Styles temporaires pour les sections d'ancrage (si communes à toutes les pages) */
#projets, #a-propos, #archives, #contact {
    min-height: 800px;
    padding-top: 100px;
    font-family: sans-serif;
}

/* Icones (si elles sont globales et utilisées dans le menu/footer ou d'autres pages) */
.icon-dots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3px;
    width: 24px;
    height: 24px;
}

.dot {
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
}

.icon-hex {
    width: 24px;
    height: 24px;
    background: white;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.icon-cross {
    position: relative;
    width: 24px;
    height: 24px;
}

.icon-cross::before,
.icon-cross::after {
    content: '';
    position: absolute;
    background: white;
    border-radius: 2px;
}

.icon-cross::before {
    width: 20px;
    height: 4px;
    top: 10px;
    left: 2px;
}

.icon-cross::after {
    width: 4px;
    height: 20px;
    top: 2px;
    left: 10px;
}

/* Styles du footer - positionné normalement, sans animation JS (global) */
#main-footer {
    position: relative;
    bottom: unset;
    left: unset;
    width: auto;
    z-index: auto;
}


/* === ANIMATION MOTS CLÉS DÉFILANTS === */

/* Animation pour les mots clés */
.keywords-scroll {
    will-change: transform; /* Optimisation performance */
}

/* Optimisation des performances pour l'animation */
@media (prefers-reduced-motion: no-preference) {
    .keywords-scroll {
        transition: none; /* Pas de transition CSS, on utilise JS */
    }
}

/* Fallback pour les utilisateurs qui préfèrent moins d'animations */
@media (prefers-reduced-motion: reduce) {
    .keywords-scroll {
        transform: none !important;
        transition: none !important;
    }
}




/* ✨ ANIMATION GLOBALE POUR LES BOUTONS - NETTOYÉ */
/* Animation de remplissage depuis le bas pour tous les boutons avec bordure (SAUF btn-retour) */
.btn-fill-up, 
[class*="border"][class*="rounded-full"]:not(.no-fill):not(.btn-retour):not(#contact-button):not(.rs) {
    position: relative;
    overflow: hidden;
    transition: none; /* Pas d'animation du bouton lui-même */
}

/* Effet de remplissage depuis le bas */
.btn-fill-up::before,
[class*="border"][class*="rounded-full"]:not(.no-fill):not(.btn-retour):not(#contact-button):not(.rs)::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0;
    background-color: #0A1E0E;
    transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    border-radius: inherit;
}

/* Création du texte blanc qui remonte avec le fond */
.btn-fill-up::after,
[class*="border"][class*="rounded-full"]:not(.no-fill):not(.btn-retour):not(#contact-button):not(.rs)::after {
    content: attr(data-text);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, calc(-50% + 20px)); /* Commence 20px plus bas */
    color: #FCF9F5;
    font-weight: inherit;
    font-size: inherit;
    font-family: inherit;
    white-space: nowrap;
    z-index: 2;
    opacity: 0; /* Invisible par défaut */
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

/* Au hover, le fond remonte */
.btn-fill-up:hover::before,
[class*="border"][class*="rounded-full"]:not(.no-fill):not(.btn-retour):not(#contact-button):not(.rs):hover::before {
    height: 100%;
}

/* Au hover, le texte blanc remonte et devient visible */
.btn-fill-up:hover::after,
[class*="border"][class*="rounded-full"]:not(.no-fill):not(.btn-retour):not(#contact-button):not(.rs):hover::after {
    transform: translate(-50%, -50%);
    opacity: 1; /* Devient visible */
}

/* Animation du texte original qui remonte et disparaît */
.btn-fill-up > *,
[class*="border"][class*="rounded-full"]:not(.no-fill):not(.btn-retour):not(#contact-button):not(.rs) > * {
    position: relative;
    z-index: 3;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    color: inherit;
}

/* Le texte original remonte et disparaît au hover */
.btn-fill-up:hover > *,
[class*="border"][class*="rounded-full"]:not(.no-fill):not(.btn-retour):not(#contact-button):not(.rs):hover > * {
    transform: translateY(-20px); /* Remonte de 20px */
    opacity: 0; /* Disparaît */
}

/* Pas de changement de couleur globale du bouton */
.btn-fill-up:hover,
[class*="border"][class*="rounded-full"]:not(.no-fill):not(.btn-retour):not(#contact-button):not(.rs):hover {
    border-color: #0A1E0E;
}

/* Animation spécifique pour les boutons de retour (effet simple sur le contour) */
.btn-retour {
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

.btn-retour:hover {
    border-color: #0A1E0E !important; /* Contour à 100% d'opacité */
}

/* Désactiver l'animation globale pour les boutons retour */
.btn-retour::before,
.btn-retour::after {
    display: none !important;
}

.btn-retour > * {
    transition: none !important;
}

.btn-retour:hover > * {
    transform: none !important;
    opacity: 1 !important;
}

/* Pour désactiver l'animation sur certains boutons si besoin */
.no-fill::before {
    display: none !important;
}




@media (min-width: 640px) {
    .footer-with-margins {
        margin: 1rem; /* m-4 */
    }
}

/* 🎨 ANIMATION BOUTON CONTACT SMOOTH */
#contact-button {
    transition: all 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

#contact-button .button-text {
    transition: all 300ms cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

#contact-button #hover-gif {
    transition: all 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

/* Animation plus fluide pour les changements de taille */
#contact-button:hover {
    transform: scale(1.02); /* Léger zoom au hover */
    transition: all 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}


/* Accordéon */
.accordion-item {
    position: relative;
    z-index: 10;
}

.accordion-header {
    position: relative;
    z-index: 11;
    cursor: pointer;
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    position: relative;
    z-index: 10;
}

.accordion-content.active {
    max-height: 200px; /* Ajustez si le contenu est plus long */
    padding-bottom: 2rem;
}

.accordion-item .vertical-bar {
    transform-origin: center;
    transition: transform 0.4s ease-out;
}

.accordion-item.active .vertical-bar {
    transform: rotate(90deg);
}

/* Bouton toggle */
.toggle-btn {
    position: relative;
    z-index: 12;
    cursor: pointer;
}



/* Animation CSS pure optimisée */
.footer-reveal {
    margin: 0;
    border-radius: 0;
}

@supports (animation-timeline: scroll()) {
    .footer-reveal {
        animation: footer-margins linear;
        animation-timeline: scroll();
        animation-range: 60vh 100vh;
    }
    
    @keyframes footer-margins {
        0% {
            margin: 0;
            border-radius: 0;
        }
        100% {
            margin: 1rem;
            border-radius: 1rem;
        }
    }
}


/* === AJUSTEMENT ESPACEMENT FOOTER MOBILE === */

/* Mobile : remonter le contenu ET le trait blanc */
@media (max-width: 767px) {
    /* Remonter le contenu du bas */
    #main-footer .absolute.bottom-0:last-child {
        padding-bottom: 2rem !important;
    }
    
    /* Remonter le trait blanc */
    #main-footer .absolute.bottom-0 .h-px,
    #main-footer .h-px {
       bottom: 2rem !important; 
    }
}

/* Très petits écrans - encore plus d'espace */
@media (max-width: 480px) {
    /* Remonter encore plus le contenu */
    #main-footer .absolute.bottom-0:last-child {
        padding-bottom: 3rem !important;
    }
    
    /* Remonter encore plus le trait blanc */
    #main-footer .absolute.bottom-0 .h-px,
    #main-footer .h-px {
       bottom: 2rem !important; 
    }
}