:root {
    --primary: #1F3A8A;
    --primary-dark: #142766;
    --accent: #F39C12;
    --text-muted: #5b6b7a;
    --surface: #ffffff;
    --surface-soft: #f6f9ff;
    --surface-alt: #edf2fb;
}

body {
    font-family: 'Open Sans', sans-serif;
    background-color: var(--surface-soft);
    color: #1f2933;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem; /* Utilisation du padding seulement pour les conteneurs internes */
}

h1, h2, h3, h4 {
    font-family: 'Montserrat', sans-serif;
    color: var(--primary); /* Bleu Primaire */
}

.section-padding {
    padding: clamp(4.5rem, 7vw, 7rem) 0;
}

.section-heading {
    font-size: clamp(2.25rem, 3vw, 3.25rem);
    font-weight: 800;
    text-align: center;
    color: var(--primary);
}

.section-subtitle {
    margin: clamp(1rem, 1.2vw, 2rem) auto 0;
    color: var(--text-muted);
    text-align: center;
    max-width: 48rem;
    line-height: 1.7;
}

.section-title {
    color: var(--primary);
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 9999px;
    font-weight: 700;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--accent); /* Jaune Secondaire */
    transform: translateY(-2px);
}

.card {
    background-color: var(--surface);
    border-radius: 1.5rem;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.stat-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.stat-card {
    background: linear-gradient(135deg, rgba(31,58,138,0.08), rgba(243,156,18,0.08));
    border-radius: 1.25rem;
    padding: 1.75rem;
    text-align: center;
    border: 1px solid rgba(31,58,138,0.08);
}

.stat-value {
    font-size: clamp(2.5rem, 4vw, 3.5rem);
    font-weight: 800;
    color: var(--primary);
}

.stat-label {
    margin-top: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.icon-large {
    color: var(--accent); /* Jaune Secondaire */
    font-size: 3rem;
}

.program-feature-card {
    background-color: var(--surface);
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    border: 2px solid #E5E7EB;
}

.partner-logo {
    height: 40px;
    filter: grayscale(100%);
    opacity: 0.6;
    transition: opacity 0.3s;
}

.partner-logo:hover {
    filter: grayscale(0%);
    opacity: 1;
}

.program-card {
    background-color: #ffffff;
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: border-color 0.3s;
    border: 1px solid transparent;
}

.program-card:hover {
    border-color: #1F3A8A;
}

/* Masquer/afficher les pages avec animation */
.page-content {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.page-content.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
    animation: fadeIn 0.6s ease-out forwards;
}

/* Animation pour les pins de la carte */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

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

/* Styles pour la section Hero avec image de fond */
.hero-section {
    position: relative;
}

.hero-section .section-heading {
    color: white !important;
}

.hero-section .section-subtitle {
    color: rgba(255, 255, 255, 0.95) !important;
}

/* ===== ANIMATIONS ET TRANSITIONS ===== */

/* Animation fade-in */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animation slide-up */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animation scale-in */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Animation pulse pour les boutons */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Classes d'animation */
.fade-in {
    animation: fadeIn 0.8s ease-out forwards;
    opacity: 0;
}

.slide-up {
    animation: slideUp 0.8s ease-out forwards;
    opacity: 0;
}

.scale-in {
    animation: scaleIn 0.6s ease-out forwards;
    opacity: 0;
}

/* Animation au scroll */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Délais d'animation pour effet cascade */
.animate-delay-100 {
    animation-delay: 0.1s;
}

.animate-delay-200 {
    animation-delay: 0.2s;
}

.animate-delay-300 {
    animation-delay: 0.3s;
}

.animate-delay-400 {
    animation-delay: 0.4s;
}

.animate-delay-500 {
    animation-delay: 0.5s;
}

/* Amélioration des transitions des cartes */
.card {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.4s ease;
}

.card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Animation pour les stat-cards */
.stat-card {
    transition: transform 0.4s ease, 
                box-shadow 0.4s ease,
                background 0.4s ease;
}

.stat-card:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 10px 30px rgba(31, 58, 138, 0.2);
}

/* Animation pour les program-feature-card */
.program-feature-card {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.4s ease;
}

.program-feature-card:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
    border-color: var(--primary);
}

/* Animation pour les program-card */
.program-card {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.4s ease,
                background-color 0.4s ease;
}

.program-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(31, 58, 138, 0.15);
    border-color: #1F3A8A;
    background-color: #f8f9ff;
}

/* Amélioration des boutons */
.btn-primary {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 25px rgba(31, 58, 138, 0.3);
}

.btn-primary:active {
    transform: translateY(-1px) scale(1.02);
}

/* Animation pour les images */
img {
    transition: transform 0.4s ease, opacity 0.4s ease;
}

img:hover {
    transform: scale(1.05);
}

/* Animation pour la section hero */
.hero-section .section-heading {
    animation: fadeIn 1s ease-out 0.2s forwards;
    opacity: 0;
}

.hero-section .section-subtitle {
    animation: fadeIn 1s ease-out 0.4s forwards;
    opacity: 0;
}

.hero-section .btn-primary {
    animation: fadeIn 1s ease-out 0.6s forwards;
    opacity: 0;
}

/* Animation pour les icônes */
i {
    transition: transform 0.3s ease, color 0.3s ease;
}

.card:hover i,
.program-card:hover i {
    transform: scale(1.2) rotate(5deg);
    color: var(--accent);
}

