/**
 * Styles pour le moteur de recherche avancé
 * 
 * @package Glossaire_Batiment
 * @since 1.0.0
 */

/* Container principal */
.gb-search-container {
    max-width: 800px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Formulaire de recherche */
.gb-search-form {
    margin-bottom: 20px;
}

.gb-search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #fff;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.3s ease;
}

.gb-search-input-wrapper:focus-within {
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.gb-search-input {
    flex: 1;
    padding: 15px 20px;
    border: none;
    outline: none;
    font-size: 16px;
    background: transparent;
}

.gb-search-input::placeholder {
    color: #999;
}

.gb-search-submit {
    padding: 15px 20px;
    background: #0073aa;
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.gb-search-submit:hover {
    background: #005a87;
}

.gb-search-submit .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Suggestions de recherche */
.gb-search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e1e1e1;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: none;
}

.gb-suggestions-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.gb-search-suggestion {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.gb-search-suggestion:hover {
    background: #f8f9fa;
}

.gb-search-suggestion:last-child {
    border-bottom: none;
}

/* Filtres de recherche */
.gb-search-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.gb-filter-group {
    display: flex;
    flex-direction: column;
}

.gb-filter-group label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
    font-size: 14px;
}

.gb-filter-select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.gb-filter-select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

.gb-clear-filters-btn {
    padding: 10px 15px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.gb-clear-filters-btn:hover {
    background: #5a6268;
}

/* Résultats de recherche */
.gb-search-results {
    margin-top: 20px;
}

.gb-search-results-header {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #0073aa;
}

.gb-search-results-header p {
    margin: 0;
    font-weight: 600;
    color: #333;
}

.gb-search-results-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.gb-search-result-card {
    background: white;
    border: 1px solid #e1e1e1;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.gb-search-result-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
    border-color: #0073aa;
}

.gb-result-card-header {
    padding: 20px 20px 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.gb-result-card-title {
    margin: 0 0 10px 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
}

.gb-result-card-title a {
    color: #0073aa;
    text-decoration: none;
    transition: color 0.3s ease;
}

.gb-result-card-title a:hover {
    color: #005a87;
}

.gb-result-card-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.gb-result-card-excerpt {
    margin: 0;
    padding: 15px 20px 10px 20px;
    font-weight: 500;
    color: #666;
    font-style: italic;
    background: #f8f9fa;
    border-bottom: 1px solid #f0f0f0;
}

.gb-result-card-content {
    margin: 0;
    padding: 15px 20px;
    line-height: 1.6;
    color: #333;
    font-size: 14px;
}

.gb-result-card-content mark {
    background: #fff3cd;
    color: #856404;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}

.gb-result-card-footer {
    padding: 15px 20px 20px 20px;
    background: #f8f9fa;
    border-top: 1px solid #f0f0f0;
}

.gb-result-card-link {
    display: inline-block;
    color: #0073aa;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.gb-result-card-link:hover {
    color: #005a87;
    text-decoration: underline;
}

.gb-result-category,
.gb-result-level {
    padding: 4px 8px;
    background: #e9ecef;
    color: #495057;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.gb-result-category {
    background: #d1ecf1;
    color: #0c5460;
}

.gb-result-level {
    background: #d4edda;
    color: #155724;
}

/* Pagination */
.gb-search-pagination {
    margin-top: 30px;
    text-align: center;
}

.gb-search-pagination ul {
    display: flex;
    justify-content: center;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 5px;
}

.gb-search-pagination li {
    margin: 0;
}

.gb-search-pagination a,
.gb-search-pagination span {
    display: inline-block;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #0073aa;
    transition: all 0.3s ease;
}

.gb-search-pagination a:hover {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

.gb-search-pagination .current {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

/* États de chargement et d'erreur */
.gb-search-loading {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.gb-search-loading .spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.gb-search-error {
    text-align: center;
    padding: 40px 20px;
    color: #721c24;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
}

.gb-search-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.gb-search-no-results ul {
    text-align: left;
    display: inline-block;
    margin-top: 15px;
}

.gb-search-no-results li {
    margin: 5px 0;
}

/* Modal de recherche */
.gb-search-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gb-search-modal-content {
    background: white;
    border-radius: 8px;
    max-width: 90%;
    max-height: 90%;
    width: 800px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.gb-search-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e1e1e1;
    background: #f8f9fa;
}

.gb-search-modal-header h3 {
    margin: 0;
    color: #333;
}

.gb-search-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.gb-search-modal-close:hover {
    background: #e1e1e1;
    color: #333;
}

.gb-search-modal-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .gb-search-filters {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .gb-search-modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .gb-search-pagination ul {
        flex-wrap: wrap;
    }
    
    .gb-result-meta {
        flex-direction: column;
        gap: 5px;
    }
    
    .gb-search-results-list {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .gb-result-card-title {
        font-size: 18px;
    }
    
    .gb-result-card-header,
    .gb-result-card-excerpt,
    .gb-result-card-content,
    .gb-result-card-footer {
        padding-left: 15px;
        padding-right: 15px;
    }
}

@media (max-width: 480px) {
    .gb-search-input {
        font-size: 14px;
        padding: 12px 15px;
    }
    
    .gb-search-submit {
        padding: 12px 15px;
    }
    
    .gb-search-result {
        padding: 15px;
    }
    
    .gb-search-result h4 {
        font-size: 16px;
    }
} 