/* ==========================================================================
   GLOBAL / BASE – utilisé partout
   ========================================================================== */

/* Importation d'une police douce et arrondie */
@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;600&display=swap');

/* ===== BASE ===== */
html, body {
    height: 100%;
    margin: 0;
    font-family: 'Quicksand', sans-serif;
    color: #333;
    text-align: center;
    line-height: 1.6;
    background: #f4f4f4;
    background-size: cover;
    display: flex;
    flex-direction: column;
}

/* === Background uniquement sur la page d'accueil === */
body.index {
    height: 100%;
    margin: 0;
    font-family: 'Quicksand', sans-serif;
    color: #333;
    text-align: center;
    line-height: 1.6;
    background: #f4f4f4 url('../images/background.jpg') no-repeat center center fixed;
    background-size: cover;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    padding: 1rem;
}

/* ===== BOUTONS GLOBAUX ===== */
.btn, button {
    background-color: #e7a6a1;
    color: white;
    padding: 0.6rem 1rem;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn:hover, button:hover {
    background-color: #d1847f;
}

/* ===== GRILLE & CARTES (réutilisé sur plusieurs pages) ===== */
.catalogue .grid,
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    justify-items: center;
    padding: 1rem;
}

/* Cartes génériques (catalogue, admin, témoignages…) */
.carte {
    background-color: #fff;
    border-radius: 16px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    width: 250px;
    transition: transform 0.2s ease;
    cursor: pointer;
}

.carte:hover {
    transform: translateY(-5px);
}

.carte img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-bottom: 1px solid #f2e9e8;
}

.carte h3 {
    margin: 0.5rem 0 0.2rem;
}

.carte p {
    margin: 0;
    color: #666;
}

/* Admin cartes – même base, mais comportement spécifique en JS */
.admin-carte {
    cursor: default;
}

/* (probable erreur au départ : .admin-carte btn sans point → pas utilisée) */
.admin-carte btn{
    margin-left: 20px;
    margin-right: 20px;
}

.admin-carte .actions {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 0 1rem;
}

/* ===== FORMULAIRES GLOBAUX ===== */
form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    margin: 1rem auto;
    background: #fff;
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

