/**
 * Styles pour la recherche unifiée RSPA - Version compacte
 */

/* ===== IMPORT GOOGLE FONTS ===== */
@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;500;600&display=swap');

/* ===== LAYOUT PRINCIPAL ===== */
.bd-rspa-main-container { display: flex; flex-direction: row; width: 100%; gap: 20px; align-items: flex-start; }
.bd-rspa-main-container.bd-rspa-with-search .bd-rspa-unified-search { width: 320px; flex-shrink: 0; order: 1; }
.bd-rspa-main-container.bd-rspa-with-search .bd-rspa-content-area { flex: 1; min-width: 0; order: 2; }

/* ===== FORMULAIRE RECHERCHE ===== */
.bd-rspa-unified-search { background-color: #f8f9fa; border: 1px solid #e9ecef; border-radius: 8px; padding: 16px; margin-bottom: 16px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.bd-rspa-search-header { margin-bottom: 16px; text-align: center; }
.bd-rspa-search-header h3 { margin: 0 0 6px; font-size: 14px !important; color: #212529; font-weight: 600; }
.bd-rspa-search-description { margin: 0; font-size: 13px; color: #6c757d; line-height: 1.4; }

/* ===== BARRE DE RECHERCHE ===== */
.bd-rspa-search-input-group { position: relative; margin-bottom: 20px; display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
.bd-rspa-unified-search-input { width: 100%; padding: 12px 16px; border: 2px solid #7A2B1F; font-size: 14px !important; background-color: white; transition: all 0.3s ease; border-radius: 6px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.bd-rspa-unified-search-input:focus { outline: none; font-size: 14px !important; border-color: #451008; box-shadow: 0 0 0 3px rgba(122, 43, 31, 0.15); }
.bd-rspa-unified-search-input::placeholder { color: #adb5bd; font-size: 14px !important; font-style: italic; font-size: 13px; }

.bd-rspa-search-button { background-color: #7A2B1F; color: white; border: 2px solid #7A2B1F; font-size: 14px !important; padding: 12px 16px; cursor: pointer; transition: all 0.3s ease; display: flex; align-items: center; justify-content: center; font-weight: 500; border-radius: 6px; font-size: 14px !important; width: 100%; font-family: 'Quicksand', sans-serif; }
.bd-rspa-search-button:hover { background-color: #451008; border-color: #451008; }

/* ===== BOUTON RÉINITIALISER ===== */
.bd-rspa-reset-button { background-color: #7A2B1F; color: white; border: 2px solid #7A2B1F; padding: 8px 16px; cursor: pointer; transition: all 0.3s ease; display: inline-flex; align-items: center; justify-content: center; font-weight: 500; border-radius: 6px; font-size: 14px !important; font-family: 'Quicksand', sans-serif; margin-top: 10px; }
.bd-rspa-reset-button:hover { background-color: #451008; border-color: #451008; }

/* ===== OPTIONS ===== */
.bd-rspa-search-options { margin-bottom: 16px; }
.bd-rspa-search-options h4 { margin: 0 0 12px; font-size: 15px; color: #495057; font-weight: 600; border-bottom: 2px solid #7A2B1F; padding-bottom: 6px; }
.bd-rspa-search-options-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; margin-bottom: 16px; }

.bd-rspa-options-group { background-color: white; border: 1px solid #dee2e6; border-radius: 6px; padding: 12px; transition: all 0.3s ease; }
.bd-rspa-options-group:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.bd-rspa-options-group h5 { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: #212529; padding-bottom: 6px; border-bottom: 1px solid #e9ecef; }

.bd-rspa-option-label { display: flex; align-items: center; margin-bottom: 8px; cursor: pointer; padding: 6px; border-radius: 4px; transition: background-color 0.2s ease; user-select: none; }
.bd-rspa-option-label:hover { background-color: #f8f9fa; }
.bd-rspa-option-label:last-child { margin-bottom: 0; }
.bd-rspa-option-label input[type="checkbox"] { margin-right: 12px; cursor: pointer; transform: scale(1.2); accent-color: #7A2B1F; }
.bd-rspa-option-text { font-size: 13px; color: #495057; flex: 1; line-height: 1.3; }
.bd-rspa-option-label input[type="checkbox"]:checked + .bd-rspa-option-text { font-weight: 600; color: #5a1f17; }

/* ===== ACTIONS ===== */
.bd-rspa-search-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px; background-color: white; border: 1px solid #dee2e6; border-radius: 6px; margin-bottom: 12px; }
.bd-rspa-select-all, .bd-rspa-select-none, .bd-rspa-select-main { background-color: #7A2B1F; color: white; border: none; padding: 5px 10px; border-radius: 4px; cursor: pointer; font-size: 14px !important; font-weight: 500; transition: all 0.2s ease; font-family: 'Quicksand', sans-serif; }
.bd-rspa-select-all:hover, .bd-rspa-select-none:hover, .bd-rspa-select-main:hover { background-color: #451008; }
.bd-rspa-select-all { background-color: #7A2B1F; }
.bd-rspa-select-all:hover { background-color: #451008; }
.bd-rspa-select-main { background-color: #7A2B1F; }
.bd-rspa-select-main:hover { background-color: #451008; }
.bd-rspa-search-info { margin-left: auto; }
.bd-rspa-search-status { font-size: 13px; color: #6c757d; font-style: italic; }

/* ===== AIDE ===== */
.bd-rspa-search-help { margin-top: 15px; }
.bd-rspa-search-help details { background-color: white; border: 1px solid #dee2e6; border-radius: 6px; overflow: hidden; }
.bd-rspa-search-help summary { background-color: #e9ecef; padding: 12px 15px; cursor: pointer; font-weight: 500; color: #495057; transition: background-color 0.2s ease; user-select: none; }
.bd-rspa-search-help summary:hover { background-color: #dee2e6; }
.bd-rspa-help-content { padding: 15px; }
.bd-rspa-help-content ul { margin: 0; padding-left: 20px; }
.bd-rspa-help-content li { margin-bottom: 8px; font-size: 14px !important; line-height: 1.4; color: #495057; }
.bd-rspa-help-content li:last-child { margin-bottom: 0; }
.bd-rspa-help-content strong { color: #7A2B1F; }

/* ===== RÉSULTATS ===== */
.bd-rspa-search-results-container { width: 100%; }
.bd-rspa-search-results-header { margin-bottom: 20px; display: flex; align-items: center; }
.bd-rspa-clear-search { background-color: #7A2B1F; color: white; border: none; padding: 10px 15px; border-radius: 4px; cursor: pointer; font-size: 14px !important; transition: all 0.3s ease; display: flex; align-items: center; gap: 8px; font-family: 'Quicksand', sans-serif; }
.bd-rspa-clear-search:hover { background-color: #451008; }

.bd-rspa-results-header { margin-bottom: 25px; padding: 20px; background: linear-gradient(135deg, #7A2B1F 0%, #5a1f17 100%); color: white; border-radius: 8px; text-align: center; }
.bd-rspa-results-header h3 { margin: 0 0 8px; font-size: 20px; font-weight: 600; }
.bd-rspa-search-scope { margin: 0; font-size: 14px !important; opacity: 0.9; font-style: italic; }

.bd-rspa-folder-results { margin-bottom: 25px; border: 1px solid #e9ecef; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.bd-rspa-folder-title { background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%); padding: 15px 20px; margin: 0; font-size: 14px !important; font-weight: 600; color: #495057; border-bottom: 1px solid #dee2e6; display: flex; align-items: center; gap: 10px; }
.bd-rspa-folder-icon { font-size: 18px; }
.bd-rspa-result-count { font-weight: normal; color: #6c757d; margin-left: auto; }

/* ===== MESSAGES ===== */
.bd-rspa-no-results { text-align: center; padding: 40px 20px; background-color: white; border: 1px solid #e9ecef; border-radius: 8px; margin: 20px 0; }
.bd-rspa-no-results h3 { color: #495057; margin-bottom: 15px; }
.bd-rspa-search-suggestions { text-align: left; max-width: 400px; margin: 20px auto 0; background-color: #f8f9fa; padding: 20px; border-radius: 6px; }
.bd-rspa-search-suggestions h4 { margin: 0 0 10px; color: #7A2B1F; font-size: 14px !important; }
.bd-rspa-search-suggestions ul { margin: 0; padding-left: 20px; }
.bd-rspa-search-suggestions li { margin-bottom: 8px; font-size: 14px !important; line-height: 1.4; }
.bd-rspa-search-loading { text-align: center; padding: 40px 20px; color: #6c757d; font-size: 14px !important; }
.bd-rspa-search-error { background-color: #f8d7da; color: #721c24; padding: 20px; border-radius: 6px; text-align: center; margin: 20px 0; border: 1px solid #f5c6cb; }

/* ===== BOUTON TÉLÉCHARGER (CORRIGÉ) ===== */
.bd-rspa-download-button { display: inline-block; padding: 8px 16px; background-color: #7A2B1F; color: #fff !important; text-decoration: none; border-radius: 4px; font-size: 14px !important; font-weight: 500; transition: all 0.3s ease; border: 1px solid #7A2B1F; font-family: 'Quicksand', sans-serif; }
.bd-rspa-download-button:hover { background-color: #451008; color: #fff !important; border-color: #451008; text-decoration: none; }

/* ===== ANIMATIONS ===== */
.bd-rspa-main-container.bd-rspa-search-active .bd-rspa-accordion-container { opacity: 0; transform: translateY(-10px); transition: all 0.3s ease; }
.bd-rspa-search-results-container { opacity: 0; transform: translateY(10px); transition: all 0.3s ease; }
.bd-rspa-search-results-container:not([style*="display: none"]) { opacity: 1; transform: translateY(0); }
.bd-rspa-document-item.bd-rspa-search-result { transition: all 0.3s ease; border-left: 3px solid transparent; }
.bd-rspa-document-item.bd-rspa-search-result:hover { border-left-color: #7A2B1F; transform: translateX(5px); }
.bd-rspa-clicked { transform: scale(0.98); opacity: 0.8; }

/* ===== ACCESSIBILITÉ ===== */
.bd-rspa-option-label input[type="checkbox"]:focus, .bd-rspa-search-button:focus, .bd-rspa-clear-search:focus, .bd-rspa-reset-button:focus { outline: 2px solid #7A2B1F; outline-offset: 2px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
    .bd-rspa-main-container, .bd-rspa-main-container.bd-rspa-with-search { flex-direction: column; }
    .bd-rspa-main-container.bd-rspa-with-search .bd-rspa-unified-search { width: 100%; order: 0; }
    .bd-rspa-search-options-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 15px; }
}

@media (max-width: 768px) {
    .bd-rspa-unified-search { padding: 12px; margin-bottom: 12px; }
    .bd-rspa-search-header h3 { font-size: 15px; }
    .bd-rspa-search-description { font-size: 12px; }
    .bd-rspa-unified-search-input { padding: 10px 14px; }
    .bd-rspa-search-button { padding: 10px 14px; }
    .bd-rspa-search-options-grid { grid-template-columns: 1fr; gap: 10px; }
    .bd-rspa-options-group { padding: 10px; }
    .bd-rspa-search-actions { flex-direction: column; align-items: stretch; gap: 8px; }
    .bd-rspa-search-actions button { width: 100%; justify-content: center; }
    .bd-rspa-search-info { margin-left: 0; text-align: center; margin-top: 10px; }
    .bd-rspa-folder-title { padding: 12px 15px; font-size: 15px; flex-direction: column; align-items: flex-start; gap: 5px; }
    .bd-rspa-result-count { margin-left: 0; align-self: flex-end; }
}

@media (max-width: 480px) {
    .bd-rspa-unified-search-input { font-size: 14px !important; } /* Évite zoom iOS */
    .bd-rspa-option-text { font-size: 12px; }
    .bd-rspa-options-group h5 { font-size: 12px; }
}

/* ===== PRINT ===== */
@media print {
    .bd-rspa-unified-search, .bd-rspa-clear-search { display: none; }
    .bd-rspa-search-results-header { background: none !important; color: black !important; border: 1px solid #ccc; }
}
