/* ===========================================
   HOMY SEARCH SHORTCODE
   Fichier: homy-plugin/assets/css/homy-search.css
   =========================================== */

/* ===========================================
   WRAPPER PRINCIPAL
   =========================================== */

#homy-search-wrapper.homy-search-wrapper {
    width: 100% !important;
    max-width: 750px !important;
    margin: 0 auto !important;
    font-family: 'Raleway', -apple-system, BlinkMacSystemFont, sans-serif !important;
    -webkit-font-smoothing: antialiased !important;
}

#homy-search-wrapper.homy-search-wrapper *,
#homy-search-wrapper.homy-search-wrapper *::before,
#homy-search-wrapper.homy-search-wrapper *::after {
    box-sizing: border-box !important;
}

/* ===========================================
   CONTAINER
   =========================================== */

#homy-search-wrapper .homy-search-container {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 16px !important;
}

/* ===========================================
   BARRE DE RECHERCHE - DESKTOP
   =========================================== */

#homy-search-wrapper .homy-search-bar {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    background: rgba(255, 255, 255, 0.7) !important;
    border-radius: 99px !important;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.08) !important;
    padding: 8px !important;
    gap: 0 !important;
    transition: box-shadow 0.2s ease !important;
    border: none !important;
    gap: 15px !important;
}

#homy-search-wrapper .homy-search-bar:focus-within {
    box-shadow: 0 6px 35px rgba(60, 180, 232, 0.15) !important;
}

/* ===========================================
   ICÔNE LOCALISATION
   =========================================== */

#homy-search-wrapper .homy-search-icon {
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 28px !important;
    height: 32px !important;
    margin: 0 16px !important;
}

#homy-search-wrapper .homy-search-icon img {
    width: 28px !important;
    height: 32px !important;
    object-fit: contain !important;
    display: block !important;
}

/* ===========================================
   INPUT WRAPPER
   =========================================== */

#homy-search-wrapper .homy-search-input-wrapper {
    flex: 1 !important;
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    min-width: 0 !important;
    background: #F6FCFF !important;
    border-radius: 99px !important;
}

/* ===========================================
   INPUT
   =========================================== */

#homy-search-wrapper .homy-search-input {
    width: 100% !important;
    border: none !important;
    background: transparent !important;
    font-family: 'Raleway', sans-serif !important;
    font-size: 18px !important;
    font-weight: 400 !important;
    color: #011F28 !important;
    padding: 16px 50px 16px 0 !important;
    outline: none !important;
    margin: 0 !important;
    box-shadow: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

#homy-search-wrapper .homy-search-input::placeholder {
    color: #011F28 !important;
    opacity: 0.7 !important;
    font-weight: 400 !important;
}

#homy-search-wrapper .homy-search-input:focus {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

/* ===========================================
   BOUTON CLEAR (X)
   =========================================== */

#homy-search-wrapper .homy-search-clear {
    position: absolute !important;
    right: 8px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    border: none !important;
    background: transparent !important;
    color: #333 !important;
    cursor: pointer !important;
    transition: color 0.2s ease !important;
    padding: 0 !important;
    margin: 0 !important;
}

#homy-search-wrapper .homy-search-clear:hover {
    color: #011F28 !important;
}

#homy-search-wrapper .homy-search-clear.visible {
    display: flex !important;
}

#homy-search-wrapper .homy-search-clear svg {
    width: 22px !important;
    height: 22px !important;
    stroke-width: 2.5 !important;
}

/* ===========================================
   BOUTON RECHERCHER - DESKTOP
   =========================================== */

#homy-search-wrapper .homy-search-btn {
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    padding: 14px 25px !important;
    background: #3CB4E8 !important;
    color: #FFFFFF !important;
    border: none !important;
    border-radius: 50px !important;
    font-family: 'Raleway', sans-serif !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    white-space: nowrap !important;
    text-decoration: none !important;
    line-height: 1.2 !important;
    margin: 0 !important;
    box-shadow: none !important;
}

#homy-search-wrapper .homy-search-btn:hover {
    background: #011F28 !important;
    color: #FFFFFF !important;
}

#homy-search-wrapper .homy-search-btn svg {
    flex-shrink: 0 !important;
    width: 18px !important;
    height: 18px !important;
    stroke-width: 3 !important;
}

/* Bouton mobile - caché par défaut */
#homy-search-wrapper .homy-search-btn-mobile {
    display: none !important;
    visibility: hidden !important;
}

