/* Styles pour la barre de recherche dans le header */
.header-search-container {
    position: relative;
    display: flex;
    align-items: center;
    max-width: 350px;
    min-width: 280px;
    margin: 0 15px;
    z-index: 999;
}

.header-search-form {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.header-search-input {
    width: 100%;
    padding: 8px 40px 8px 12px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 14px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.header-search-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.header-search-input:focus {
    outline: none;
    border-color: #ffd700;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 15px rgba(255, 94, 91, 0.3);
}

.header-search-submit {
    position: absolute !important;
    right: 8px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: auto !important;
    height: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: none !important;
    padding: 8px !important;
}

.header-search-submit:hover {
    color: #ffd700;
    background: rgba(255, 94, 91, 0.1);
}

.header-search-submit i {
    font-size: 14px;
}

/* Icône de loupe mobile (cachée par défaut) */
/* Mobile search toggle button */
.mobile-search-toggle {
    display: none !important; /* Hidden by default on larger screens */
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 35px;
    height: 35px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-search-toggle:hover {
    background: rgba(255, 94, 91, 0.1);
    color: #ffd700;
}
/* Résultats de recherche */
.header-search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    min-width: 350px;
    background: #1a1a1a;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(15px);
    display: none;
}

.search-results-list {
    padding: 12px 0;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    min-height: 60px;
}

.search-result-item:hover,
.search-result-item.selected {
    background: rgba(255, 94, 91, 0.1);
    color: #ffd700;
}

.search-result-item:last-child {
    border-bottom: none;
}

.result-thumbnail {
    width: 45px;
    height: 45px;
    border-radius: 6px;
    object-fit: cover;
    margin-right: 14px;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.result-thumbnail-placeholder {
    width: 45px;
    height: 45px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 14px;
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.result-content {
    flex: 1;
    min-width: 0;
    padding-right: 8px;
}

.result-title {
    font-weight: 500;
    font-size: 15px;
    line-height: 1.4;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.result-status {
    font-size: 12px;
    opacity: 0.8;
    color: #ccc;
    font-weight: 400;
}

/* Statuts spéciaux */
.search-result-item.status-licencie .result-status {
    color: #ffd700;
}

.search-result-item.status-end .result-status {
    color: #4CAF50;
}

.search-result-item.status-canceled .result-status {
    color: #f44336;
}

.search-result-item.status-on-hold .result-status {
    color: #ff9800;
}

/* Messages d'état */
.search-loading,
.search-no-results,
.search-error {
    padding: 15px;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.search-loading {
    color: #ffd700;
}

.search-error {
    color: #f44336;
}

/* Lien "Voir tous les résultats" */
.search-view-all {
    padding: 10px 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.02);
}

.view-all-link {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffd700;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 5px;
    border-radius: 4px;
}

.view-all-link:hover {
    background: rgba(255, 94, 91, 0.1);
    color: #fff;
}

.view-all-link i {
    margin-right: 8px;
    font-size: 12px;
}

/* Responsive */
@media (max-width: 768px) {
    .header-search-container {
        max-width: none;
        min-width: auto;
        margin: 0;
        width: auto;
    }
    
    /* Cacher la barre de recherche par défaut sur mobile */
    .header-search-form {
        display: none;
        position: absolute;
        top: 100%;
        right: 0;
        width: 280px;
        background: rgba(26, 26, 26, 0.95);
        padding: 15px;
        border-radius: 12px;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
        border: 1px solid rgba(255, 255, 255, 0.15);
        backdrop-filter: blur(15px);
        margin-top: 8px;
    }
    
    /* Afficher l'icône de loupe sur mobile */
    .mobile-search-toggle {
        display: flex !important;
    }
    
    /* Quand la recherche est active sur mobile */
    .header-search-container.mobile-search-active .header-search-form {
        display: flex;
    }
    
    .header-search-input {
        font-size: 13px;
        padding: 8px 35px 8px 12px;
        border-radius: 20px;
    }
    
    .header-search-results {
        left: 0;
        right: 0;
        min-width: 100%;
        max-height: 350px;
        top: calc(100% + 5px);
    }
    
    .search-result-item {
        padding: 10px 14px;
        min-height: 55px;
    }
    
    .result-thumbnail,
    .result-thumbnail-placeholder {
        width: 40px;
        height: 40px;
        margin-right: 12px;
    }
    
    .result-title {
        font-size: 14px;
    }
    
    .result-status {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .header-search-form {
        width: 250px;
        right: -170px;
    }
    .mobile-search-toggle {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    .header-search-input {
        padding: 6px 30px 6px 10px;
        font-size: 12px;
    }
    
    .header-search-submit {
        padding: 6px;
    }
    
    .header-search-submit i {
        font-size: 12px;
    }
    
    .header-search-results {
        min-width: 100%;
        max-height: 300px;
    }
    
    .search-result-item {
        padding: 8px 12px;
        min-height: 50px;
    }
    
    .result-thumbnail,
    .result-thumbnail-placeholder {
        width: 35px;
        height: 35px;
        margin-right: 10px;
    }
    
    .result-title {
        font-size: 13px;
    }
    
    .result-status {
        font-size: 10px;
    }
}

/* Animation d'apparition */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header-search-results {
    animation: fadeInDown 0.3s ease;
}

.header-search-form {
    animation: fadeInDown 0.3s ease;
}

/* Scrollbar personnalisée pour les résultats */
.header-search-results::-webkit-scrollbar {
    width: 6px;
}

.header-search-results::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.header-search-results::-webkit-scrollbar-thumb {
    background: rgba(255, 94, 91, 0.5);
    border-radius: 3px;
}

.header-search-results::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 230, 0, 0.685);
}

/* RESET pour les résultats de recherche dans le header */
.header-search-results .search-result-item,
.header-search-results .view-all-link {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 100% !important;
    height: auto !important;
    min-height: 48px !important;
    padding: 12px 16px !important;
    font-size: 1em !important;
    border-radius: 10px !important;
    background: none !important;
    color: #ffffff !important; 
    box-sizing: border-box !important;
    text-align: left !important;
    white-space: normal !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.header-search-results .view-all-link {
    font-weight: 600 !important;
    color: #ffd700 !important;
    justify-content: center !important;
    padding: 12px 0 !important;
    min-height: 36px !important;
}

