/* ================================
   Koscmos header / search / alerts
   ================================ */

/* ───────── Support panel ───────── */
.support_panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #fff;
    margin-top: -1000px;
    max-height: 0;
    overflow: hidden;
    -webkit-transition: margin-top 0.4s ease-out, max-height 0.4s ease-out;
    transition: margin-top 0.4s ease-out, max-height 0.4s ease-out;
}

.panel-checkbox:checked + .support_panel {
    margin-top: 0;
    max-height: 1000px;
}

/* ───────── Dropdown résultats recherche ───────── */
.tp-search-dropdown{
    position:absolute;
    top:100%;
    left:0;
    right:0;
    background:#3B3B3B;
    color:#e6f0ff;
    border:1px solid rgba(255,255,255,.08);
    box-shadow:0 10px 30px rgba(0,0,0,.35);
    border-radius:10px;
    margin-top:8px;
    z-index:10000;      /* important pour passer au-dessus du header */
    max-height:460px;
    overflow:auto;
}

.tp-search-item {
    display: flex;
    gap: 10px;
    padding: 10px 12px;
    align-items: center;
    cursor: pointer;
    text-decoration: none;
    color: #e6f0ff;
}

.tp-search-item:hover,
.tp-search-item[aria-selected="true"] {
    background: rgba(79, 209, 255, .12);
}

.tp-search-title {
    font-weight: 600;
    line-height: 1.25;
}

.tp-search-meta {
    font-size: .8rem;
    color: #9fb3d1;
}

.tp-search-badge {
    font-size: .7rem;
    padding: .15rem .4rem;
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 999px;
    margin-left: 6px;
    color: #9fb3d1;
}

.tp-search-empty,
.tp-search-error {
    padding: 12px;
    color: #9fb3d1;
}

/* ───────── Bouton loupe (toggle) ───────── */
.search-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 17px;
    color: #ffffff;
    padding: 0;
}

.search-toggle-btn:focus {
    outline: none;
}

/* ───────── Bloc recherche caché par défaut ───────── */
/* Conteneur du champ de recherche (caché par défaut) */
.tp-search-wrapper {
    position: relative;      /* pour le dropdown en position:absolute */
    display: block;
    opacity: 0;
    max-width: 0;
    /* IMPORTANT : pas de overflow hidden sinon le dropdown est coupé */
    overflow: visible;
    pointer-events: none;
    transform: translateX(10px);
    transition: all .25s ease-in-out;
}

/* Quand la recherche est ouverte */
.tp-search-wrapper.is-open {
    opacity: 1;
    max-width: 320px;
    pointer-events: auto;
    transform: translateX(0);
}

/* Mobile : on laisse respirer */
@media (max-width: 991.98px) {
    .tp-search-wrapper.is-open {
        max-width: 100%;
    }
}

/* ───────── Champ de recherche ───────── */
.tp-search-input {
    width: 100%;
    background: #000;
    color: #fff;
    border: 1px solid #444;
    border-radius: 0 !important; /* on casse Bootstrap & le thème */
    padding: 6px 10px;
    font-size: 13px;
    box-shadow: none !important;
}

.tp-search-input::placeholder {
    color: #bbb;
}

.tp-search-input:focus {
    background: #111;
    outline: none;
    border-color: #7fd321;
}

/* --- Corriger la superposition du dropdown de recherche --- */

/* On force la top-bar (social + loupe + compte) au-dessus du menu principal */
.site-header-top-wrapper {
    position: relative;
    z-index: 1200;      /* plus haut que la nav principale */
}

/* On laisse la zone du menu un peu plus bas dans la pile */
.site-header-main-wrapper {
    position: relative;
    z-index: 100;
}

/* Par sécurité, on garde un z-index élevé sur le dropdown lui-même */
.tp-search-dropdown {
    z-index: 1300;      /* dans le contexte de .site-header-top-wrapper */
}

/* ───────── Alerts globales ───────── */
.alerts-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
    padding: 10px;
    pointer-events: none;
}

/* Style commun à toutes les alertes */
.alert {
    pointer-events: auto;
    position: relative;
    margin: 10px auto;
    max-width: 600px;
    padding: 10px 14px;
    border-radius: 5px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    opacity: 0.95;
    transition: opacity 0.5s ease-in-out;
    border: none;
    color: #fff;
}

/* Succès (login, mot de passe, etc.) */
.alert.alert-success {
    background-color: #4caf50;
}

/* Erreur */
.alert.alert-danger {
    background-color: #f44336;
}

/* Warning (page brouillon, etc.) */
.alert.alert-warning {
    background-color: #ff9800;
}

/* Info */
.alert.alert-info {
    background-color: #2196f3;
}

.alert .close-btn {
    position: absolute;
    top: 5px;
    right: 10px;
    font-size: 16px;
    color: #fff;
    cursor: pointer;
    transition: color 0.3s ease;
}

.alert .close-btn:hover {
    color: #000;
}

.alert.fade-out {
    opacity: 0;
    pointer-events: none;
}

/* Global anchor override (héritage de ton ancien header) */
a {
    text-decoration: none;
}