/* ===========================================
   DROPDOWN DES RÉSULTATS
   =========================================== */

#homy-search-wrapper .homy-search-dropdown {
    position: absolute !important;
    top: calc(100% + 10px) !important;
    left: 0 !important;
    right: 0 !important;
    background: #FFFFFF !important;
    border-radius: 24px !important;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.15) !important;
    max-height: 350px !important;
    overflow-y: auto !important;
    z-index: 99999 !important;
    display: none !important;
    border: none !important;
}

#homy-search-wrapper .homy-search-dropdown.open {
    display: block !important;
}

/* Résultats */
#homy-search-wrapper .homy-search-results {
    padding: 10px 0 !important;
}

#homy-search-wrapper .homy-search-result-item {
    display: flex !important;
    align-items: center !important;
    gap: 16px !important;
    padding: 14px 24px !important;
    cursor: pointer !important;
    transition: background 0.15s ease !important;
    text-decoration: none !important;
    border: none !important;
}

#homy-search-wrapper .homy-search-result-item:hover {
    background: #F5F5F5 !important;
}

#homy-search-wrapper .homy-search-result-item.highlighted {
    background: #F0F9FC !important;
}

#homy-search-wrapper .homy-search-result-image {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 54px !important;
    height: 54px !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
    background: #E8E8E8 !important;
}

#homy-search-wrapper .homy-search-result-image .homy-place-icon {
    width: 24px;
    height: 24px;
}

#homy-search-wrapper .homy-search-result-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}

#homy-search-wrapper .homy-search-result-info {
    flex: 1 !important;
    min-width: 0 !important;
}

#homy-search-wrapper .homy-search-result-city {
    font-family: 'Raleway', sans-serif !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #011F28 !important;
    margin: 0 0 3px !important;
    padding: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1.3 !important;
}

#homy-search-wrapper .homy-search-result-dates {
    font-family: 'Raleway', sans-serif !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    color: #011F28 !important;
    opacity: 0.6 !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.3 !important;
}

#homy-search-wrapper .homy-search-result-arrow {
    width: 18px !important;
    height: 18px !important;
    flex-shrink: 0 !important;
    color: #3CB4E8 !important;
}

#homy-search-wrapper .homy-search-result-arrow svg {
    width: 100% !important;
    height: 100% !important;
}

/* Loading */
#homy-search-wrapper .homy-search-loading {
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    padding: 35px 24px !important;
    color: #666 !important;
    font-family: 'Raleway', sans-serif !important;
    font-size: 14px !important;
}

#homy-search-wrapper .homy-search-loading.visible {
    display: flex !important;
}

#homy-search-wrapper .homy-search-spinner {
    width: 22px !important;
    height: 22px !important;
    border: 2.5px solid #E8E8E8 !important;
    border-top-color: #3CB4E8 !important;
    border-radius: 50% !important;
    animation: homy-search-spin 0.8s linear infinite !important;
}

@keyframes homy-search-spin {
    to { transform: rotate(360deg); }
}

/* Empty state */
#homy-search-wrapper .homy-search-empty {
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 35px 24px !important;
    color: #666 !important;
    font-family: 'Raleway', sans-serif !important;
    font-size: 14px !important;
}

#homy-search-wrapper .homy-search-empty.visible {
    display: flex !important;
}

/* ===========================================
   SECTION MEMBRES / AVATARS
   Position: centré sous le formulaire
   =========================================== */

#homy-search-wrapper .homy-search-members {
    display: flex !important;
    justify-content: flex-start;
    width: 100% !important;
}

@media (min-width: 768px) {
    #homy-search-wrapper .homy-members-avatars {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 5px !important;
    }
}

@media (max-width: 767px) {
    #homy-search-wrapper .homy-members-avatars {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 20px !important;
    }
}

/* Avatar circulaire */
#homy-search-wrapper .homy-member-avatar {
    width: 52px !important;
    height: 52px !important;
    border-radius: 50% !important;
    overflow: hidden !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
    background: #E8E8E8 !important;
    flex-shrink: 0 !important;
}

#homy-search-wrapper .homy-member-avatar:first-child {
    margin-left: 0 !important;
}

#homy-search-wrapper .homy-member-avatar img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}

