/* styleSearch.css */
/**
 * Styles pour le menu de recherche vertical
 * Région Wallonne
 */

/* Conteneur principal du menu de recherche */
#search-menu {
    position: absolute;
    top: 130px;
    left: 5px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #007cad;
    border-radius: 8px;
    padding: 10.5px;
    min-width: 200px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* Titre du menu */
.search-menu-title {
    font-size: 15px;
    font-weight: bold;
    color: #007cad;
    margin: 0 0 8.4px 0;
    padding-bottom: 5.6px;
    border-bottom: 2px solid #007cad;
    text-align: center;
}

/* Options de gestion des highlights */
.search-menu-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
    padding: 8px;
    background: rgba(0, 124, 173, 0.05);
    border-radius: 6px;
    border: 1px solid rgba(0, 124, 173, 0.2);
}

.search-menu-option {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    flex: 1;
    user-select: none;
}

.search-menu-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #007cad;
}

.search-menu-option span {
    font-size: 11px;
    color: #333;
    font-weight: 500;
    line-height: 1.2;
    max-width: 120px;
}

.search-menu-clear-btn {
    width: 32px;
    height: 32px;
    background: rgba(220, 53, 69, 0.1);
    border: 2px solid #dc3545;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.search-menu-clear-btn:hover {
    background: #dc3545;
    transform: scale(1.1);
}

.search-menu-clear-btn:active {
    transform: scale(0.95);
}

.search-menu-clear-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    border-color: #ccc;
}

.search-menu-clear-btn:disabled:hover {
    background: rgba(220, 53, 69, 0.1);
    transform: none;
}

/* Conteneur des boutons */
.search-menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Style des boutons de recherche */
.search-menu-button {
    width: 100%;
    background: rgba(0, 124, 173, 0.05);
    border: 2px solid #007cad;
    border-radius: 6px;
    padding: 8.4px 7px;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    text-align: left;
}

.search-menu-button:hover {
    background: #007cad;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 124, 173, 0.3);
}

.search-menu-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 124, 173, 0.2);
}

.search-menu-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

/* État actif/sélectionné */
.search-menu-button.active {
    background: #007cad;
    color: white;
    border-color: #0056b3;
    box-shadow: 0 2px 8px rgba(0, 124, 173, 0.4);
}

.search-menu-button.active:hover {
    background: #0056b3;
}

.search-menu-button.active .search-button-icon {
    transform: scale(1.1);
}

/* Icône du bouton */
.search-button-icon {
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    transition: transform 0.2s ease;
}

/* Texte du bouton */
.search-button-text {
    flex: 1;
    font-size: 12px;
    line-height: 1.3;
}

/* État désactivé */
.search-menu-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(150, 150, 150, 0.1);
    border-color: #ccc;
    color: #999;
}

.search-menu-button:disabled:hover {
    transform: none;
    box-shadow: none;
    background: rgba(150, 150, 150, 0.1);
    color: #999;
}

/* Animation au chargement */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

#search-menu {
    animation: slideInLeft 0.4s ease-out;
}

/* Responsive - Tablettes */
@media (max-width: 1024px) {
    #search-menu {
        top: 125px;
        min-width: 180px;
    }
    
    .search-menu-title {
        font-size: 14px;
    }
    
    .search-menu-button {
        padding: 7px 5.6px;
        font-size: 12px;
    }
    
    .search-button-icon {
        font-size: 16px;
    }
    
    .search-button-text {
        font-size: 11px;
    }
}

/* Responsive - Mobiles */
@media (max-width: 768px) {
    #search-menu {
        top: 115px;
        left: 5px;
        min-width: 160px;
        padding: 8.4px;
    }
    
    .search-menu-title {
        font-size: 13px;
        margin-bottom: 7px;
        padding-bottom: 4.2px;
    }
    
    .search-menu-buttons {
        gap: 8px;
    }
    
    .search-menu-button {
        padding: 7px 5.6px;
        font-size: 11px;
    }
    
    .search-button-icon {
        font-size: 16px;
        min-width: 18px;
    }
    
    .search-button-text {
        font-size: 10px;
    }
}

/* Très petits écrans */
@media (max-width: 480px) {
    #search-menu {
        min-width: 140px;
        padding: 7px;
    }
    
    .search-menu-title {
        font-size: 12px;
    }
    
    .search-menu-button {
        padding: 5.6px 4.2px;
        gap: 8px;
    }
    
    .search-button-icon {
        font-size: 14px;
        min-width: 16px;
    }
    
    .search-button-text {
        font-size: 9px;
    }
}

/* Accessibilité - Mode contrasté élevé */
@media (prefers-contrast: high) {
    #search-menu {
        border-width: 3px;
    }
    
    .search-menu-button {
        border-width: 3px;
    }
    
    .search-menu-button:hover {
        background: #004d73;
    }
}

