/**
 * Styles personnalisés pour TBSE
 * Tropical Biodiversity & Social Enterprise
 */

/* Variables CSS TBSE - Cohérence avec la charte graphique */
:root {
    /* Couleurs principales TBSE */
    --primary-green: #4f6229;
    --dark-green: #3e5022;
    --ocean-blue: #01185a;
    --earth-brown: #80817d;
    --light-green: #d7d7d6;
    --transition: all 0.3s ease;

    /* Ajout des variables de marque */
    --tbse-primary: #01185a;
    --tbse-secondary: #4f6229;
    --tbse-tertiary: #80817d;
    --tbse-accent: #d7d7d6;
}

/* Styles généraux */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden !important;
}

html {
    overflow-y: hidden !important; /* html ne scroll JAMAIS */
}

body {
    overflow-y: auto !important; /* Seul body peut scroller */
    position: relative;
}

#mainNavbar,
nav.fixed {
    width: 100% !important;
    max-width: 100% !important;
    left: 0 !important;
    right: 0 !important;
}


body.loading-active {
    overflow: hidden; /* Empêche le scroll pendant les animations de chargement */
}

.min-vh-100 {
    min-height: calc(100vh - 4rem) !important; 
}

.min-vh-75 {
    min-height: calc(75vh - 3rem) !important;
}

/* Fix pour les containers Bootstrap avec Tailwind */
.container,
.container-fluid {
    max-width: 100%;
    padding-left: 15px;
    padding-right: 15px;
}

.row {
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

.section-padding,
.hero-section,
.container-fluid,
.row,
.col,
[class*="col-"] {
    overflow: visible !important;
}

/* Styles body consolidés */
body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: #333;
    scroll-behavior: smooth;
    /* Empêche les débordements qui créent des scrollbars doubles */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
}

/* Navigation personnalisée */
.nav-link-custom {
    color: #374151;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
}

.nav-link-custom:hover {
    color: var(--primary-green);
    text-decoration: none;
}

.nav-link-custom.active {
    color: var(--primary-green);
    background-color: #ecfdf5;
}

.nav-link-mobile {
    color: #374151;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    text-decoration: none;
}

.nav-link-mobile:hover {
    color: var(--primary-green);
    background-color: #ecfdf5;
    text-decoration: none;
}

.nav-link-mobile.active {
    color: var(--primary-green);
    background-color: #ecfdf5;
}

/* Language Dropdown Styles */
#language-dropdown-btn {
    transition: all 0.2s ease;
}

#language-dropdown-btn:hover {
    background-color: #f3f4f6;
    border-color: #d1d5db;
}

#language-dropdown-menu {
    animation: fadeInDown 0.2s ease-out;
    min-width: 8rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

#language-dropdown-menu a {
    transition: all 0.15s ease;
    text-decoration: none;
}

#language-dropdown-menu a:hover {
    background-color: #f9fafb;
    text-decoration: none;
}

.fa-chevron-down {
    transition: transform 0.2s ease;
}

/* Animation for dropdown */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Navbar scroll effect */
.navbar-scrolled {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.navbar-brand {
    transition: var(--transition);
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.nav-link {
    position: relative;
    transition: var(--transition);
    color: #374151 !important;
    font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-green) !important;
}

.nav-link:before {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-green);
    transition: var(--transition);
    transform: translateX(-50%);
}

.nav-link:hover:before,
.nav-link.active:before {
    width: 80%;
}

/* Hero Section */
.hero-section {
    /*background: linear-gradient(135deg, var(--dark-green) 0%, var(--primary-green) 100%);*/
    /*background-image: url('../images/ambato.png');
    background-repeat: no-repeat;
    background-size: cover;*/
    background: linear-gradient(360deg, #042464, #4b632b);
    min-height: 100vh; 
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding-top: 4rem;
}

/* Indicateur de scroll "Découvrir plus" */
.hero-section .position-absolute.bottom-0 {
    bottom: 3rem !important;
    z-index: 10;
}

.animate-bounce {
    animation: bounce 2s infinite;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.1)"/></svg>') repeat;
    animation: float 20s infinite linear;
}

