/* Custom CSS pour compléter Tailwind */

/* Animations personnalisées */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Classes d'animation */
.animate-fade-in-up {
    animation: fadeInUp 1s ease-out forwards;
}

.animation-delay-200 {
    animation-delay: 0.2s;
    opacity: 0;
}

.animation-delay-400 {
    animation-delay: 0.4s;
    opacity: 0;
}

.animation-delay-600 {
    animation-delay: 0.6s;
    opacity: 0;
}

/* Sections avec IntersectionObserver */
.section-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    will-change: opacity, transform;
}

.section-animate.visible {
    opacity: 1;
    transform: translateY(0);
    will-change: auto;
}

/* Éléments individuels à animer */
[data-animate] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
    will-change: opacity, transform;
}

[data-animate].visible {
    opacity: 1;
    transform: translateY(0);
    will-change: auto;
}

/* Scroll smooth pour Safari */
@supports not (scroll-behavior: smooth) {
    html {
        scroll-behavior: smooth;
    }
}

/* Amélioration du backdrop blur pour navigateurs qui ne le supportent pas bien */
@supports not (backdrop-filter: blur(10px)) {
    nav {
        background: rgba(254, 252, 247, 0.98) !important;
    }
}

/* Transitions fluides pour les hovers */
* {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Optimisation des performances pour les animations */
/* Réduire les durées pour de meilleures performances */
.animate-fade-in-up {
    animation-duration: 0.8s;
}

/* GPU acceleration pour les transformations */
.section-animate,
[data-animate],
.animate-fade-in-up {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #fff9f1;
}

::-webkit-scrollbar-thumb {
    background: #b0b39b;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #656b4d;
}

/* Focus visible pour l'accessibilité */
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible {
    outline: 2px solid #b0b39b;
    outline-offset: 2px;
}

/* Amélioration des transitions pour les toggles */
input[type="checkbox"].sr-only:checked ~ div {
    transition: all 0.3s ease;
}

/* Animation bounce personnalisée */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0) translateX(-50%);
    }
    40% {
        transform: translateY(-10px) translateX(-50%);
    }
    60% {
        transform: translateY(-5px) translateX(-50%);
    }
}

.animate-bounce {
    animation: bounce 2s infinite;
}

/* Effet de glassmorphism pour certaines cartes */
.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Transitions pour le menu mobile */
#nav-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

#nav-menu.active {
    max-height: 500px;
}

/* Media queries pour améliorer le responsive */
@media (max-width: 768px) {
    .font-serif.text-6xl,
    .font-serif.text-8xl {
        font-size: 3rem;
    }
    
    .font-serif.text-5xl {
        font-size: 2.5rem;
    }
    
    .font-serif.text-4xl {
        font-size: 2rem;
    }
}

/* Amélioration de la lisibilité sur mobile */
@media (max-width: 640px) {
    body {
        font-size: 16px;
    }
    
    .text-sm {
        font-size: 0.875rem;
    }
}

/* Préférences de mouvement réduit */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Amélioration des ombres au hover */
.hover\:shadow-xl:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Animation de chargement pour le formulaire */
button[type="submit"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

button[type="submit"]:disabled::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Amélioration du rendu des polices */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Optimisation pour les images */
img {
    image-rendering: -webkit-optimize-contrast;
}

/* Effet de focus pour les inputs */
input:focus,
textarea:focus,
select:focus {
    box-shadow: 0 0 0 3px rgba(176, 179, 155, 0.1);
}

/* Animation subtile pour les cartes */
@keyframes cardFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.group:hover .group-hover\:animate-float {
    animation: cardFloat 3s ease-in-out infinite;
}

/* Animation slide-in de gauche à droite */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