/* Compteur de membres - design carré arrondi */
#homy-search-wrapper .homy-member-count {
    width: 30px !important;
    height: 35px !important;
    border-radius: 10px !important;
    border: none !important;
    background: #F5F5F5 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08) !important;
    flex-shrink: 0 !important;
    margin-left: 5px !important;
}

#homy-search-wrapper .homy-member-count span {
    font-family: 'Raleway', sans-serif !important;
    font-size: 16px !important;
    font-weight: normal !important;
    color: #757575 !important;
}

/* ===========================================
   RESPONSIVE - MOBILE
   =========================================== */

@media (max-width: 768px) {
    #homy-search-wrapper .homy-search-members {
        margin-top: 20px !important;
    }

    #homy-search-wrapper .homy-member-avatar {
        width: 46px !important;
        height: 46px !important;
        margin-left: -12px !important;
        border-width: 2px !important;
    }

    #homy-search-wrapper .homy-member-avatar:first-child {
        margin-left: 0 !important;
    }

    #homy-search-wrapper .homy-member-count {
        width: 46px !important;
        height: 46px !important;
        margin-left: -6px !important;
        border-radius: 12px !important;
    }

    #homy-search-wrapper .homy-member-count span {
        font-size: 14px !important;
    }
}

/* ===========================================
   RESPONSIVE - MOBILE
   =========================================== */

@media (max-width: 768px) {
    #homy-search-wrapper.homy-search-wrapper {
        max-width: 100% !important;
        padding: 0 16px !important;
    }

    #homy-search-wrapper .homy-search-container {
        gap: 12px !important;
    }

    /* Barre de recherche mobile - bloc blanc complet */
    #homy-search-wrapper .homy-search-bar {
        padding: 0 !important;
        border-radius: 99px !important;
        background: rgba(255, 255, 255, 0.95) !important;
        box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08) !important;
    }

    /* Icône mobile - à l'intérieur du bloc */
    #homy-search-wrapper .homy-search-icon {
        width: 24px !important;
        height: 28px !important;
        margin: 0 0 0 20px !important;
    }

    #homy-search-wrapper .homy-search-icon img {
        width: 24px !important;
        height: 28px !important;
    }

    /* Input wrapper mobile - pas de fond séparé */
    #homy-search-wrapper .homy-search-input-wrapper {
        background: transparent !important;
        border-radius: 0 !important;
    }

    /* Input mobile */
    #homy-search-wrapper .homy-search-input {
        font-size: 16px !important;
        padding: 18px 40px 18px 16px !important;
    }

    /* Clear button mobile */
    #homy-search-wrapper .homy-search-clear {
        right: 12px !important;
    }

    /* Cacher le bouton intégré sur mobile */
    #homy-search-wrapper .homy-search-btn {
        display: none !important;
    }

    /* Afficher le bouton séparé sur mobile */
    #homy-search-wrapper .homy-search-btn-mobile {
        display: flex !important;
        visibility: visible !important;
        align-items: center !important;
        justify-content: center !important;
        width: auto !important;
        padding: 16px 32px !important;
        background: #3CB4E8 !important;
        color: #FFFFFF !important;
        border: none !important;
        border-radius: 99px !important;
        font-family: 'Raleway', sans-serif !important;
        font-size: 16px !important;
        font-weight: 600 !important;
        cursor: pointer !important;
        transition: all 0.2s ease !important;
        box-shadow: 0 4px 15px rgba(60, 180, 232, 0.25) !important;
        text-decoration: none !important;
        margin: 0 !important;
    }

    #homy-search-wrapper .homy-search-btn-mobile:hover {
        background: #245F71 !important;
        color: #FFFFFF !important;
    }

    /* Dropdown mobile */
    #homy-search-wrapper .homy-search-dropdown {
        border-radius: 20px !important;
        max-height: 300px !important;
    }

    #homy-search-wrapper .homy-search-result-item {
        padding: 12px 18px !important;
        gap: 12px !important;
    }

    #homy-search-wrapper .homy-search-result-image {
        width: 48px !important;
        height: 48px !important;
        border-radius: 10px !important;
    }

    #homy-search-wrapper .homy-search-result-city {
        font-size: 15px !important;
    }

    #homy-search-wrapper .homy-search-result-dates {
        font-size: 13px !important;
    }

    /* Avatars mobile */
    #homy-search-wrapper .homy-search-members {
        margin-top: 20px !important;
    }

    #homy-search-wrapper .homy-member-avatar,
    #homy-search-wrapper .homy-member-count {
        width: 46px !important;
        height: 46px !important;
        margin-left: -12px !important;
        border-width: 2px !important;
    }

    #homy-search-wrapper .homy-member-avatar:first-child {
        margin-left: 0 !important;
    }

    #homy-search-wrapper .homy-member-count span {
        font-size: 13px !important;
    }
}

