#ai_search_spotlight_overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .65);
    /* Volontairement sous le bouton flottant IA (z-index natif 105, cf. .app-layout-builder-toggle)
       pour ne pas avoir à lutter contre le bundle CSS pour le faire remonter. */
    z-index: 100;
    opacity: 0;
    transition: opacity .25s ease;
}

#ai_search_spotlight_overlay:not(.d-none) {
    opacity: 1;
}

.ai-spotlight-highlight {
    z-index: 1050 !important;
}

/* Certains conteneurs de recherche ne sont pas positionnés par défaut : on force
   position:relative uniquement pour eux (jamais pour le bouton IA, qui doit
   rester en position:fixed pour conserver son positionnement flottant). */
#search_header.ai-spotlight-highlight,
#search_container.ai-spotlight-highlight {
    position: relative;
}

/* Bouton IA en mode "Demander à l'IA" : simple toggle de classe qui force une largeur
   automatique (le JS retire aussi .app-layout-builder-toggle pendant ce mode). */
.ia-btn-auto-width {
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    white-space: nowrap !important;
}

#kt_drawer_chat_toggle_label {
    white-space: nowrap;
    margin-left: 0;
    margin-right: .5rem;
}

/* Icône IA permanente dans la barre de recherche (à côté de la loupe) */
.search-ask-ai,
.search-submit {
    cursor: pointer;
    height: 2.75rem;
    padding: 0 .5rem !important;
    border-radius: 0.475rem;
}

.search-ask-ai:focus-visible,
.search-submit:focus-visible {
    outline: 2px solid var(--bs-color);
    outline-offset: 2px;
}

/* Libellé masqué par défaut, révélé au survol/focus par un "déroulé" en largeur
   (pas de fade : on joue uniquement sur max-width/margin pour l'effet demandé). */
.search-ask-ai .search-btn-label,
.search-submit .search-btn-label {
    display: inline-block;
    max-width: 0;
    margin-left: 0;
    overflow: hidden;
    white-space: nowrap;
    line-height: normal;
    font-size: 1rem;
    transition: max-width .25s ease, margin-left .25s ease;
}

.search-ask-ai:hover .search-btn-label,
.search-ask-ai:focus-visible .search-btn-label {
    max-width: 160px;
    margin-left: .35rem;
}

.search-submit:hover .search-btn-label,
.search-submit:focus-visible .search-btn-label {
    max-width: 120px;
    margin-left: .35rem;
}