/* Accessibilité - Animation réduite */
@media (prefers-reduced-motion: reduce) {
    #search-menu {
        animation: none;
    }
    
    .search-menu-button {
        transition: none;
    }
    
    .search-menu-button:hover {
        transform: none;
    }
    
    #search-panel {
        transition: none !important;
    }
}

/* ===== STYLES POUR LES RECHERCHES EN ÉTAPES ===== */

/* Conteneur d'étape */
.search-step {
    margin-bottom: 15px;
}

.search-step.hidden {
    display: none;
}

/* Titre d'étape */
.search-step-title {
    font-size: 13px;
    font-weight: bold;
    color: #007cad;
    margin: 0 0 10px 0;
    padding-bottom: 5px;
    border-bottom: 1px solid #ddd;
}

/* Bouton petit (ex: "Changer") */
.search-button-small {
    margin-left: 10px;
    padding: 3px 8px;
    background: #007cad;
    color: white;
    border: 1px solid #0056b3;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-button-small:hover {
    background: #0056b3;
    transform: scale(1.05);
}

.search-button-small:active {
    transform: scale(0.98);
}

/* Info de sélection (ex: commune sélectionnée) */
#selected-commune-info {
    padding: 8px;
    background: rgba(0, 124, 173, 0.1);
    border-left: 3px solid #007cad;
    border-radius: 4px;
    font-size: 12px;
    color: #333;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ===== PANNEAU DE RECHERCHE COULISSANT ===== */

/* Conteneur principal du panneau */
#search-panel {
    position: absolute;
    top: 130px;
    left: 235px;
    z-index: 999;
    width: 320px;
    max-height: calc(100vh - 150px);
    background: rgba(255, 255, 255, 0.98);
    border: 2px solid #007cad;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform: translateX(0);
    opacity: 1;
}

#search-panel.hidden {
    transform: translateX(-100%);
    opacity: 0;
    pointer-events: none;
}

/* En-tête du panneau */
.search-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10.5px;
    border-bottom: 2px solid #007cad;
    background: rgba(0, 124, 173, 0.08);
    border-radius: 6px 6px 0 0;
}

.search-panel-title {
    font-size: 15px;
    font-weight: bold;
    color: #007cad;
    margin: 0;
}

.search-panel-close {
    width: 28px;
    height: 28px;
    background: transparent;
    border: 2px solid #007cad;
    border-radius: 4px;
    font-size: 20px;
    font-weight: bold;
    color: #007cad;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

.search-panel-close:hover {
    background: #007cad;
    color: white;
    transform: scale(1.1);
}

.search-panel-close:active {
    transform: scale(0.95);
}

/* Contenu du panneau */
.search-panel-content {
    padding: 10.5px;
    overflow-y: auto;
    flex: 1;
}

/* Conteneur de l'input de recherche */
.search-input-container {
    position: relative;
    margin-bottom: 10px;
}

.search-input {
    width: 100%;
    padding: 8.4px 28px 8.4px 8.4px;
    border: 2px solid #007cad;
    border-radius: 6px;
    font-size: 13px;
    color: #333;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: #0056b3;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

.search-input::placeholder {
    color: #999;
    font-style: italic;
}

/* Bouton d'effacement dans l'input */
.search-clear-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    background: #ccc;
    border: none;
    border-radius: 50%;
    font-size: 16px;
    font-weight: bold;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

.search-clear-btn:hover {
    background: #007cad;
    transform: translateY(-50%) scale(1.1);
}

.search-clear-btn.hidden {
    display: none;
}

/* Message d'information */
.search-info {
    padding: 8.4px;
    background: rgba(0, 124, 173, 0.1);
    border-left: 3px solid #007cad;
    border-radius: 4px;
    font-size: 12px;
    color: #555;
    margin-bottom: 10px;
}

.search-info.hidden {
    display: none;
}

.search-info-warning {
    background: rgba(255, 193, 7, 0.1);
    border-left-color: #ffc107;
    color: #856404;
}

/* Conteneur des résultats */
.search-results {
    margin-top: 10px;
}

/* Compteur de résultats */
.search-results-counter {
    font-size: 11px;
    color: #666;
    padding: 5px 8.4px;
    background: rgba(0, 124, 173, 0.05);
    border-radius: 4px;
    margin-bottom: 8px;
    font-weight: 600;
}

/* Liste des résultats */
.search-results-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Item de résultat */
.search-result-item {
    padding: 8.4px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: rgba(0, 124, 173, 0.1);
}

.search-result-item:active {
    background: rgba(0, 124, 173, 0.2);
}

.result-item-name {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 3px;
}

.result-item-name strong {
    color: #007cad;
    background: rgba(0, 124, 173, 0.1);
    padding: 0 2px;
}

.result-item-info {
    font-size: 11px;
    color: #666;
}

/* Scrollbar personnalisée pour les résultats */
.search-results-list::-webkit-scrollbar {
    width: 8px;
}

.search-results-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.search-results-list::-webkit-scrollbar-thumb {
    background: #007cad;
    border-radius: 4px;
}

.search-results-list::-webkit-scrollbar-thumb:hover {
    background: #0056b3;
}

/* Responsive - Tablettes */
@media (max-width: 1024px) {
    #search-panel {
        left: 190px;
        width: 280px;
    }
}

/* Responsive - Mobiles */
@media (max-width: 768px) {
    #search-panel {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 60vh;
        border-radius: 12px 12px 0 0;
        transform: translateY(0);
    }
    
    #search-panel.hidden {
        transform: translateY(100%);
    }
    
    .search-results-list {
        max-height: 300px;
    }
}

