/* custom.css */

/*0 color et typo */
:root {
    --bs-primary: #1695A3;
}

/*liens*/
a {
    color: var(--bs-primary);
    text-decoration: underline;
}
/* Pagination */
.pagination .page-link {
    color: var(--bs-primary);
    border-color: #ddd;
}

.pagination .page-item.active .page-link {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    color: #fff;
}

.pagination .page-link:hover {
    color: #fff;
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

/* Boutons */
.btn-primary {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    color: #fff;
}

.btn-primary:hover {
    background-color: darken(var(--bs-primary), 10%);
    border-color: darken(var(--bs-primary), 10%);
    color: var(--bs-primary);
}

.btn-outline-primary {
    color: var(--bs-primary);
    border-color: var(--bs-primary);
    background-color: transparent;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    color: #fff;
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

.btn-outline-primary.disabled,
.btn-outline-primary:disabled {
    color: var(--bs-primary);
    border-color: var(--bs-primary);
    background-color: transparent;
    opacity: 1;
}

.bg-success {
    --bs-bg-opacity: 1;
    background-color: var(--bs-primary) !important;
    padding: 5px;
}

/* Make help icons look clickable */
i.bi-question-circle[data-bs-toggle="popover"] {
    cursor: pointer;              /* shows the pointer hand */
    transition: color 0.2s ease;  /* smooth hover feedback */
}
/* Color change or glow on hover for feedback */
i.bi-question-circle[data-bs-toggle="popover"]:hover {
    color: var(--bs-primary);
}

/* 1. top */

/* 2. Images  */
.card-img, .card-img-top {
    object-fit: cover;   /* Maintient l'aspect de l'image sans la déformer */
    width: 100%;          /* Prend toute la largeur disponible */
    height: 200px;        /* Hauteur fixe pour toutes les images */
    overflow: hidden;     /* Empêche l'image de dépasser */
}

/* Custom styles for cards */
.card {
    display: flex;
    flex-direction: column;
    height: 100%; /* Laisse la carte grandir en hauteur mais de façon contrôlée */
}

.card-body {
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 120px;
} 


.card-text {
    white-space: nowrap; /* Empêche le texte de se couper en plusieurs lignes */
    overflow: hidden;
    text-overflow: ellipsis; /* Ajoute des points de suspension (...) si le texte dépasse */
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Limite le nombre de lignes à 2, à ajuster selon vos besoins */
    -webkit-box-orient: vertical;
}


.photo-item {
    margin-bottom: 30px;
}

/* Effet de survol */
.card:hover {
    transform: scale(1.05);  /* Augmente légèrement la taille */
    box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.1);  /* Ajoute une ombre légère */
}

/* Text decoration and color on hover */
.card a {
    color: inherit;
    text-decoration: none;
}

.card a:hover {
    color: #0056b3;  /* Change la couleur du texte lors du survol */
}

/*legend filters*/
div#legend-filters {
    margin-top: 20px;
}

/*Light box*/
#prevButton, #nextButton {
  background-color: transparent;
  border: none;
  padding: 10px 20px;
  cursor: pointer;
  outline: none;
}

/* Shared disabled style for both modal + carousel navigation */
#prevButton:disabled,
#nextButton:disabled,
[id^="plantPrev"]:disabled,
[id^="plantNext"]:disabled {
  background-color: rgba(0,0,0,0.2);
  color: rgba(255,255,255,0.5);
  cursor: not-allowed;
  opacity: 0.6;
}

#prevButton:not(:disabled):hover,
#nextButton:not(:disabled):hover,
[id^="plantPrev"]:not(:disabled):hover,
[id^="plantNext"]:not(:disabled):hover {
  background-color: rgba(0,0,0,0.7);
}

#prevButton:disabled i,
#nextButton:disabled i,
[id^="plantPrev"]:disabled i,
[id^="plantNext"]:disabled i {
  opacity: 0.4;
}

#lightboxModal .modal-body {
    max-height: 90vh; /* Avoid overflowing the screen */
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
#lightboxImage {
    max-height: 75vh;
    max-width: 100%;
    object-fit: contain;
}


.bottom-caption {
    bottom: 0;
    top: auto;
    width: 100%;
    padding: 0;
    right: 0;
    left: 0;
    position: relative;
}

.carousel-indicators {
    bottom: 5rem !important;
}

