/**
 * Styles pour la recherche globale - BDE Website
 */

/* Bouton de recherche dans la navigation */
.search-btn {
    position: fixed;
    top: 20px;
    right: 80px;
    z-index: 9999;
    width: 45px;
    height: 45px;
    background-color: #f9dc5b;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.search-btn:hover {
    background-color: #22507a;
    transform: scale(1.1);
}

.search-btn svg {
    width: 22px;
    height: 22px;
    color: #22507a;
    transition: color 0.3s ease;
}

.search-btn:hover svg {
    color: #fff;
}

/* Modal de recherche */
.search-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 99999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.search-modal.active {
    opacity: 1;
    visibility: visible;
}

.search-modal-content {
    width: 90%;
    max-width: 650px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.search-modal.active .search-modal-content {
    transform: translateY(0);
}

/* Header avec input */
.search-modal-header {
    display: flex;
    align-items: center;
    padding: 5px;
    background-color: #f5f5f5;
    border-bottom: 2px solid #22507a;
}

#search-input {
    flex: 1;
    padding: 18px 20px;
    font-size: 18px;
    border: none;
    background: transparent;
    font-family: pTSansRegular, sans-serif;
    outline: none;
}

#search-input::placeholder {
    color: #999;
}

.search-close {
    width: 50px;
    height: 50px;
    background: none;
    border: none;
    font-size: 30px;
    color: #999;
    cursor: pointer;
    transition: color 0.2s;
}

.search-close:hover {
    color: #db322c;
}

/* Résultats */
.search-results {
    max-height: 60vh;
    overflow-y: auto;
}

.search-placeholder {
    padding: 30px;
    color: #666;
    text-align: center;
}

.search-placeholder p {
    margin: 0 0 15px 0;
    font-family: pTSansRegular, sans-serif;
}

.search-placeholder ul {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.search-placeholder li {
    padding: 5px 0;
    color: #22507a;
    font-family: pTSansBold, sans-serif;
}

.search-placeholder li::before {
    content: "→ ";
    color: #db322c;
}

.search-shortcut {
    font-size: 0.9em;
    color: #999;
}

.search-shortcut kbd {
    display: inline-block;
    padding: 3px 8px;
    background-color: #eee;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.85em;
}

/* Header des résultats */
.search-results-header {
    padding: 15px 20px;
    background-color: #f9dc5b;
    font-family: pTSansRegular, sans-serif;
    color: #22507a;
}

/* Liste des résultats */
.search-results-list {
    padding: 10px;
}

.search-result-item {
    display: block;
    padding: 15px;
    margin-bottom: 8px;
    background-color: #f9f9f9;
    border-radius: 8px;
    text-decoration: none;
    border-left: 4px solid transparent;
    transition: all 0.2s ease;
}

.search-result-item:hover {
    background-color: #fff;
    border-left-color: #db322c;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.search-result-title {
    font-family: pTSansBold, sans-serif;
    font-size: 1.1em;
    color: #22507a;
    margin-bottom: 5px;
}

.search-result-item:hover .search-result-title {
    color: #db322c;
}

.search-result-desc {
    font-family: pTSansRegular, sans-serif;
    font-size: 0.9em;
    color: #666;
    margin-bottom: 8px;
    line-height: 1.4;
}

.search-result-sections {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.search-result-sections span {
    display: inline-block;
    padding: 3px 10px;
    background-color: #e8e8e8;
    border-radius: 20px;
    font-size: 0.8em;
    color: #555;
    font-family: pTSansRegular, sans-serif;
}

/* Aucun résultat */
.search-no-results {
    padding: 40px 20px;
    text-align: center;
    color: #666;
}

.search-no-results p {
    margin: 0 0 10px 0;
    font-family: pTSansRegular, sans-serif;
}

.search-hint {
    font-size: 0.9em;
    color: #999;
}

/* CTA Recherche (page d'accueil) */
.search-cta {
    max-width: 600px;
    margin: 30px auto;
    padding: 0 20px;
    cursor: pointer;
}

.search-cta-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.search-cta:hover .search-cta-content {
    border-color: #22507a;
    box-shadow: 0 4px 20px rgba(34, 80, 122, 0.15);
    transform: translateY(-2px);
}

.search-cta svg {
    flex-shrink: 0;
    color: #22507a;
}

.search-cta span {
    flex: 1;
    font-family: pTSansRegular, sans-serif;
    font-size: 1em;
    color: #666;
}

.search-cta:hover span {
    color: #22507a;
}

.search-cta kbd {
    display: none;
    padding: 4px 10px;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-family: monospace;
    font-size: 0.8em;
    color: #666;
}

@media (min-width: 769px) {
    .search-cta kbd {
        display: inline-block;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .search-btn {
        right: 70px;
        width: 40px;
        height: 40px;
    }

    .search-btn svg {
        width: 18px;
        height: 18px;
    }

    .search-modal {
        padding-top: 5vh;
    }

    .search-modal-content {
        width: 95%;
        border-radius: 8px;
    }

    #search-input {
        font-size: 16px;
        padding: 15px;
    }

    .search-results {
        max-height: 70vh;
    }

    .search-cta {
        margin: 20px auto;
    }

    .search-cta-content {
        padding: 12px 18px;
        border-radius: 12px;
    }

    .search-cta span {
        font-size: 0.9em;
    }
}
