/**
 * Styles personnalisés pour Chosen
 * Amélioration de l'apparence du menu déroulant de sélection des services
 */

/* Container du select avec icône */
.pharmacy-service-selector .input-with-icon {
    position: relative;
}

/* Masquer l'icône du template pour éviter la duplication */
.pharmacy-service-selector .input-with-icon > i,
.pharmacy-service-selector .input-with-icon > .im,
.pharmacy-service-selector .input-with-icon > [class*="icon"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    left: -9999px !important;
}

/* Style du conteneur Chosen */
.pharmacy-service-selector .chosen-container {
    width: 100% !important;
    font-size: 16px;
}

/* Style du select ouvert/fermé */
.pharmacy-service-selector .chosen-container-single .chosen-single {
    background: #ffffff;
    border: 1px solid #d6d6d6;
    border-radius: 4px;
    box-shadow: none !important;
    padding: 12px 40px 12px 15px;
    height: auto;
    line-height: 1.5;
    color: #333;
    transition: all 0.3s ease;
}

/* Hover state */
.pharmacy-service-selector .chosen-container-single .chosen-single:hover {
    border-color: #74b9ff;
}

/* Focus/Active state */
.pharmacy-service-selector .chosen-container-active.chosen-with-drop .chosen-single {
    border-color: #74b9ff;
    box-shadow: 0 0 0 3px rgba(116, 185, 255, 0.1) !important;
}

/* Texte du select */
.pharmacy-service-selector .chosen-container-single .chosen-single span {
    margin-right: 0;
    padding-right: 0;
}

/* Flèche dropdown */
.pharmacy-service-selector .chosen-container-single .chosen-single div {
    width: 30px;
    right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Masquer le pseudo-élément ::after qui crée une deuxième flèche */
.pharmacy-service-selector .chosen-container-single .chosen-single div::after {
    display: none !important;
    content: none !important;
}

.pharmacy-service-selector .chosen-container-single .chosen-single div b {
    background-image: none !important;
    background: transparent !important;
    /* Créer une flèche CSS personnalisée */
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #666;
    position: static;
    margin: 0;
}

.pharmacy-service-selector .chosen-container-active.chosen-with-drop .chosen-single div b {
    border-top: none;
    border-bottom: 5px solid #666;
}

/* Masquer les icônes en double (flèches haut/bas qui apparaissent parfois) */
.pharmacy-service-selector .chosen-container .chosen-results-scroll-up,
.pharmacy-service-selector .chosen-container .chosen-results-scroll-down {
    display: none !important;
}

/* Masquer l'icône de recherche en double dans le dropdown */
.pharmacy-service-selector .chosen-container .chosen-drop .chosen-search::after,
.pharmacy-service-selector .chosen-container .chosen-drop .chosen-search::before {
    display: none !important;
}

.pharmacy-service-selector .chosen-container .chosen-search {
    position: relative;
}

/* Si l'icône est ajoutée via un pseudo-élément ou un élément enfant */
.pharmacy-service-selector .chosen-container .chosen-search .search-icon,
.pharmacy-service-selector .chosen-container .chosen-search i,
.pharmacy-service-selector .chosen-container .chosen-search .im,
.pharmacy-service-selector .chosen-container .chosen-search [class*="icon"],
.pharmacy-service-selector .chosen-drop i,
.pharmacy-service-selector .chosen-drop .im,
.pharmacy-service-selector .chosen-drop [class*="icon"]:not(.chosen-single) {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Menu dropdown */
.pharmacy-service-selector .chosen-container .chosen-drop {
    border: 1px solid #d6d6d6;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
    margin-top: -1px;
}

/* Résultats de la recherche */
.pharmacy-service-selector .chosen-container .chosen-results {
    max-height: 300px;
    padding: 0;
    margin: 0;
}

/* Items de la liste */
.pharmacy-service-selector .chosen-container .chosen-results li {
    padding: 12px 15px;
    line-height: 1.5;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.pharmacy-service-selector .chosen-container .chosen-results li:last-child {
    border-bottom: none;
}

/* Hover sur les items */
.pharmacy-service-selector .chosen-container .chosen-results li.highlighted {
    background: #f8f9fa;
    color: #333;
    background-image: none;
}

/* Item sélectionné */
.pharmacy-service-selector .chosen-container .chosen-results li.result-selected {
    background: #e8f4ff;
    color: #0066cc;
}

/* Groupes d'options */
.pharmacy-service-selector .chosen-container .chosen-results li.group-result {
    font-weight: 600;
    color: #666;
    background: #f8f9fa;
    padding: 10px 15px;
    cursor: default;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Options dans un groupe */
.pharmacy-service-selector .chosen-container .chosen-results li.group-option {
    padding-left: 25px;
}

/* Message "Pas de résultats" */
.pharmacy-service-selector .chosen-container .chosen-results li.no-results {
    background: #fff;
    color: #999;
    padding: 15px;
    text-align: center;
}

/* Champ de recherche dans le dropdown */
.pharmacy-service-selector .chosen-container .chosen-search input[type="text"] {
    border: 1px solid #d6d6d6;
    border-radius: 4px;
    padding: 10px 15px;
    margin: 10px;
    width: calc(100% - 20px);
    box-shadow: none !important;
    font-size: 15px;
    background-image: none !important;
    background: #fff !important;
}

.pharmacy-service-selector .chosen-container .chosen-search input[type="text"]:focus {
    border-color: #74b9ff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(116, 185, 255, 0.1) !important;
}

/* Responsive */
@media (max-width: 768px) {
    .pharmacy-service-selector .chosen-container-single .chosen-single {
        padding: 10px 35px 10px 12px;
        font-size: 15px;
    }

    .pharmacy-service-selector .chosen-container .chosen-results li {
        padding: 10px 12px;
        font-size: 15px;
    }
}

/**
 * Styles pour le sélecteur d'horaires dans le modal de rendez-vous
 * Applique les mêmes styles que le sélecteur de service
 */

/* Style du conteneur Chosen pour le time selector */
#appointment-modal .chosen-container {
    width: 100% !important;
    font-size: 16px;
}

/* Style du select ouvert/fermé */
#appointment-modal .chosen-container-single .chosen-single {
    background: #ffffff;
    border: 1px solid #d6d6d6;
    border-radius: 4px;
    box-shadow: none !important;
    padding: 12px 40px 12px 15px;
    height: auto;
    line-height: 1.5;
    color: #333;
    transition: all 0.3s ease;
}

/* Hover state */
#appointment-modal .chosen-container-single .chosen-single:hover {
    border-color: #74b9ff;
}

/* Focus/Active state */
#appointment-modal .chosen-container-active.chosen-with-drop .chosen-single {
    border-color: #74b9ff;
    box-shadow: 0 0 0 3px rgba(116, 185, 255, 0.1) !important;
}