/* Afficher le bouton séparé sur mobile */
#homy-search-wrapper .homy-search-btn-mobile {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 18px 36px !important;
    background: #3CB4E8 !important;
    color: #FFFFFF !important;
    border: none !important;
    border-radius: 50px !important;
    font-family: 'Raleway', sans-serif !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 4px 20px rgba(60, 180, 232, 0.3) !important;
    text-decoration: none !important;
    margin: 0 !important;
}

#homy-search-wrapper .homy-search-btn-mobile:hover {
    background: #245F71 !important;
    color: #FFFFFF !important;
}

/* Input mobile */
#homy-search-wrapper .homy-search-input {
    font-size: 18px !important;
    padding: 12px 40px 12px 0 !important;
}

/* Clear button mobile */
#homy-search-wrapper .homy-search-clear {
    right: 4px !important;
}

/* Dropdown mobile */
#homy-search-wrapper .homy-search-dropdown {
    border-radius: 20px !important;
    max-height: 300px !important;
}

#homy-search-wrapper .homy-search-result-item {
    padding: 12px 18px !important;
    gap: 12px !important;
}

#homy-search-wrapper .homy-search-result-image {
    width: 48px !important;
    height: 48px !important;
    border-radius: 10px !important;
}

#homy-search-wrapper .homy-search-result-city {
    font-size: 15px !important;
}

#homy-search-wrapper .homy-search-result-dates {
    font-size: 13px !important;
}

@media (min-width: 768px) {
#homy-search-wrapper .homy-search-members {
    position: relative;
    top: -55px;
    }
}

@media (max-width: 767px) {
    #homy-search-wrapper .homy-search-members {
        position: relative;
        top: -3px;
    }
}

#homy-search-wrapper .homy-member-avatar {
    width: 46px !important;
    height: 46px !important;
}

#homy-search-wrapper .homy-member-avatar:first-child {
    margin-left: 0 !important;
}

#homy-search-wrapper .homy-member-count span {
    font-size: 18px !important;
}

/* ===========================================
   ANIMATIONS
   =========================================== */

#homy-search-wrapper .homy-search-dropdown.open {
    animation: homy-search-dropdown-enter 0.2s ease !important;
}

@keyframes homy-search-dropdown-enter {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===========================================
   SCROLLBAR PERSONNALISÉE
   =========================================== */

#homy-search-wrapper .homy-search-dropdown::-webkit-scrollbar {
    width: 6px !important;
}

#homy-search-wrapper .homy-search-dropdown::-webkit-scrollbar-track {
    background: transparent !important;
}

#homy-search-wrapper .homy-search-dropdown::-webkit-scrollbar-thumb {
    background: #D0D0D0 !important;
    border-radius: 3px !important;
}

#homy-search-wrapper .homy-search-dropdown::-webkit-scrollbar-thumb:hover {
    background: #B0B0B0 !important;
}


#homy-search-wrapper .homy-search-result-fav {
    margin-left: auto;
    display: flex;
    align-items: center;
    width: 22px;
    height: 22px;
}

#homy-search-wrapper .homy-search-fav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    height: 100% !important;
    border: 0;
    padding: 0 !important;
    background: transparent;
    cursor: pointer;
    color: #3CB4E8; /* ton bleu */
}

#homy-search-wrapper .homy-search-fav-btn svg {
    width: 100% !important;
    height: 100% !important;
}

#homy-search-wrapper .homy-search-fav-btn:hover svg {
    fill: #3CB4E8;
}

#homy-search-wrapper .homy-search-fav-btn.is-active {
    opacity: 1;
}

/* ===========================================
   RESET ELEMENTOR OVERRIDES
   =========================================== */

#homy-search-wrapper input[type="text"], #homy-search-wrapper button {
    box-sizing: border-box !important;
    outline: none !important;
    padding: 11px 25px !important;
}

#homy-search-wrapper input[type="text"]:focus,
#homy-search-wrapper button:focus {
    outline: none !important;
    box-shadow: none !important;
}
