/* assets/css/search.css */

.ai-search-container {
    max-width: 800px;
    margin: 2rem auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.ai-search-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.ai-search-input {
    flex: 1;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px 0 0 8px;
    outline: none;
    transition: border-color 0.3s ease;
}

.ai-search-input:focus {
    border-color: #3b82f6;
}

.ai-search-button {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 0 8px 8px 0;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ai-search-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.4);
}

.ai-search-button:active {
    transform: translateY(0);
}

/* Résultats */
.ai-search-results {
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.ai-search-results.active {
    opacity: 1;
    transform: translateY(0);
}

.ai-search-header {
    padding: 1rem 0;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 1.5rem;
}

.ai-search-header h3 {
    margin: 0;
    color: #1e293b;
    font-size: 1.25rem;
}

/* Loading */
.ai-search-loading {
    text-align: center;
    padding: 3rem;
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 1rem;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Items de résultats */
.ai-search-results-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.ai-search-result-item {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.ai-search-result-item:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    border-color: #cbd5e1;
}

.result-thumbnail {
    flex-shrink: 0;
    width: 150px;
    height: 100px;
    overflow: hidden;
    border-radius: 8px;
}

.result-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.result-content {
    flex: 1;
    min-width: 0;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.result-header h4 {
    margin: 0;
    font-size: 1.25rem;
    line-height: 1.4;
}

.result-header h4 a {
    color: #1e293b;
    text-decoration: none;
    transition: color 0.2s ease;
}

.result-header h4 a:hover {
    color: #667eea;
}

.result-header h4 mark {
    background-color: #fef3c7;
    color: #92400e;
    padding: 0.1em 0.3em;
    border-radius: 3px;
}

/* Badge de pertinence */
.relevance-badge {
    flex-shrink: 0;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.relevance-badge.high {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.relevance-badge.medium {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.relevance-badge.low {
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
    color: white;
}

/* Extrait */
.result-excerpt {
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0 0 1rem;
}

.result-excerpt mark {
    background-color: #fef3c7;
    color: #92400e;
    padding: 0.1em 0.3em;
    border-radius: 3px;
    font-weight: 500;
}

/* Métadonnées */
.result-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    color: #64748b;
}

.result-date {
    display: inline-flex;
    align-items: center;
}

.result-date::before {
    content: "📅";
    margin-right: 0.5rem;
}

.result-categories {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.category-tag {
    padding: 0.25rem 0.75rem;
    background: #f1f5f9;
    color: #475569;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* No results */
.ai-search-no-results,
.ai-search-error {
    text-align: center;
    padding: 3rem;
    color: #64748b;
}

.ai-search-no-results p,
.ai-search-error p {
    font-size: 1.1rem;
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .ai-search-container {
        padding: 0 1rem;
    }
    
    .ai-search-form {
        flex-direction: column;
    }
    
    .ai-search-input,
    .ai-search-button {
        border-radius: 8px;
    }
    
    .ai-search-result-item {
        flex-direction: column;
    }
    
    .result-thumbnail {
        width: 100%;
        height: 200px;
    }
    
    .result-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .result-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* Animation d'apparition */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-search-result-item {
    animation: fadeInUp 0.4s ease forwards;
}

.ai-search-result-item:nth-child(1) { animation-delay: 0.05s; }
.ai-search-result-item:nth-child(2) { animation-delay: 0.1s; }
.ai-search-result-item:nth-child(3) { animation-delay: 0.15s; }
.ai-search-result-item:nth-child(4) { animation-delay: 0.2s; }
.ai-search-result-item:nth-child(5) { animation-delay: 0.25s; }