@keyframes float {
    0% {
        transform: translateY(0px) translateX(0px);
    }

    33% {
        transform: translateY(-10px) translateX(5px);
    }

    66% {
        transform: translateY(5px) translateX(-5px);
    }

    100% {
        transform: translateY(0px) translateX(0px);
    }
}

.hero-content {
    position: relative;
    z-index: 2;
}

/* Animation douce pour le titre principal */
.hero-title {
    animation: fadeInUp 1.2s ease-out;
    transform-origin: left center;
}

.hero-title span {
    display: inline-block;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* Sections */
.section-padding {
    padding: 80px 0;
}

/* Section title */
.section-title {
    font-size: 1.4rem;
    font-weight: 500;
    color: #2c5530;
    margin-bottom: 2.2rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-green), var(--ocean-blue));
}

/* Cards */
.card {
    border: none;
    border-radius: 15px;
    overflow: hidden;
    transition: var(--transition);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.card-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, var(--primary-green), var(--ocean-blue));
    color: white;
    font-size: 2rem;
}

/* Boutons */
.btn {
    border-radius: 50px;
    padding: 12px 30px;
    font-weight: 500;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-green), var(--ocean-blue));
    border: none;
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(34, 197, 94, 0.3);
}

.btn-outline-success {
    border: 2px solid var(--primary-green);
    color: var(--primary-green);
}

.btn-outline-success:hover {
    background: var(--primary-green);
    border-color: var(--primary-green);
    transform: translateY(-2px);
}

/* Stats */
.stats-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

.stats-card:hover {
    transform: translateY(-5px);
}

.stats-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-green);
    display: block;
}

/* Timeline */
.timeline {
    position: relative;
    padding: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--primary-green);
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    margin: 2rem 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 20px;
    width: 12px;
    height: 12px;
    background: var(--primary-green);
    border-radius: 50%;
    transform: translateX(-50%);
    z-index: 2;
}

/* Images responsives */
.img-hover {
    transition: var(--transition);
    overflow: hidden;
    border-radius: 15px;
}

.img-hover img {
    transition: var(--transition);
}

.img-hover:hover img {
    transform: scale(1.1);
}

/* Footer */
.social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    text-decoration: none;
}

.social-link:hover {
    background: var(--primary-green);
    color: white !important;
    transform: translateY(-3px);
}

.hover-link {
    transition: var(--transition);
}

.hover-link:hover {
    color: var(--primary-green) !important;
    padding-left: 10px;
}

