/* ============================================
   Recherche Globale - Styles
   ============================================ */

/* Modal de recherche */
.search-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
}

.search-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.search-modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: searchModalFadeIn 0.2s ease-out;
}

@keyframes searchModalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header avec input */
.search-header {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 2px solid #e9ecef;
    background: #f8f9fa;
}

#globalSearchInput {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1.2rem;
    padding: 0.5rem 1rem;
    outline: none;
    color: #333;
}

#globalSearchInput::placeholder {
    color: #999;
}

.search-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
    padding: 0.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: all 0.2s;
}

.search-close:hover {
    background: #e9ecef;
    color: #333;
}

/* Résultats */
.search-results {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    max-height: 60vh;
}

.search-category {
    font-size: 0.85rem;
    font-weight: 700;
    color: #667eea;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 1.5rem 0 0.5rem;
    padding: 0 0.5rem;
}

.search-category:first-child {
    margin-top: 0;
}

.search-result-item {
    padding: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 0.5rem;
}

.search-result-item:hover {
    background: #f8f9fa;
    transform: translateX(4px);
}

.search-result-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1E3A8A;
    margin-bottom: 0.25rem;
}

.search-result-description {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.search-result-url {
    font-size: 0.75rem;
    color: #999;
    font-family: monospace;
}

.search-result-item mark {
    background: #FEF3C7;
    color: #92400E;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}

/* Messages d'aide */
.search-hint,
.search-no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: #999;
}

.search-no-results p:first-child {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.search-suggestion {
    font-size: 0.9rem;
    color: #999;
    margin-top: 1rem;
}

/* Footer avec shortcuts */
.search-footer {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    padding: 0.75rem;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    font-size: 0.75rem;
    color: #999;
}

.search-footer span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Bouton de recherche dans la navbar */
.nav-search-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s;
    margin-right: 1rem;
}

.nav-search-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 768px) {
    .search-modal-content {
        width: 95%;
        margin: 0 auto;
        max-height: 90vh;
    }

    .search-modal {
        padding-top: 5vh;
    }

    #globalSearchInput {
        font-size: 1rem;
    }

    .search-footer {
        font-size: 0.7rem;
        gap: 1rem;
    }

    .nav-search-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
}

/* Scrollbar personnalisée pour les résultats */
.search-results::-webkit-scrollbar {
    width: 8px;
}

.search-results::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.search-results::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.search-results::-webkit-scrollbar-thumb:hover {
    background: #555;
}