#prevButton, #nextButton {
    background-color: rgba(0,0,0,0.5); /* semi-transparent dark background */
    border-radius: 50%;
    color: white;
    border: none;
    padding: 10px;
  }
#prevButton:hover, #nextButton:hover {
    background-color: rgba(0,0,0,0.7);
}


/* 3.  Bannière */

#banner {
    position: relative;
    height: calc(100vh - 56px)!important;  /* Hauteur de la bannière à 100% de la fenêtre */
    overflow: hidden;  /* Masque le contenu excédentaire */
}

#banner .carousel-item img {
    object-fit: cover;
    width: 100%;
    height: 100%;
}

@media (max-width: 768px) {
    #banner .carousel-item img {
        height: 100%; /* Changed from 'auto' to '100%' in order to fill the smartphone home banner. */
    }
}

/* Texte centré dans la bannière */
#banner-title {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);  /* Centrage horizontal et vertical */
    color: white;
}

#banner-title h1 {
    font-size: 8rem;
    font-weight: bold;
}

@media (max-width: 768px) {
    #banner-title h1 {
        font-size: 6rem;
    }
}

@media (max-width: 480px) {
    #banner-title h1 {
        font-size: 5rem;
    }
}

/* Needed in order not to have a blanck space in the smartphone home banner. */
#carouselBanner,
.carousel-inner,
.carousel-item {
    height: 100%;
}



#banner-title h2 {
    font-size: 2.5rem;
    font-weight: normal;
}

/* Flèche incitant au scroll */
.scroll-down-arrow {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10; /* S'assure que la flèche reste au-dessus de l'image */
}

/* Icone de flèche */
.scroll-down-arrow i {
    font-size: 3rem; /* Taille plus grande pour la flèche */
    cursor: pointer;
    animation: bounce 1s infinite;
}

/* Animation pour la flèche */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* 4. Fiches */
/* bare laterale */
.fiche {
    margin-bottom: 20px;
    padding: 10px;
}

.fiche h6 {
    background-color: #f0f8ff;  
    padding: 10px;               
    border-radius: 5px;          
    color: #1695A3;             
    font-weight: bold; 
    text-transform: uppercase;
    display: flex;               
    align-items: center;         
    justify-content: center; 
}
/* Carte */
    #map {
        height: 600px;
        width: 100%;
    }

    .leaflet-control-slider {
        background-color: rgba(255, 255, 255, 0.8);
        padding: 10px;
        border-radius: 5px;
        font-size: 14px;
    }

    #year-slider {
        width: 100%;
    }

.info.legend.leaflet-control {
    padding: 5px;
    background: #fff;
}
.info.legend i {
        width: 15px;
        height: 10px;
        margin-right: 5px;
        display: inline-block;
    }

/* 5. Footer */

.footer {
    padding: 20px;
    background: #1695A3;
    color: #fff; 
}

.footer a {
    color: #fff !important; 
}

.footer a:hover {
    color: #ddd; 
}

/* 6. scroll to top */
#scrollToTopBtn {
    position: fixed;
    bottom: 80px;
    right: 40px;
    display: none;
    z-index: 1000;
}

/* 7. Forms */
.form-label {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--bs-primary);
    text-align: center;   /* fine to keep */
    display: inline-block; /* instead of block */
    width: 100%;          /* ensures it stretches across its column */
}

/* 8. Autocomplete */
.autocomplete-wrapper {
    position: relative; /* Make UL position absolute relative to this wrapper */
}

.autocomplete-list {
    position: absolute;
    top: 100%;        /* Right below the input */
    left: 0;
    width: 100%;      /* Match input width */
    z-index: 1000;    /* Ensure it appears above other elements */
    max-height: 200px; /* Optional: scroll if too many items */
    overflow-y: auto;
}

/* 9. Comparison criteria table */

/* Sticky header row */
.table thead th {
    position: sticky;
    top: 0;
    vertical-align: middle; /* centers text vertically */
    background-color: #212529; /* table-dark bg */
    color: #fff;
    z-index: 10;
  }

  /* Rounded inside sticky */
  .table thead th:first-child {
    border-top-left-radius: 0.5rem; /* matches .rounded */
  }
  
  .table thead th:last-child {
    border-top-right-radius: 0.5rem;
  }

  .border-start-black {
    border-left: 1px solid black !important;
}