input, textarea, select {
    padding: 0.8rem;
    border: 1px solid #f2e9e8;
    border-radius: 10px;
    font-size: 1rem;
    background-color: #fffaf8;
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* ===== MESSAGES GLOBAUX ===== */
.error {
    color: #b24c4c;
    text-align: center;
}

.success {
    color: #2e7d32;
    text-align: center;
}

/* ==========================================================================
   HEADER – include commun à toutes les pages
   ========================================================================== */

/* NOTE: il y a deux blocs HEADER dans le CSS original.
   → Les deux sont conservés ici, le second est marqué comme DOUBLON PARTIEL. */

/* ===== HEADER (bloc principal) ===== */
header {
    background-color: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

header::after {
    content: "";
    display: block;
    height: 5px;
    width: 100%;
    background: linear-gradient(90deg, #e7a6a1, #f6c9c6);
    transition: background 0.8s ease;
}

header:hover::after {
    background: linear-gradient(90deg, #f6c9c6, #e7a6a1);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1.5rem;
    flex-wrap: wrap;
}

/* Logo à gauche */
.header-left img {
    height: 70px;
    width: auto;
}

/* Bloc central */
.header-center {
    text-align: center;
    flex: 1;
}

.site-title {
    font-size: 1.8rem;
    color: #e7a6a1;
    margin: 0;
    font-weight: 700;
}

/* Menu de navigation */
.nav-menu {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.5rem;
}

.nav-menu a {
    text-decoration: none;
    color: #444;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-menu a:hover {
    color: #e7a6a1;
}

/* Bouton de don à droite */
.btn-don {
    background-color: #e7a6a1;
    color: white;
    font-weight: bold;
    text-decoration: none;
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

.btn-don:hover {
    background-color: #d1847f;
    transform: scale(1.05);
}

.logo {
    width: 120px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    user-select: none;
}

header h1 {
    font-weight: 600;
    font-size: 1.8rem;
    margin-bottom: 0.3rem;
}

header nav a {
    margin: 0 10px;
    color: #555;
    text-decoration: none;
    transition: color 0.3s ease;
}

header nav a:hover {
    color: #e7a6a1;
}

/* ===== HEADER (bloc du bas – DOUBLON PARTIEL) ===== */
/* DOUBLON: header-container, .logo img, .nav-menu, .nav-menu a, .btn-don
   sont déjà définis plus haut. Ce bloc peut être fusionné à terme. */

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #fff;
    padding: 0.8rem 1.5rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo img {
    height: 60px;
    width: auto;
}

/* Menu de navigation – DOUBLON avec le bloc du haut */
.nav-menu {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-menu a {
    text-decoration: none;
    color: #444;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: #e7a6a1;
}

/* Bouton DON – DOUBLON avec le bloc du haut */
.btn-don {
    background-color: #e7a6a1;
    color: white;
    font-weight: bold;
    text-decoration: none;
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

.btn-don:hover {
    background-color: #d1847f;
    transform: scale(1.05);
}

/* Adaptation mobile */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .header-left, .header-right {
        order: 1;
    }

    .header-center {
        order: 2;
        margin: 0.5rem 0;
    }

    .btn-don {
        margin-top: 0.8rem;
    }

    .site-title {
        font-size: 1.5rem;
    }

    .nav-menu {
        gap: 0.8rem;
    }
}

/* ==========================================================================
   FOOTER – include commun
   ========================================================================== */

footer {
  background-color: #f5f5f5;
  color: #444;
  font-size: 0.9rem;
  position: relative;
  bottom: 0;
  left: 0;
  width: 100%;
  box-shadow: 0 -2px 6px rgba(0,0,0,0.1);
  z-index: 100;
  padding: 0.8rem 2rem;
}

.footer-content {
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.footer-socials {
    margin-left: 20px;
  display: flex;
  gap: 1rem;
}

.social-link {
  color: #e7a6a1;
  font-size: 1.3rem;
  transition: transform 0.2s ease, color 0.2s ease;
}

.social-link:hover {
  color: #d47f7a;
  transform: scale(1.1);
}

/* Ajustement mobile du footer & icônes sociaux */
@media (max-width: 600px) {
    .carte {
        width: 90%;
    }
    form {
        width: 90%;
    }
    footer {
        font-size: 0.8rem;
    }
    .social-link {
        font-size: 1.2rem;
    }
}

/* ==========================================================================
   MODALES GLOBALES (catalogue / admin / témoignages)
   ========================================================================== */

/* MODALE principale (catalogue / fiche chat) */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fff;
    border-radius: 16px;
    padding: 1.5rem;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    position: relative;
    text-align: center;
    animation: fadeIn 0.3s ease;
}

/* Animation générique des modales */
@keyframes fadeIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-content img {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 1rem;
}

.modal-content ul {
    list-style: none;
    padding: 0;
    text-align: left;
}

.modal-content {
    position: relative;
    overflow: hidden;
    padding-top: 2.5rem;
}

.close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 36px;
    font-weight: bold;
    cursor: pointer;
    color: #fff;
    background-color: rgba(231, 166, 161, 0.9); 
    border: 2px solid #fff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.close:hover {
    background-color: #e7a6a1;
    color: #fff;
    transform: scale(1.1);
}

/* === Modale de confirmation (suppression) === */
/* DOUBLON PARTIEL: réutilise .modal et .modal-content avec des ajustements spécifiques
   → ne pas supprimer, mais à fusionner éventuellement avec la section précédente. */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.modal-content {
    background-color: #fff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    text-align: center;
    width: 90vh;
    overflow: hidden;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease;
}

.modal-content h3 {
    color: #e7a6a1;
    margin-bottom: 0.5rem;
}

.modal-content p {
    margin-bottom: 1rem;
    color: #444;
}

.modal-body {
  overflow-y: auto;
  padding-right: 0.5rem;
  flex: 1;
}

.modal-buttons {
    display: flex;
    justify-content: space-around;
    gap: 1rem;
}

.btn-cancel,
.btn-confirm {
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: bold;
}

.btn-cancel {
    background-color: #ccc;
    color: #333;
}

.btn-cancel:hover {
    background-color: #bbb;
}

.btn-confirm {
    background-color: #d9534f;
    color: white;
}

.btn-confirm:hover {
    background-color: #c9302c;
}

/* ==========================================================================
   PAGE CATALOGUE (catalogue.php, catalogue_ajax.php, accueil.php)
   ========================================================================== */

.catalogue h2 {
    text-align: center;
    color: #333;
    margin-top: 1rem;
}

/* Filtres de recherche */
.filtre-form {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 1rem auto 2rem;
    flex-wrap: nowrap;
    max-width: 800px;
}

.filtre-form input, 
.filtre-form select {
    padding: 0.6rem 0.8rem;
    border-radius: 10px;
    border: 1px solid #f2e9e8;
    background-color: #fff;
    min-width: 150px;
    font-size: 0.95rem;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.filtre-form input:focus,
.filtre-form select:focus {
    outline: none;
    border-color: #e7a6a1;
}

/* Responsive filtres */
@media (max-width: 600px) {
    .filtre-form {
        flex-wrap: wrap;
    }
    .filtre-form input, 
    .filtre-form select {
        flex: 1 1 100%;
    }
}

/* ==========================================================================
   PAGE ADMIN (admin.php)
   ========================================================================== */

/* SECTION ADMIN */
.admin-panel {
    text-align: center;
    margin: 1rem auto 2rem;
}

/* Bouton d'ouverture du formulaire d'ajout de chat */
.toggle-btn {
    background-color: #e7a6a1;
    color: white;
    border: none;
    border-radius: 30px;
    padding: 0.8rem 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.toggle-btn:hover {
    background-color: #d1847f;
    transform: scale(1.05);
}

/* Conteneur repliable du formulaire admin */
.form-container {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.5s ease;
}

.form-container.open {
    max-height: 1000px; 
    opacity: 1;
    margin-top: 1rem;
}

.delete-btn {
    display: inline-block;
    margin-top: 0.5rem;
    color: #fff;
    background-color: #d9534f;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.delete-btn:hover {
    background-color: #c9302c;
}

/* Formulaire d'édition dans la modale */
.edit-form label {
  font-weight: 500;
  color: #333;
  margin-top: 0.5rem;
  display: block;
}

.edit-form input[type="text"],
.edit-form input[type="number"],
.edit-form input[type="date"],
.edit-form textarea,
.edit-form input[type="file"] {
  width: 100%;
  padding: 0.6rem;
  border-radius: 8px;
  border: 1px solid #ddd;
  margin-bottom: 0.6rem;
  font-size: 0.95rem;
}

/* Colonnes de la modale d'édition sur grand écran */
.form-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* ==========================================================================
   PAGE TÉMOIGNAGES (temoignages.php)
   ========================================================================== */

.temoignages-page h2 {
    margin-bottom: 1rem;
}

.temoignage-carte {
    background-color: #fff;
    border-radius: 16px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
    padding: 1rem;
    max-width: 350px;
    text-align: center;
}

.temoignage-carte img {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 0.8rem;
}

.temoignage-carte blockquote {
    font-style: italic;
    color: #555;
    margin: 0.5rem 0;
}

.temoignage-carte .auteur {
    font-weight: bold;
    color: #e7a6a1;
    margin-top: 0.3rem;
}

.temoignage-carte .date {
    font-size: 0.9rem;
    color: #999;
}

.temoignage-form {
    margin-top: 2rem;
    max-width: 500px;
}

.temoignage-form input, .temoignage-form textarea {
    text-align: left;
}

/* ==========================================================================
   PAGE CONDITIONS D'ADOPTION (conditions_adoption.php)
   ========================================================================== */

.conditions-page {
    max-width: 800px;
    margin: 0 auto;
    text-align: left;
}

.conditions h3 {
    margin-top: 1.5rem;
    color: #e7a6a1;
}

.conditions ul {
    list-style-type: "🐾 ";
    margin-left: 1.5rem;
}

.conditions li {
    margin: 0.4rem 0;
}

/* Bloc certificat d'engagement + téléchargement PDF */
.certificat-engagement {
    background-color: #f8f8f8;
    border-radius: 12px;
    padding: 1rem;
    margin: 1rem auto;
    max-width: 800px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.certificat-engagement h3 {
    color: #e7a6a1;
    margin-bottom: 1rem;
    font-size: 1.6rem;
}

.certificat-engagement p {
    font-size: 1rem;
    line-height: 1.6;
    color: #444;
    margin-bottom: 1.5rem;
}

.btn-download {
    display: inline-block;
    padding: 0.9rem 2rem;
    background-color: #e7a6a1; /* même rose que les titres */
    color: #fff;
    text-decoration: none;
    border: none;
    border-radius: 6px; /* rectangulaire avec coins légers */
    font-weight: 600;
    font-size: 1rem;
    transition: background-color 0.3s, transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.btn-download:hover {
    background-color: #d47d78; /* teinte plus foncée au survol */
    transform: scale(1.02);
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}

/* ==========================================================================
   PAGE ACCUEIL (index.php)
   ========================================================================== */

.accueil {
    text-align: center;
    padding: 2rem 1rem;
}

/* Présentation */
.presentation {
    max-width: 900px;
    margin: 0 auto 3rem;
    background-color: #ffffff;
    border-radius: 20px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    padding: 2rem;
    opacity: 90%;
}

.presentation h1 {
    color: #e7a6a1;
    font-size: 2rem;
    margin-bottom: 1rem;
}

.presentation p {
    line-height: 1.6;
    margin-bottom: 1rem;
}

/* Catalogue d’accueil (aperçu des chats) */
.accueil-catalogue {
    margin-bottom: 3rem;
}

.accueil-catalogue h2 {
    color: #e7a6a1;
    margin-bottom: 1.5rem;
}

/* Bouton central */
.cta-center {
    text-align: center;
    margin-top: 1.5rem;
}

.cta-center .btn {
    background-color: #e7a6a1;
    color: #fff;
    border-radius: 25px;
    padding: 0.8rem 1.8rem;
    font-weight: bold;
    transition: all 0.3s ease;
}

.cta-center .btn:hover {
    background-color: #d1847f;
}

/* Section soutien */
.soutien {
    background-color: #fff;
    padding: 2rem 1rem;
    border-radius: 20px;
    max-width: 800px;
    margin: 0 auto 2rem;
}

.soutien h2 {
    color: #e7a6a1;
    margin-bottom: 1rem;
}

.soutien p {
    line-height: 1.6;
    margin-bottom: 1rem;
}

/* ===== Modale édition chat : scroll si trop grande ===== */
#editModal .modal-content.modal-edit {
  max-height: 90vh;      
  overflow: hidden; 
  display: flex;
  flex-direction: column;
}

#editModal .modal-body {
  overflow-y: auto;   
  flex: 1;        
}

@media (max-width: 600px) {
  #editModal .modal-content.modal-edit {
    max-height: 92vh;
  }
}