/* ============================================
   RECHERCHE INTELLIGENTE - STYLE MODERNE
   ============================================ */

.search-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    min-height: calc(100vh - 200px);
}

/* Header de recherche */
.search-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

.search-header-content {
    max-width: 800px;
    margin: 0 auto;
}

.search-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.search-title i {
    -webkit-text-fill-color: white;
    color: white;
    background: none;
}

.search-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Barre de recherche principale */
.search-main-container {
    margin-bottom: 3rem;
}

.search-box-wrapper {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
}

.search-form {
    display: flex;
    gap: 0;
    align-items: stretch;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 0.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.search-form:focus-within {
    border-color: var(--accent-yellow);
    box-shadow: 0 10px 40px rgba(251, 191, 36, 0.2);
    transform: translateY(-2px);
}

.search-input-container {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 1.5rem;
    color: var(--text-muted);
    font-size: 1.2rem;
    z-index: 1;
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 1.25rem;
    font-size: 1.1rem;
    border: none;
    background: var(--bg-darker);
    color: var(--text-light);
    border-radius: var(--radius-lg);
    outline: none;
    transition: all 0.3s ease;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-input:focus {
    background: var(--bg-card);
}

.search-clear {
    position: absolute;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.search-clear:hover {
    background: var(--bg-card);
    color: var(--text-light);
}

.search-submit-btn {
    padding: 1.25rem 2rem;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.search-submit-btn:hover {
    background: linear-gradient(135deg, #059669, #10b981);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.search-submit-btn:active {
    transform: translateY(0);
}

/* Suggestions */
.search-suggestions {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    border: 2px solid var(--border-color);
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
}

.suggestions-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.suggestions-list {
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
}

.suggestion-item {
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-light);
}

.suggestion-item:hover {
    background: var(--bg-darker);
    color: var(--accent-yellow);
}

.suggestion-item i {
    width: 20px;
    text-align: center;
    color: var(--text-muted);
}

.suggestion-item:hover i {
    color: var(--accent-yellow);
}

/* Résultats */
.search-results-container {
    margin-top: 3rem;
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.results-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.results-count {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-light);
}

.results-query {
    font-size: 1rem;
    color: var(--text-muted);
    font-style: italic;
}

.results-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.75rem 1.25rem;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-btn:hover {
    border-color: var(--accent-yellow);
    color: var(--accent-yellow);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--accent-yellow), #f59e0b);
    border-color: var(--accent-yellow);
    color: var(--bg-dark);
}

/* Grille de résultats */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 1.5rem;
}

/* Cartes de résultats */
.result-card {
    background: linear-gradient(135deg, var(--bg-card), var(--bg-darker));
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid var(--border-color);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-gold), #4ef500);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.result-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    border-color: var(--accent-yellow);
}

.result-card:hover::before {
    transform: scaleX(1);
}

.result-header {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.result-icon {
    width: 70px;
    height: 70px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.result-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent);
    border-radius: var(--radius-lg);
}

.result-icon.client {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.result-icon.dossier {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.result-icon.paiement {
    background: linear-gradient(135deg, #10b981, #059669);
}

.result-icon.audience {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.result-icon.document {
    background: linear-gradient(135deg, #6b7280, #4b5563);
}

.result-title-section {
    flex: 1;
}

.result-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.result-type {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(245, 158, 11, 0.15));
    color: var(--accent-yellow);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid rgba(251, 191, 36, 0.3);
    display: inline-block;
}

.result-content {
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.result-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
    color: var(--text-light);
    font-size: 0.9rem;
}

.result-meta-item i {
    color: var(--accent-yellow);
}

.result-meta-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(251, 191, 36, 0.3);
    transform: translateY(-1px);
}

.result-actions {
    display: flex;
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.action-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.action-btn.primary {
    background: linear-gradient(135deg, var(--accent-yellow), #f59e0b);
    color: var(--bg-dark);
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.3);
}

.action-btn.primary:hover {
    background: linear-gradient(135deg, #f59e0b, var(--accent-yellow));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(251, 191, 36, 0.4);
}

.action-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    border: 2px solid var(--border-color);
}

.action-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent-yellow);
    color: var(--accent-yellow);
    transform: translateY(-2px);
}

.action-btn.success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: rgb(253, 255, 254);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.action-btn.success:hover {
    background: linear-gradient(135deg, #059669, #10b981);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

/* État vide */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 5rem;
    margin-bottom: 1.5rem;
    opacity: 0.5;
    color: var(--text-muted);
}

.empty-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-light);
}

.empty-description {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.empty-tips {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.tip-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    color: var(--text-light);
}

.tip-item i {
    color: var(--accent-yellow);
}

/* Loading */
.loading-state {
    text-align: center;
    padding: 4rem 2rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--accent-yellow);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-state p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .search-page {
        padding: 1rem;
    }
    
    .search-title {
        font-size: 2rem;
    }
    
    .search-subtitle {
        font-size: 1rem;
    }
    
    .search-form {
        flex-direction: column;
    }
    
    .search-submit-btn {
        width: 100%;
        justify-content: center;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .results-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .results-filters {
        justify-content: center;
    }
    
    .result-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .result-meta {
        flex-direction: column;
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Scrollbar personnalisée */
.search-suggestions::-webkit-scrollbar {
    width: 8px;
}

.search-suggestions::-webkit-scrollbar-track {
    background: var(--bg-darker);
}

.search-suggestions::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.search-suggestions::-webkit-scrollbar-thumb:hover {
    background: var(--accent-yellow);
}