/* Très petits écrans */
@media (max-width: 480px) {
    .search-panel-content {
        padding: 8.4px;
    }
    
    .search-input {
        font-size: 12px;
        padding: 7px 24px 7px 7px;
    }
    
    .result-item-name {
        font-size: 12px;
    }
    
    .result-item-info {
        font-size: 10px;
    }
}

/* ===== STYLES POUR LE TABLEAU DE SYNTHÈSE (RECHERCHE HYDROGRAPHIE) ===== */

/* Conteneur du tableau */
.synthesis-table-container {
    margin-top: 15px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.98);
    border: 2px solid #007cad;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Titre du tableau */
.synthesis-table-title {
    font-size: 14px;
    font-weight: bold;
    color: #007cad;
    margin: 0 0 10px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #007cad;
    text-align: center;
}

.synthesis-table-title strong {
    color: #0056b3;
}

/* Tableau */
.synthesis-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    background: white;
    border-radius: 4px;
    overflow: hidden;
}

/* En-tête du tableau */
.synthesis-table thead {
    background: rgba(0, 124, 173, 0.1);
}

.synthesis-table thead th {
    padding: 10px 8px;
    text-align: left;
    font-weight: 600;
    color: #007cad;
    border-bottom: 2px solid #007cad;
}

.synthesis-table thead th:last-child {
    text-align: right;
    width: 120px;
}

/* Corps du tableau */
.synthesis-table tbody tr {
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s ease;
}

.synthesis-table tbody tr:hover {
    background: rgba(0, 124, 173, 0.05);
}

.synthesis-table tbody td {
    padding: 8px;
    color: #333;
}

/* Colonne des nombres (longueurs) */
.synthesis-table-number {
    text-align: right;
    font-weight: 600;
    color: #007cad;
    font-family: 'Courier New', monospace;
}

/* Pied du tableau (footer) */
.synthesis-table tfoot {
    background: rgba(0, 124, 173, 0.15);
    border-top: 2px solid #007cad;
}

.synthesis-table-footer td {
    padding: 10px 8px;
    font-weight: 600;
    color: #333;
}

.synthesis-table-footer strong {
    color: #007cad;
}

.synthesis-table-footer .synthesis-table-number {
    font-size: 13px;
    color: #0056b3;
}

/* Scrollbar pour le tableau si nécessaire */
.synthesis-table-container {
    max-height: 400px;
    overflow-y: auto;
}

.synthesis-table-container::-webkit-scrollbar {
    width: 8px;
}

.synthesis-table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.synthesis-table-container::-webkit-scrollbar-thumb {
    background: #007cad;
    border-radius: 4px;
}

.synthesis-table-container::-webkit-scrollbar-thumb:hover {
    background: #0056b3;
}

/* Responsive - Mobiles */
@media (max-width: 768px) {
    .synthesis-table-container {
        padding: 8px;
        max-height: 300px;
    }
    
    .synthesis-table-title {
        font-size: 13px;
        padding-bottom: 6px;
    }
    
    .synthesis-table {
        font-size: 11px;
    }
    
    .synthesis-table thead th {
        padding: 8px 6px;
    }
    
    .synthesis-table tbody td,
    .synthesis-table-footer td {
        padding: 6px;
    }
    
    .synthesis-table thead th:last-child {
        width: 90px;
    }
}

/* Très petits écrans */
@media (max-width: 480px) {
    .synthesis-table {
        font-size: 10px;
    }
    
    .synthesis-table thead th,
    .synthesis-table tbody td,
    .synthesis-table-footer td {
        padding: 5px 4px;
    }
    
    .synthesis-table thead th:last-child {
        width: 70px;
    }
}