/* Formulaire */
.form-control {
    border-radius: 10px;
    border: 2px solid #e5e7eb;
    padding: 12px 15px;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

/* Animations personnalisées */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

/* Parallax */
.parallax {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Media queries */
@media (max-width: 768px) {
    .hero-section {
        min-height: 100vh; /* Garder la hauteur complète sur mobile */
        text-align: center;
        padding-top: 2rem;
        padding-bottom: 2rem;
    }

    .hero-title {
        font-size: 2.5rem !important;
        line-height: 1.2;
    }

    .hero-content h1 {
        font-size: 2rem !important;
    }

    .hero-content p {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    .section-padding {
        padding: 60px 0;
    }

    .timeline::before {
        left: 20px;
    }

    .timeline-item::before {
        left: 20px;
    }

    .timeline-content {
        margin-left: 40px;
    }

    /* Icônes plus petites sur tablette */
    .card-icon {
        width: 70px;
        height: 70px;
        font-size: 1.8rem;
    }
}

@media (max-width: 576px) {
    .hero-section {
        min-height: 100vh;
        padding-top: 2rem;
        padding-left: 1rem;
        padding-right: 1rem;
        /* Garder exactement le même background que l'original */
    }

    .hero-content {
        text-align: center;
    }

    .hero-title {
        font-size: 1.8rem !important;
        line-height: 1.2;
        margin-bottom: 1rem;
    }

    .hero-content h1 {
        font-size: 1.6rem !important;
        margin-bottom: 1rem;
    }

    .hero-content p {
        font-size: 0.9rem;
        margin-bottom: 2rem;
        line-height: 1.6;
    }

    /* Boutons adaptés */
    .hero-content .btn {
        padding: 12px 24px;
        font-size: 0.9rem;
        margin: 0.25rem;
    }

    /* Icônes flottantes du hero - mieux organisées */
    .hero-section .position-relative .position-absolute {
        display: none; /* Cacher les icônes flottantes sur mobile pour un design plus propre */
    }

    /* Ou si on veut garder les icônes, les réorganiser */
    .floating-icons {
        position: relative;
        margin-top: 2rem;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 1rem;
    }

    .floating-icons .icon-circle {
        width: 50px;
        height: 50px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.2rem;
        color: white;
        position: static !important;
        transform: none !important;
        animation: none !important;
    }

    /* Indicateur scroll repositionné */
    .hero-section .position-absolute.bottom-0 {
        bottom: 1rem !important;
        left: 50% !important;
        transform: translateX(-50%);
    }

    /* Icônes de services adaptées pour mobile */
    .card-icon {
        width: 60px;
        height: 60px;
        font-size: 1.4rem;
        margin-bottom: 0.75rem;
    }

    .stats-number {
        font-size: 1.8rem;
    }

    /* Container avec plus de padding sur mobile */
    .container-fluid {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    /* Cards plus compactes sur mobile */
    .card {
        margin-bottom: 1.5rem;
        padding: 1.25rem;
        border-radius: 12px;
    }

    .card h5 {
        font-size: 1.05rem;
        line-height: 1.3;
    }

    .card p {
        font-size: 0.85rem;
        line-height: 1.5;
    }

    /* Navigation mobile améliorée */
    .navbar-brand img {
        height: 35px !important;
    }

    /* Amélioration des sections sur mobile */
    .section-padding {
        padding: 40px 0;
    }
}

/* Media query pour très petits écrans */
@media (max-width: 375px) {
    .hero-section {
        padding: 1.5rem 0.75rem 0.75rem 0.75rem;
        min-height: 100vh;
    }

    .hero-title {
        font-size: 1.6rem !important;
        line-height: 1.15;
    }

    .hero-content h1 {
        font-size: 1.4rem !important;
    }

    .hero-content p {
        font-size: 0.85rem;
        line-height: 1.5;
        max-width: 95%;
    }

    .hero-content .btn {
        width: 90%;
        max-width: 260px;
        padding: 12px 20px;
        font-size: 0.9rem;
    }

    .card-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .floating-icons .icon-circle {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .navbar-brand img {
        height: 30px !important;
    }
}

/* Responsive pour tablettes */
@media (max-width: 768px) and (min-width: 577px) {
    /* Icônes flottantes taille intermédiaire pour tablettes */
    .hero-section .position-absolute [class*="fa-"] {
        font-size: 1.5rem !important;
    }

    .hero-section .position-absolute div {
        width: 50px !important;
        height: 50px !important;
        font-size: 1.5rem !important;
    }
}

/* Accessibilité */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Mode sombre (optionnel) */
@media (prefers-color-scheme: dark) {
    .card {
        background-color: #1f2937;
        color: #f9fafb;
    }
}

/* Ensure bullet lists inside service content are visible (override any reset) */
.service-content ul {
    list-style: disc inside;
    margin-left: 0;
    padding-left: 1rem;
    color: inherit;
}

.service-content ul li {
    margin-bottom: 0.35rem;
}

/* Ensure markers are visible and styled */
.service-content ul li {
    display: list-item;
}

.service-content ul li::marker {
    color: var(--primary-green);
    font-size: 1rem;
}

/* === GALERIE PHOTOS === */
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
    height: 300px;
    background: #f8f9fa;
}

.gallery-item:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.gallery-card {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    height: 100%;
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    border-radius: 15px;
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.85) 0%,
        rgba(0, 0, 0, 0.6) 30%,
        rgba(0, 0, 0, 0.3) 60%,
        rgba(0, 0, 0, 0) 100%
    );
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    padding: 30px 25px;
    border-radius: 15px;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-item:hover .gallery-image {
    transform: scale(1.15);
    filter: brightness(0.8) saturate(1.2);
}

.gallery-content {
    text-align: center;
    color: white;
    transform: translateY(40px);
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    width: 100%;
}

.gallery-item:hover .gallery-content {
    transform: translateY(0);
}

.gallery-content h5 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.6);
    line-height: 1.3;
    letter-spacing: 0.5px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.gallery-content i {
    font-size: 2.2rem;
    opacity: 0.9;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.6);
    animation: float 3s ease-in-out infinite;
    background: linear-gradient(45deg, #ffffff, #e0e0e0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@keyframes float {
    0%, 100% { 
        transform: translateY(0px) scale(1); 
    }
    50% { 
        transform: translateY(-8px) scale(1.1); 
    }
}

/* Effet de brillance au survol */
.gallery-item::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transform: rotate(45deg);
    transition: all 0.6s;
    opacity: 0;
    z-index: 1;
}

.gallery-item:hover::before {
    animation: shine 0.8s ease-out;
}

@keyframes shine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
        opacity: 0;
    }
}

