/* Styles personnalisés pour Gamosgraph Mdg */

/* Variables CSS supplémentaires */
:root {
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-medium: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-large: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Header avec couleur fixe */
#header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(229, 231, 235, 0.8);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

/* Suppression des animations de couleur du header */
/* Cette règle remplace l'ancienne animation */
#header.scrolled {
    /* Pas de changement - même apparence */
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
}

/* Logo optimisé */
.logo-container {
    height: 4rem; /* 64px */
    display: flex;
    align-items: center;
    overflow: hidden; /* Empêche le débordement */
}

.logo-container img {
    height: 100%;
    width: auto;
    object-fit: contain;
    object-position: left center; /* Aligne à gauche et centre verticalement */
    max-height: 60px; /* Limite absolue */
}

/* Correction du décalage pour le contenu principal */
#home {
    padding-top: 5rem; /* 80px - compense la hauteur du header */
}

/* Language selector - Correction du drapeau coupé */
.language-selector {
    position: relative;
}

.language-selector .dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0; /* Aligne à droite pour éviter le débordement */
    min-width: 120px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.language-option {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    gap: 0.5rem;
    transition: background-color 0.2s;
}

.language-option:hover {
    background-color: #f3f4f6;
}

.language-option img {
    width: 20px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
    flex-shrink: 0; /* Empêche la compression */
}

/* Responsive - Header mobile */
@media (max-width: 768px) {
    #header nav .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .logo-container {
        height: 3rem; /* Plus petit sur mobile */
    }
    
    .logo-container img {
        max-height: 48px;
    }
    
    /* Language selector mobile */
    .language-selector .dropdown-menu {
        right: -20px; /* Ajustement pour mobile */
        min-width: 100px;
    }
}



/* Animations personnalisées */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse-soft {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Classes utilitaires */
.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out;
}

.animate-slide-in-left {
    animation: slideInLeft 0.8s ease-out;
}

.animate-pulse-soft {
    animation: pulse-soft 2s infinite;
}

/* Composants personnalisés */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-large);
}

.btn-primary {
    @apply bg-gradient-to-r from-blue-instit to-blue-light text-white px-6 py-3 rounded-lg font-semibold hover:shadow-lg transition-all duration-300 transform hover:scale-105;
}

.btn-secondary {
    @apply bg-gradient-to-r from-green-agri to-green-light text-white px-6 py-3 rounded-lg font-semibold hover:shadow-lg transition-all duration-300 transform hover:scale-105;
}

/* Styles pour les graphiques et visualisations */
.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
}

.map-container {
    position: relative;
    height: 500px;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-medium);
}

/* Styles pour le contenu Madagascar */
.madagascar-pattern {
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23059669' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* Styles pour les statistiques */
.stat-card {
    @apply bg-white p-6 rounded-xl shadow-sm border border-gray-100 hover:shadow-md transition-all duration-300;
}

.stat-number {
    @apply text-3xl font-bold mb-2;
}

.stat-label {
    @apply text-sm text-gray-600;
}

/* Styles pour les témoignages */
.testimonial-card {
    @apply bg-white p-8 rounded-xl shadow-sm border border-gray-100 hover:shadow-md transition-all duration-300;
}

.testimonial-content {
    @apply text-gray-700 italic mb-4 leading-relaxed;
}

.testimonial-author {
    @apply font-semibold text-gray-900;
}

.testimonial-role {
    @apply text-sm text-gray-600;
}

/* Styles responsive améliورés */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .card-hover {
        transform: none;
    }
    
    .card-hover:hover {
        transform: none;
    }
}

/* Styles pour l'accessibilité */
.focus-visible {
    @apply outline-none ring-2 ring-blue-instit ring-offset-2;
}

/* Styles pour le mode sombre (optionnel) */
@media (prefers-color-scheme: dark) {
    .dark-mode-toggle {
        @apply bg-gray-800 text-white;
    }
}

/* Styles pour l'impression */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-only {
        display: block !important;
    }
}

/* Optimisations pour les connexions lentes */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Styles pour les drapeaux */
.flag-icon {
    width: 20px;
    height: 15px;
    background-size: cover;
    border-radius: 2px;
    display: inline-block;
}

.flag-mg {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 3 2'%3E%3Cpath fill='%23fc3d32' d='M0 0h3v2H0z'/%3E%3Cpath fill='%23007e3a' d='M1 0h2v1H1z'/%3E%3Cpath fill='%23fff' d='M0 0h1v2H0z'/%3E%3C/svg%3E");
}

.flag-gb {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 30'%3E%3Crect width='40' height='30' fill='%23012169'/%3E%3Cg stroke='%23FFF'%3E%3Cpath d='m0,0 40,30 m0,-30 L0,30' stroke-width='4'/%3E%3Cpath d='m20,0 v30 m-20,-15 h40' stroke-width='6.67'/%3E%3C/g%3E%3Cg stroke='%23C8102E'%3E%3Cpath d='m0,0 40,30 m0,-30 L0,30' stroke-width='2.67'/%3E%3Cpath d='m20,0 v30 m-20,-15 h40' stroke-width='4'/%3E%3C/g%3E%3C/svg%3E");
}


/* Animation pour le dropdown */
.language-dropdown {
    transition: all 0.2s ease-in-out;
}

.language-dropdown.hidden {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

/* Rotation de la flèche */
.rotate-180 {
    transform: rotate(180deg);
}

/* Responsive pour les sélecteurs de langue */
@media (max-width: 768px) {
    .language-selector {
        display: none;
    }
}

/* Animations personnalisées */
@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fade-in-up 0.7s ease-out forwards;
}

/* Variables CSS pour l'optimisation des animations */
:root {
    --animation-duration: 0.3s;
    --transition-duration: 0.2s;
}

/* États des champs de formulaire */
.field-error {
    animation: shake 0.3s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Bouton hamburger animé */
#mobile-menu-btn span {
    transition: all 0.3s ease;
    transform-origin: center;
}

/* Optimisation pour les animations réduites */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: var(--animation-duration) !important;
        transition-duration: var(--transition-duration) !important;
    }
}

/* Styles pour les notifications */
.notification-enter {
    transform: translateX(100%);
    opacity: 0;
}

.notification-enter-active {
    transform: translateX(0);
    opacity: 1;
    transition: all 0.3s ease;
}

/* Loading states */
.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Section À Propos - Égalisation des hauteurs */
.about-cards-container {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: stretch; /* Étire tous les éléments à la même hauteur */
}

.about-card {
    flex: 1;
    min-width: 300px; /* Largeur minimale pour le responsive */
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.about-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.1);
}

/* Icône en haut */
.about-card-icon {
    width: 4rem;
    height: 4rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    flex-shrink: 0; /* Empêche la compression */
}

/* Titre */
.about-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1rem;
    flex-shrink: 0; /* Empêche la compression */
}

/* Contenu flexible */
.about-card-content {
    flex: 1; /* Prend tout l'espace disponible */
    display: flex;
    flex-direction: column;
}

/* Texte de description */
.about-card p {
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* Liste des valeurs */
.about-card ul {
    flex: 1; /* Prend l'espace restant */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.about-card ul li {
    color: #6b7280;
    margin-bottom: 0.5rem;
    padding-left: 1rem;
    position: relative;
}

.about-card ul li::before {
    content: "•";
    color: #059669;
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .about-cards-container {
        flex-direction: column;
    }
    
    .about-card {
        min-width: 100%;
    }
}

/* Version alternative avec CSS Grid */
.about-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    align-items: stretch; /* Hauteurs égales automatiquement */
}
