/* GLOBAL */
* {
    box-sizing: border-box;
    max-width: 100%;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: "Trebuchet MS", sans-serif;
    background: #fff8e6;
    overflow-x: hidden;
    touch-action: manipulation;
}

header {
    background: linear-gradient(to right, #ffcc00, #ff5733);
    padding: 25px 15px;
    text-align: center;
    color: white;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* ---- LOGO + TITRE (inchangés visuellement) ---- */
.header-title {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

.header-logo {
    height: 48px;
    width: auto;
}

/* TITRES */
header h1 {
    margin: 0;
    font-size: 2em;
}

header p {
    margin-top: 6px;
    font-size: 1.1em;
}

/* --- BARRE DE RECHERCHE --- */

/* container centré : garde l'apparence d'origine */
.search-container {
    text-align: center;
    padding: 20px;
}

/* ligne contenant barre + bouton : centre horizontalement l'ensemble */
.search-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 820px; /* limite globale pour centrer proprement */
    margin: 0 auto;
}

/* Bloc barre + croix (relative pour suggestions) */
.search-bar {
    position: relative;
    width: 80%;
    max-width: 420px; /* si besoin adapte, gère responsive */
}

/* Champ de recherche (conserve ton style) */
#searchInput {
    width: 100%;
    padding: 12px 38px 12px 12px;
    font-size: 1.1em;
    border: 2px solid #ff9800;
    border-radius: 8px;
    box-sizing: border-box;
}

#searchInput:focus {
    border-color: #ff5733;
}

/* Croix dans la barre */
.clear-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    cursor: pointer;
    color: #777;
    user-select: none;
    display: none;
}

#searchInput:not(:placeholder-shown) + .clear-btn {
    display: block;
}

/* bouton CHÈCHÉ : garde EXACT les couleurs et styles précédents */
.search-buttons { display:inline-block; margin-left:8px; vertical-align: middle; }
.search-btn {
    padding: 10px 14px;
    border-radius: 8px;
    background: #ff9800;
    color: white;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

/* Montré tout (sous la ligne) */
.showall-btn {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    background: #ffbd4a;
    border: none;
    cursor: pointer;
    color: #333;
}

/* SUGGESTIONS : POSITION RELATIVE À .search-bar */
.suggestions {
    position: absolute;
    top: calc(100% + 8px); /* juste sous l'input */
    left: 0;                /* alignée à gauche de la search-bar */
    width: 100%;            /* même largeur que la search-bar */
    background: #fff8e1;
    border: 1px solid #e0c068;
    border-radius: 6px;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    opacity: 0;
    pointer-events: none;
    transition: opacity .20s ease, transform .18s ease;
    transform: translateY(-4px);
    z-index: 300;
}

/* class .show ajoutée par JS pour afficher */
.suggestions.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.suggestion-item {
    padding: 10px;
    cursor: pointer;
}

.suggestion-item:hover,
.suggestion-item.selected {
    background: #ffe39b;
}

/* RESULTS */
#results {
    padding: 20px;
    max-width: 800px;
    margin: auto;
}

.card {
    background: #fff8e1;
    border-radius: 6px;
    padding: 14px;
    margin-bottom: 12px;
    border: 1px solid #e0c068;
    cursor: pointer;
}

.card:hover {
    background: #fff2b8;
}

/* Pagination */
.pagination-btn {
    margin: 0 4px;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid rgba(0,0,0,0.1);
    background: white;
    cursor: pointer;
}

.pagination-btn.active {
    background: #ffcc66;
    border-color: #ffb84d;
    font-weight: bold;
}

/* Boutons Anwo / Anba */
.back-top-btn,
.back-bottom-btn {
    position: fixed;
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 13px;
    font-weight: bold;
    z-index: 999;
    border: none;
    color: white;
    cursor: pointer;
    box-shadow: 0 3px 6px rgba(0,0,0,0.25);
}

.back-top-btn {
    background: #ff9800;
    bottom: 18px;
    right: 18px;
}

.back-bottom-btn {
    background: #009688;
    top: 18px;
    right: 18px;
}

/* MOBILE */
@media (max-width: 600px) {
    .search-row {
        gap: 6px;
    }

    .search-bar {
        width: 75%;
        max-width: 320px;
    }

    #searchInput {
        font-size: 1em;
        padding: 10px 36px 10px 10px;
    }

    .clear-btn {
        font-size: 16px;
        right: 10px;
    }

    .back-top-btn,
    .back-bottom-btn {
        width: 42px;
        height: 42px;
        font-size: 12px;
        right: 10px;
    }

    .back-top-btn {
        bottom: 12px;
    }

    .back-bottom-btn {
        top: 12px;
    }
}

/* FOOTER */
footer {
    text-align: center;
    padding: 15px;
    background: #ffcc00;
    color: #333;
    margin-top: 40px;
}

/* SURBRILLANCE — visible et jolie */
.highlight {
  background-color: #ffe066;   /* jaune doux */
  padding: 0 4px;             /* petit coussinet autour */
  border-radius: 3px;
  color: inherit;             /* conserve la couleur du texte */
  font-weight: 600;
}