/**
 * Styles pour les résultats de recherche API
 * Styles modernes avec cartes, tags, et suggestions
 */

/* ===== CONTENEUR RÉSULTATS ===== */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .results-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* ===== CARTES RÉSULTATS ===== */
.result-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.result-card:hover {
    border-color: #00557f;
    box-shadow: 0 4px 12px rgba(0, 85, 127, 0.1);
    transform: translateY(-2px);
}

.result-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.result-brand {
    background: linear-gradient(135deg, #00557f 0%, #0077b3 100%);
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-category {
    background: #f5f5f5;
    color: #666;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
}

.result-title {
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
}

.result-title a {
    color: #00557f;
    text-decoration: none;
    transition: color 0.2s ease;
}

.result-title a:hover {
    color: #003d5c;
    text-decoration: underline;
}

.result-description {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 12px 0;
    flex-grow: 1;
}

/* ===== TAGS ===== */
.result-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: auto;
}

.result-tags .tag {
    background: #e8f4f8;
    color: #00557f;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid #c5e3ee;
}

/* ===== SUGGESTIONS (TYPOS/FUZZY) ===== */
.search-suggestions {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.search-suggestions h4 {
    margin: 0 0 15px 0;
    color: #856404;
    font-size: 16px;
    font-weight: 600;
}

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

.search-suggestions li {
    padding: 10px 0;
    border-bottom: 1px solid #f8e5b9;
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-suggestions li:last-child {
    border-bottom: none;
}

.suggestion-type {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.suggestion-type.fuzzy {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.suggestion-type.partial {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.suggestion-link {
    color: #856404;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.suggestion-link:hover {
    color: #533f03;
    text-decoration: underline;
}

/* ===== COMPTEURS FACETTES ===== */
.facet-count {
    color: #999;
    font-size: 12px;
    font-weight: 400;
    margin-left: 4px;
}

/* ===== LOADING STATE ===== */
.search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #666;
}

.search-loading::before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #00557f;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

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

/* ===== STATISTIQUES RÉSULTATS ===== */
.results-stats {
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #00557f;
    font-size: 14px;
    color: #333;
}

.results-stats strong {
    color: #00557f;
    font-weight: 700;
}

/* ===== RESPONSIVE MOBILE ===== */
@media (max-width: 768px) {
    .result-card {
        padding: 15px;
    }

    .result-title {
        font-size: 16px;
    }

    .result-description {
        font-size: 13px;
    }

    .result-brand,
    .result-category {
        font-size: 11px;
        padding: 3px 10px;
    }

    .search-suggestions {
        padding: 15px;
    }

    .search-suggestions h4 {
        font-size: 14px;
    }
}

/* ===== EMPTY STATE ===== */
.search-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.search-empty-state i {
    font-size: 48px;
    color: #ccc;
    margin-bottom: 20px;
}

.search-empty-state h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 20px;
}

.search-empty-state p {
    margin: 0;
    font-size: 14px;
    color: #999;
}
