/* ================================
   MODERN SEARCH SYSTEM - CSS COMPLET
   ================================ */

/* Overlay léger */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;

    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.search-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Conteneur principal de la recherche */
.modern-search-dropdown {
    position: fixed;
    top: 80px;
    /* Ajustez selon la hauteur de votre header */
    right: 20px;
    width: 450px;
    max-width: calc(100vw - 40px);
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    transform: translateY(-20px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.modern-search-dropdown.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

/* Container interne */
.search-container {
    padding: 15px;
}

/* Header de la recherche */
.search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.search-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
}

.search-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #718096;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-close:hover {
    background-color: #fee;
    color: #e53e3e;
    transform: rotate(90deg) scale(1.1);
}

.search-close:active {
    transform: rotate(90deg) scale(0.95);
}

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

.modern-search-form {
    display: flex;
    align-items: center;
    width: 100%;
}

.search-input-group {
    position: relative;
    display: flex;
    align-items: center;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 2px solid transparent;
    transition: all 0.3s ease;
    width: 100%;
}

.search-input-group:focus-within {
    border-color: #4299e1;
    box-shadow: 0 4px 20px rgba(66, 153, 225, 0.2);
}

.search-input {
    flex: 1;
    padding: 16px 20px;
    border: none;
    background: transparent;
    font-size: 16px;
    color: #2d3748;
    outline: none;
    border-radius: 15px;
}

.search-input::placeholder {
    color: #a0aec0;
}

.search-submit-btn {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    border: none;
    padding: 12px 16px;
    border-radius: 12px;
    margin-right: 6px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 48px;
}

