/* ========================================
   SEARCH MODULE
   ======================================== */

#search .display {
    display: block;
    position: relative;
}

/* Onglets Rechercher / Poster */
.search-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 15px;
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.search-tab {
    flex: 1;
    text-align: center;
    padding: 12px 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    color: var(--light_font);
    background: #fff;
    border-bottom: 3px solid transparent;
    transition: all .2s ease;
}

.search-tab:active {
    opacity: .6;
}

.search-tab.active {
    color: var(--bleu);
    border-bottom-color: var(--bleu);
    background: var(--light3);
}

.search-tab i {
    margin-right: 6px;
}

/* Panneau formulaire */
.search-panel {
    display: none;
}

.search-panel.active {
    display: block;
}

/* Groupe de champs */
.search-fields {
    display: block;
    background: #fff;
    border-radius: var(--radius);
    padding: 15px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
    margin-bottom: 15px;
}

.search-row {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.search-row:last-child {
    margin-bottom: 0;
}

.search-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.search-field label {
    font-size: 11px;
    color: var(--light_font);
    text-transform: uppercase;
    letter-spacing: .4px;
    font-weight: 600;
}

.search-field input,
.search-field select {
    display: block;
    width: 100%;
    height: 38px;
    padding: 0 10px;
    font-size: 14px;
    color: var(--hard_blue);
    background: var(--body);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    cursor: pointer;
}

.search-field input:focus,
.search-field select:focus {
    border: 2px solid var(--bleu);
    padding: 0 9px;
    background: #fff;
}

.search-field input::placeholder {
    color: var(--grey2);
    font-size: 13px;
}


/* Chips départements */
.search-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 2px;
}

.search-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--bleu);
    background: var(--light3);
    border: 1px solid var(--light2);
    border-radius: 20px;
    cursor: pointer;
    transition: all .15s;
}

.search-chip.selected {
    background: var(--bleu);
    color: #fff;
    border-color: var(--bleu);
}

.search-chip:active {
    transform: scale(.95);
}

/* Toggle urgent */
.search-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.search-toggle-box {
    width: 40px;
    height: 22px;
    background: var(--line);
    border-radius: 12px;
    position: relative;
    transition: background .2s;
}

.search-toggle-box::after {
    content: "";
    display: block;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
    transition: left .2s;
}

.search-toggle.on .search-toggle-box {
    background: var(--rouge);
}

.search-toggle.on .search-toggle-box::after {
    left: 20px;
}

.search-toggle-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--hard_blue);
}

/* Bouton rechercher / poster */
.search-submit {
    display: block;
    width: 100%;
    height: 46px;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    border-radius: var(--radius);
    cursor: pointer;
    text-align: center;
    transition: all .15s;
    position: relative;
}

.search-submit:active {
    top: 2px;
    opacity: .85;
}

.search-submit i {
    margin-right: 8px;
}

.search-submit.btn-search {
    background: linear-gradient(to bottom, var(--bleu), var(--bleu_f));
    box-shadow: 0 2px 6px var(--shadow_bleu);
}

.search-submit.btn-post {
    background: linear-gradient(to bottom, var(--brown), var(--brown3));
    box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}

/* Zone résultats */
.search-results {
    display: block;
    margin-top: 15px;
}

.search-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.search-results-count {
    font-size: 13px;
    color: var(--light_font);
    font-weight: 600;
}

.search-results-count strong {
    color: var(--bleu);
}

/* Note section poster */
.search-note {
    display: block;
    padding: 10px 12px;
    background: var(--light_jaune);
    border: 1px solid var(--jaune);
    border-radius: var(--radius);
    font-size: 12px;
    color: var(--brown5);
    margin-bottom: 12px;
    line-height: 1.5;
}

.search-note i {
    margin-right: 5px;
}

/* Champ motif (textarea léger) */
.search-field textarea {
    display: block;
    width: 100%;
    height: 60px;
    padding: 8px 10px;
    font-size: 14px;
    font-family: inherit;
    color: var(--hard_blue);
    background: var(--body);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    resize: vertical;
}

.search-field textarea:focus {
    border: 2px solid var(--bleu);
    padding: 7px 9px;
    background: #fff;
}

/* Responsive */
@media screen and (max-width: 480px) {
    .search-row {
        flex-direction: column;
        gap: 10px;
    }

    .search-tabs {
        font-size: 13px;
    }

    .search-tab {
        padding: 10px 6px;
        font-size: 13px;
    }
}