/* Animation pour les départements */
.p-4.bg-gray-50 {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.p-4.bg-gray-50:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    background-color: #ffffff;
}

/* Animation pour le header */
header {
    transition: box-shadow 0.3s ease, background-color 0.3s ease;
}

/* Animation smooth pour les liens de navigation */
nav a {
    position: relative;
    transition: color 0.3s ease;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent);
    transition: width 0.3s ease;
}

nav a:hover::after {
    width: 100%;
}

/* Animation pour les sections - désactivée pour éviter les conflits */
/* section {
    animation: fadeIn 0.8s ease-out forwards;
} */

/* Animation pour la vidéo */
.aspect-video {
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.aspect-video:hover {
    transform: scale(1.02);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

/* Animation pour les images - effet parallaxe désactivé pour mobile */
@media (min-width: 768px) {
    .hero-section {
        background-attachment: fixed;
    }
}

/* Animation pour la carte de certification */
.absolute.bg-white {
    animation: slideUp 0.8s ease-out 0.8s forwards;
    opacity: 0;
}

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

/* Animation pour les titres de section - effet de soulignement au hover */
.text-center h2.section-heading,
.text-center h3.section-title {
    position: relative;
}

.text-center h2.section-heading::after,
.text-center h3.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: transform 0.6s ease;
    border-radius: 2px;
}

.text-center h2.section-heading:hover::after,
.text-center h3.section-title:hover::after {
    transform: translateX(-50%) scaleX(1);
}

/* ===== RESPONSIVE MOBILE OPTIMIZATIONS ===== */

/* Amélioration des conteneurs pour mobile */
@media (max-width: 640px) {
    .container {
        padding: 0 1rem;
    }
    
    .section-padding {
        padding: clamp(2rem, 5vw, 3rem) 0;
    }
}

/* Correction des éléments avec position absolute pour mobile */
@media (max-width: 768px) {
    /* Carte de certification dans la section À propos */
    .about-right .absolute {
        position: relative !important;
        bottom: auto !important;
        right: auto !important;
        margin-top: 1rem;
        max-width: 100% !important;
    }
    
    /* Désactiver background-attachment: fixed sur mobile pour de meilleures performances */
    .hero-section,
    [style*="background-attachment: fixed"] {
        background-attachment: scroll !important;
    }
}

/* Amélioration des grilles pour très petits écrans */
@media (max-width: 480px) {
    .grid {
        gap: 1rem;
    }
    
    /* Statistiques - 2 colonnes sur très petits écrans */
    #impact-section .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    /* Départements - 2 colonnes */
    #departements-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem;
    }
}

/* Amélioration des tailles de texte pour mobile */
@media (max-width: 640px) {
    h1, h2, h3, h4 {
        word-wrap: break-word;
        hyphens: auto;
    }
    
    /* Éviter le débordement horizontal */
    body {
        overflow-x: hidden;
        width: 100%;
    }
    
    /* Images responsives */
    img {
        max-width: 100%;
        height: auto;
    }
}

/* Amélioration des espacements pour mobile */
@media (max-width: 768px) {
    /* Réduire les marges et paddings excessifs */
    .mb-12, .mb-16, .mb-20 {
        margin-bottom: 1.5rem !important;
    }
    
    .mt-12, .mt-16, .mt-20, .mt-24, .mt-32 {
        margin-top: 1.5rem !important;
    }
    
    .py-12, .py-16, .py-20 {
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
    }
}

/* Amélioration du menu mobile */
@media (max-width: 767px) {
    #mobile-menu {
        animation: slideDown 0.3s ease-out;
    }
    
    #mobile-menu.hidden {
        display: none;
    }
}

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

/* Amélioration des cartes et boutons pour mobile */
@media (max-width: 640px) {
    .card,
    .program-feature-card,
    .program-card {
        padding: 1rem;
    }
    
    .btn-primary {
        padding: 0.625rem 1.5rem;
        font-size: 0.875rem;
    }
}

/* Correction des iframes pour mobile */
@media (max-width: 768px) {
    iframe {
        max-width: 100%;
    }
}

/* Amélioration de la lisibilité sur mobile */
@media (max-width: 640px) {
    /* Augmenter la taille de police minimale pour la lisibilité */
    body {
        font-size: 14px;
    }
    
    /* Améliorer l'espacement des lignes */
    p {
        line-height: 1.6;
    }
}

/* Correction des éléments qui débordent sur mobile */
@media (max-width: 768px) {
    /* Empêcher le débordement horizontal */
    * {
        max-width: 100%;
    }
    
    /* Correction spécifique pour les éléments avec largeur fixe */
    .max-w-sm,
    .max-w-xs {
        max-width: 100% !important;
    }
}

/* Amélioration de la section hero sur mobile */
@media (max-width: 640px) {
    .hero-section {
        min-height: 50vh !important;
        padding: 2rem 0 !important;
    }
    
    .hero-section .section-heading {
        font-size: 1.25rem !important;
        line-height: 1.4 !important;
    }
    
    .hero-section .section-subtitle {
        font-size: 0.875rem !important;
        margin-top: 1rem !important;
    }
}

/* Optimisation des images pour mobile */
@media (max-width: 768px) {
    img {
        height: auto;
        object-fit: cover;
    }
    
    /* Désactiver les effets de zoom sur mobile pour de meilleures performances */
    img:hover {
        transform: none !important;
    }
}