/* Texte du select */
#appointment-modal .chosen-container-single .chosen-single span {
    margin-right: 0;
    padding-right: 0;
}

/* Flèche dropdown */
#appointment-modal .chosen-container-single .chosen-single div {
    width: 30px;
    right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Masquer le pseudo-élément ::after qui crée une deuxième flèche */
#appointment-modal .chosen-container-single .chosen-single div::after {
    display: none !important;
    content: none !important;
}

#appointment-modal .chosen-container-single .chosen-single div b {
    background-image: none !important;
    background: transparent !important;
    /* Créer une flèche CSS personnalisée */
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #666;
    position: static;
    margin: 0;
}

#appointment-modal .chosen-container-active.chosen-with-drop .chosen-single div b {
    border-top: none;
    border-bottom: 5px solid #666;
}

/* Menu dropdown */
#appointment-modal .chosen-container .chosen-drop {
    border: 1px solid #d6d6d6;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
    margin-top: -1px;
}

/* Résultats de la recherche */
#appointment-modal .chosen-container .chosen-results {
    max-height: 300px;
    padding: 0;
    margin: 0;
}

/* Items de la liste */
#appointment-modal .chosen-container .chosen-results li {
    padding: 12px 15px;
    line-height: 1.5;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

#appointment-modal .chosen-container .chosen-results li:last-child {
    border-bottom: none;
}

/* Hover sur les items */
#appointment-modal .chosen-container .chosen-results li.highlighted {
    background: #f8f9fa;
    color: #333;
    background-image: none;
}

/* Item sélectionné */
#appointment-modal .chosen-container .chosen-results li.result-selected {
    background: #e8f4ff;
    color: #0066cc;
}

/* Champ de recherche dans le dropdown */
#appointment-modal .chosen-container .chosen-search input[type="text"] {
    border: 1px solid #d6d6d6;
    border-radius: 4px;
    padding: 10px 15px;
    margin: 10px;
    width: calc(100% - 20px);
    box-shadow: none !important;
    font-size: 15px;
    background-image: none !important;
    background: #fff !important;
}

#appointment-modal .chosen-container .chosen-search input[type="text"]:focus {
    border-color: #74b9ff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(116, 185, 255, 0.1) !important;
}