.search-submit-btn:hover {
    background: linear-gradient(135deg, #3182ce 0%, #2c5282 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(66, 153, 225, 0.3);
}

.search-submit-btn:active {
    transform: translateY(0);
}

/* Icône de recherche dans le bouton */
.search-submit-btn i {
    font-size: 16px;
}

/* Suggestions de recherche */
.search-suggestions {
    margin-bottom: 20px;
}

.search-suggestions h4 {
    margin: 0 0 15px 0;
    font-size: 14px;
    font-weight: 600;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.suggestion-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.suggestion-tag {
    background: linear-gradient(135deg, #edf2f7 0%, #e2e8f0 100%);
    color: #4a5568;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    white-space: nowrap;
}

.suggestion-tag:hover {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(66, 153, 225, 0.3);
}

/* Résultats de recherche */
.search-results {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.search-results h4 {
    margin: 0 0 15px 0;
    font-size: 14px;
    font-weight: 600;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.results-list {
    max-height: 200px;
    overflow-y: auto;
}

.result-item {
    padding: 12px 0;
    border-bottom: 1px solid #f7fafc;
    cursor: pointer;
    transition: all 0.2s ease;
}

.result-item:hover {
    background-color: #f7fafc;
    margin: 0 -10px;
    padding: 12px 10px;
    border-radius: 8px;
}

.result-item:last-child {
    border-bottom: none;
}

.result-title {
    font-size: 14px;
    font-weight: 500;
    color: #2d3748;
    margin-bottom: 4px;
}

.result-description {
    font-size: 12px;
    color: #718096;
}

/* Styles pour les highlights de recherche */
.search-highlight {
    background: #ffed4a;
    color: #1a202c;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.search-highlight-active {
    background: #4299e1 !important;
    color: white !important;
    box-shadow: 0 0 0 2px rgba(66, 153, 225, 0.4);
    animation: highlight-pulse 1s ease-in-out;
}

.search-target-highlight {
    background: rgba(66, 153, 225, 0.12);
    border-left: 4px solid #4299e1;
    border-radius: 6px;
    padding-left: 6px;
    transition: all 0.3s ease;
    margin: 2px 0;
}

/* Animation pour le highlight actuel */
@keyframes highlight-pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* Contrôles de navigation */
.search-navigation {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 15px;
    border-radius: 10px;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    font-size: 14px;
    animation: slideInUp 0.3s ease;
}

.search-navigation button {
    background: #4299e1;
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
    min-width: 80px;
}

.search-navigation button:hover {
    background: #3182ce;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

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

.search-navigation .nav-close {
    background: #e53e3e;
    margin-left: 10px;
}

.search-navigation .nav-close:hover {
    background: #c53030;
}

.search-navigation .nav-counter {
    font-weight: 600;
    color: #e2e8f0;
    min-width: 50px;
    text-align: center;
}

.search-navigation .nav-shortcuts {
    font-size: 11px;
    color: #ccc;
    margin-left: 10px;
}

/* Animation d'entrée pour les contrôles */
@keyframes slideInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Message "Aucun résultat" */
.search-no-results {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px;
    border-radius: 8px;
    z-index: 10000;
    text-align: center;
    font-size: 16px;
    animation: fadeInScale 0.3s ease;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Bouton de recherche dans le header */
.pbmit-header-search-btn {
    position: relative;
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.pbmit-header-search-btn:hover {
    background-color: rgba(66, 153, 225, 0.1);
    transform: scale(1.1);
}

.pbmit-header-search-btn i {
    font-size: 20px !important;
    line-height: 1;
    color: #4a5568;
    transition: color 0.3s ease;
}

.pbmit-header-search-btn:hover i {
    color: #4299e1;
}

/* État du body quand la recherche est ouverte */
body.search-open {
    overflow: hidden;
}

/* Animations générales */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modern-search-dropdown.active .search-container>* {
    animation: fadeInUp 0.6s ease forwards;
}

/* Styles pour les barres de défilement */
.results-list::-webkit-scrollbar {
    width: 6px;
}

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

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

.results-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .modern-search-dropdown {
        top: 70px;
        right: 15px;
        left: 15px;
        width: auto;
        max-width: none;
    }

    .search-container {
        padding: 20px;
    }

    .search-header h3 {
        font-size: 16px;
    }

    .search-input {
        padding: 14px 16px;
        font-size: 15px;
    }

    .search-submit-btn {
        padding: 10px 12px;
        min-width: 44px;
        height: 44px;
    }

    .suggestion-tags {
        gap: 6px;
    }

    .suggestion-tag {
        padding: 6px 12px;
        font-size: 12px;
    }

    .search-navigation {
        bottom: 10px;
        right: 10px;
        left: 10px;
        flex-direction: column;
        gap: 8px;
        padding: 12px;
    }

    .search-navigation .nav-shortcuts {
        text-align: center;
        margin-left: 0 !important;
    }

    .search-navigation button {
        min-width: 70px;
    }
}

@media (max-width: 480px) {
    .modern-search-dropdown {
        top: 65px;
        right: 10px;
        left: 10px;
    }

    .search-container {
        padding: 18px;
    }

    .search-input {
        padding: 12px 14px;
        font-size: 14px;
    }

    .search-submit-btn {
        padding: 8px 10px;
        min-width: 40px;
        height: 40px;
    }

    .search-navigation {
        padding: 10px;
        font-size: 12px;
    }

    .search-navigation button {
        padding: 6px 10px;
        font-size: 11px;
        min-width: 60px;
    }

    .search-no-results {
        padding: 15px;
        font-size: 14px;
        max-width: 80%;
    }
}

/* Amélioration du contraste et de l'accessibilité */
.modern-search-dropdown {
    border: 1px solid #e2e8f0;
}

.search-input:focus {
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

/* Focus visible pour l'accessibilité */
.search-close:focus,
.search-submit-btn:focus,
.suggestion-tag:focus,
.search-navigation button:focus {
    outline: 2px solid #4299e1;
    outline-offset: 2px;
}

/* Prévenr la sélection du texte dans les contrôles */
.search-navigation,
.search-header,
.suggestion-tag {
    user-select: none;
}

/* Amélioration de la lisibilité des highlights */
.search-highlight {
    line-height: 1.2;
}

/* Transition fluide pour les éléments interactifs */
.search-close,
.search-submit-btn,
.suggestion-tag,
.search-navigation button {
    transition: all 0.2s ease;
}

/* État de chargement (optionnel) */
.search-loading {
    opacity: 0.6;
    pointer-events: none;
}

.search-loading .search-submit-btn {
    background: #a0aec0;
}

/* Styles pour les touches de raccourci */
.search-shortcut-key {
    background: rgba(255, 255, 255, 0.2);
    color: #e2e8f0;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    margin: 0 2px;
}