/* Modal de la galerie */
#galleryModal .modal-content {
    border: none;
    border-radius: 20px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
}

#galleryModal .modal-header {
    background: linear-gradient(135deg, var(--ocean-blue), var(--primary-green));
    color: white;
    border: none;
    padding: 25px;
    position: relative;
}

#galleryModal .modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1), transparent);
    pointer-events: none;
}

#galleryModal .modal-title {
    font-weight: 700;
    font-size: 1.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

#galleryModal .btn-close {
    filter: invert(1);
    opacity: 0.8;
    transition: all 0.3s ease;
}

#galleryModal .btn-close:hover {
    opacity: 1;
    transform: scale(1.1);
}

#galleryModal .modal-body {
    padding: 0;
    background: #ffffff;
}

#galleryModal .modal-body img {
    width: 100%;
    max-height: 75vh;
    object-fit: contain;
    background: #f8f9fa;
}

#galleryModal .modal-body p {
    padding: 25px;
    margin: 0;
    background: white;
    font-size: 1.1rem;
    line-height: 1.7;
    color: #495057;
    border-top: 1px solid #e9ecef;
    font-weight: 400;
}

/* Responsive pour la galerie */
@media (max-width: 768px) {
    .gallery-item {
        height: 250px;
        border-radius: 12px;
    }
    
    .gallery-item:hover {
        transform: translateY(-6px) scale(1.01);
    }
    
    .gallery-content h5 {
        font-size: 1.2rem;
        margin-bottom: 15px;
    }
    
    .gallery-content i {
        font-size: 1.8rem;
    }
    
    .gallery-overlay {
        padding: 20px;
    }
    
    #galleryModal .modal-body img {
        max-height: 60vh;
    }
    
    #galleryModal .modal-body p {
        padding: 20px;
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .gallery-item {
        height: 220px;
        border-radius: 10px;
    }
    
    .gallery-overlay {
        padding: 15px;
    }
    
    .gallery-content h5 {
        font-size: 1.1rem;
        margin-bottom: 12px;
    }
    
    .gallery-content i {
        font-size: 1.6rem;
    }
    
    #galleryModal .modal-header {
        padding: 20px;
    }
    
    #galleryModal .modal-title {
        font-size: 1.3rem;
    }
}

#galleryModal .modal-body img {
    max-height: 60vh;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Responsive pour la galerie */
@media (max-width: 768px) {
    .gallery-image {
        height: 200px;
    }
    
    .gallery-content h5 {
        font-size: 1rem;
    }
    
    .gallery-content p {
        font-size: 0.85rem;
    }
}